Jump to content

User:Padishar/sandbox: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
No edit summary
Line 1: Line 1:
{{User sandbox}}
{{User sandbox}}
## normal scopes(including posttitle scopes) ##
# Triggers are in Province scope. The From Scope contains the settlement holder (character)
# ROOT = receiver
# start trigger is in title scope.
# FROM = giver
# <no scope change> = attacker or receiver
## title scopes ##
# Castle
# ROOT = receiver
castle = {
# FROM = giver
# Wall quality, gives fortlevel
# <no scope change> = thirdparty landed title
ca_wall_q_1 = {
#
prerequisites = { ca_wall_1 }
# the following effects/triggers exists (example execution order: on_success->on_success_title->on_success_posttitle):
build_cost = 50
# 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
build_time = 182
#
fort_level = 0.5
# Added on_attacker_leader_death, on_defender_leader_death and on_thirdparty_death, which all trigger when corresponding character dies
ai_creation_factor = 80
# 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)
start = {
#
OR = {

AND = {
claim = {
FROM = { religion_group = muslim }
name = CB_NAME_CLAIM
year = 1076
war_name = WAR_NAME_CLAIM
}
AND = {
sprite = 1
truce_days = 3650
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
hostile_against_others = yes
year = 1066
can_ask_to_join_war = no
}

AND = {
press_claim = yes
FROM = { religion_group = christian }

year = 1100
can_use_title = {
}
AND = {
OR = {
FROM = { religion_group = pagan_group }
ROOT = { is_female = no }
NOT = { ROOT = { religion_group = muslim } }
year = 1170
}
}
AND = {
OR = {
FROM = {
FROM = {
top_liege = {
has_landed_title = PREV
}
primary_title = {
OR = {
holder_scope = {
title = k_leon
is_liege_or_above = FROM
}
title = k_castille
}
title = k_aragon
OR = {
title = k_spanish_galicia
ROOT = { has_strong_claim = PREV }
title = k_navarra
title = d_barcelona
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
year = 1066
}
}
}
}
}
}
}
}
ca_wall_q_2 = {
upgrades_from = ca_wall_q_1
prerequisites = { ca_wall_2 }
build_cost = 50
build_time = 182
fort_level = 0.5
ai_creation_factor = 79


start = {
is_valid_title = {
OR = {
OR = {
AND = {
FROM = {
has_landed_title = PREV
FROM = { religion_group = muslim }
}
year = 1090
holder_scope = {
}
AND = {
is_liege_or_above = FROM
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1090
}
AND = {
FROM = { religion_group = christian }
year = 1140
}
AND = {
FROM = { religion_group = pagan_group }
year = 1180
}
}
}
}
}
ROOT = { has_claim = PREV }
}
}

ca_wall_q_3 = {
on_success_title = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 1 }
usurp_title_plus_barony_if_unlanded = ROOT
upgrades_from = ca_wall_q_2
build_cost = 50
build_time = 182
fort_level = 0.5
ai_creation_factor = 78
start = {
if = {
OR = {
limit = {
AND = {
higher_tier_than = BARON
FROM = { religion_group = muslim }
NOT = { culture = ROOT }
year = 1140
}
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1130
}
AND = {
FROM = { religion_group = christian }
year = 1160
}
AND = {
FROM = { religion_group = pagan_group }
year = 1220
}
}
}
hidden_tooltip = { conquest_culture = ROOT }
}
}
}
ca_wall_q_4 = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 3 }
upgrades_from = ca_wall_q_3
build_cost = 100
build_time = 365
fort_level = 1.0
ai_creation_factor = 77
start = {
any_attacker = {
OR = {
limit = { character = ROOT }
participation_scaled_prestige = 100
AND = {
}
FROM = { religion_group = muslim }
year = 1235
any_attacker = {
limit = { NOT = { character = ROOT } }
}
hidden_tooltip = { participation_scaled_prestige = 100 }
AND = {
}
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1240
FROM = {
}
AND = {
prestige = -100
FROM = { religion_group = christian }
year = 1230
}
AND = {
FROM = { religion_group = pagan_group }
year = 1300
}
}
}
}
}
}
ca_wall_q_5 = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 5 }
upgrades_from = ca_wall_q_4
build_cost = 100
build_time = 365
fort_level = 1.0
ai_creation_factor = 76


start = {
on_fail_title = {
OR = {
ROOT = {
AND = {
prestige = -100
}
FROM = { religion_group = muslim }
year = 1350
any_defender = {
limit = { character = FROM }
}
participation_scaled_prestige = 100
AND = {
}
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1360
any_defender = {
limit = { NOT = { character = FROM } }
}
hidden_tooltip = { participation_scaled_prestige = 100 }
AND = {
}
FROM = { religion_group = christian }
}
year = 1345

}
on_reverse_demand = {
AND = {
ROOT = {
FROM = { religion_group = pagan_group }
year = 1400
prestige = -150
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 = {
ROOT = {
remove_claim = PREV
}
}

attacker_ai_victory_worth = {
factor = -1 # always accept
}
}
attacker_ai_defeat_worth = {
#Walls, gives fortlevel, levysize and income
factor = 100
ca_wall_1 = {
}
build_cost = 50

build_time = 365
defender_ai_victory_worth = {
fort_level = 0.5
factor = -1 # always accept
levy_size = 0.025
}
tax_income = 0.2
ai_creation_factor = 90
defender_ai_defeat_worth = {
start = {
factor = 100
}
OR = {
}
AND = {

FROM = { religion_group = muslim }

year = 1076
other_claim = {
}
name = CB_NAME_CLAIM
AND = {
war_name = WAR_NAME_OTHER_CLAIM
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
sprite = 2
year = 1066
truce_days = 3650
}
hostile_against_others = yes
AND = {
can_ask_to_join_war = no
FROM = { religion_group = christian }

year = 1090
press_claim = yes
}

AND = {
can_use_title = {
FROM = { religion_group = pagan_group }
year = 1130
OR = {
ROOT = { is_female = no }
AND = {
NOT = { ROOT = { religion_group = muslim } }
NOT = { succ_law_title = { has_law = agnatic_succession } }
}
# Old version always allowed women to go for secondary titles
# AND = {
# lower_tier_than = KING
# is_primary_holder_title = no
# }
}
OR = {
FROM = {
has_landed_title = PREV
}
holder_scope = {
is_liege_or_above = FROM
}
}

NOT = {
any_war = { # when used in title scope, checks all wars for that title
attacker = {
character = ROOT
}
}
}
}
}
}
}
ca_wall_2 = {
upgrades_from = ca_wall_1
build_cost = 50
build_time = 547 #1.5y
fort_level = 0.5
levy_size = 0.025
tax_income = 0.2
ai_creation_factor = 89
start = {
OR = {
ROOT = { has_strong_claim = PREV }
OR = {
AND = {
AND = {
FROM = { religion_group = muslim }
ROOT = { has_weak_claim = PREV }
year = 1070
OR = {
is_pretender = yes # Checks vs ROOT character
}
holder_scope = { has_regent = yes }
AND = {
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1066
ROOT = { is_female = no }
holder_scope ={ is_female = yes }
}
AND = {
FROM = { religion_group = christian }
year = 1120
}
AND = {
FROM = { religion_group = pagan_group }
year = 1140
}
AND = {
FROM = {
top_liege = {
primary_title = {
title = k_seljuk_turks
}
}
}
}
is_contested = yes # Is already being contested in some form of Claim or Succession War
year = 1066
}
}
}
}
}
}
}
}
ca_wall_3 = {
upgrades_from = ca_wall_2
build_cost = 100
build_time = 730 #2y
fort_level = 1.0
levy_size = 0.05
tax_income = 0.2
ai_creation_factor = 88


start = {
is_valid_title = {
OR = {
OR = {
AND = {
FROM = {
has_landed_title = PREV
FROM = { religion_group = muslim }
}
year = 1140
holder_scope = {
}
AND = {
is_liege_or_above = FROM
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1130
}
AND = {
FROM = { religion_group = christian }
year = 1160
}
AND = {
FROM = { religion_group = pagan_group }
year = 1220
}
}
}
}
}
ROOT = { has_claim = PREV }
}
}
ca_wall_4 = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 2 }
upgrades_from = ca_wall_3
build_cost = 150
build_time = 1095 #3y
fort_level = 1.0
levy_size = 0.05
tax_income = 0.2
ai_creation_factor = 87


start = {
on_success = {
OR = {
hidden_tooltip = {
AND = {
ROOT = {
opinion = {
FROM = { religion_group = muslim }
year = 1210
modifier = pressed_my_claim
}
who = PREV
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1220
}
AND = {
FROM = { religion_group = christian }
year = 1225
}
AND = {
FROM = { religion_group = pagan_group }
year = 1280
}
}
}
}
}
any_attacker = {
limit = { character = ROOT }
participation_scaled_prestige = 100
}
any_attacker = {
limit = { NOT = { character = ROOT } }
hidden_tooltip = { participation_scaled_prestige = 100 }
}
FROM = {
prestige = -100
}
}
}
}
ca_wall_5 = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 4 }
upgrades_from = ca_wall_4
build_cost = 150
build_time = 1460 #4y
fort_level = 1.5
levy_size = 0.1
tax_income = 0.5
ai_creation_factor = 86


on_success_title = {
start = {
OR = {
if = {
AND = {
limit = {
controls_religion = yes
FROM = { religion_group = muslim }
holder_scope = { religion = catholic }
year = 1315
}
holder_scope = {
abdicate_to = ROOT
}
}
if = {
limit = {
OR = {
controls_religion = no
NOT = { holder_scope = { religion = catholic } }
}
}
AND = {
}
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1325
if = {
limit = {
holder_scope = {
same_realm = FROMFROM # The current holder and the one pressing my claim are in the same larger realm
}
}
}
AND = {
ROOT = {
set_character_flag = other_claim_tmp_flag
FROM = { religion_group = christian }
year = 1310
}
}
AND = {
}
FROM = { religion_group = pagan_group }
year = 1400
if = {
limit = {
ROOT = {
is_ruler = yes
is_liege_or_above = FROMFROM # The claimant is a vassal ruler of the presser
}
}
ROOT = {
set_character_flag = claimant_is_vassal_ruler_flag
}
}
}
}
}
}


usurp_title_plus_barony_if_unlanded = ROOT
#Keeps, gives levy and garrison size
ca_keep_1 = {
hidden_tooltip = {
build_cost = 150
# If we were erroneously vassalized, break free
build_time = 547 #1.5y
levy_size = 0.05
if = {
garrison_size = 0.05
limit = {
NOT = { ROOT = { has_character_flag = claimant_is_vassal_ruler_flag } }
ai_creation_factor = 102
holder_scope = {
is_liege_or_above = FROMFROM
start = {
OR = {
}
NOT = { de_jure_liege_or_above = FROMFROM }
AND = {
FROM = { religion_group = muslim }
ROOT = {
year = 1090
NOT = { dynasty = FROMFROM }
}
}
ROOT = { set_defacto_liege = ROOT }
}
}
AND = {
# try and vassalize, but only conditionally
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1066
if = {
limit = {
NOT = {
holder_scope = {
is_liege_or_above = FROMFROM
}
}
OR = {
de_jure_liege_or_above = FROMFROM
ROOT = { has_character_flag = claimant_is_vassal_ruler_flag }
ROOT = {
dynasty = FROMFROM
}
}
}
ROOT = {
set_defacto_liege = FROMFROM
}
}
}

AND = {
# check if the previous effect managed to make us part of the same realm
FROM = { religion_group = christian }
# if not, we'll break the other realm
year = 1105
}
if = {
AND = {
limit = {
NOT = { ROOT = { has_character_flag = other_claim_tmp_flag } }
FROM = { religion_group = pagan_group }
year = 1150
FROM = {
}
FROM = {
AND = {
top_liege = {
FROM = {
ROOT = {
top_liege = {
top_liege = {
primary_title = {
NOT = {
OR = {
character = PREVPREV
title = k_leon
}
title = k_castille
}
title = k_aragon
}
title = k_spanish_galicia
title = k_navarra
title = d_barcelona
}
}
}
}
}
}
}
}
year = 1066
ROOT = {
set_defacto_liege = ROOT
}
}
}
AND = {
# If we have become independent from our mutual liege, restore that vassal tie
if = {
limit = {
ROOT = {
has_character_flag = other_claim_tmp_flag
de_facto_liege = ROOT
}
}
FROM = {
FROM = {
top_liege = {
FROM = {
primary_title = {
top_liege = {
title = k_seljuk_turks
ROOT = {
set_defacto_liege = PREV
}
}
}
}
}
}
}
year = 1066
}
ROOT = {
clr_character_flag = other_claim_tmp_flag
clr_character_flag = claimant_is_vassal_ruler_flag
}
}
}
}
}
if = {
limit = {
higher_tier_than = BARON
NOT = { culture = ROOT }
}
hidden_tooltip = { conquest_culture = ROOT }
}
}
}
}
ca_keep_2 = {
prerequisites = { ca_wall_1 }
upgrades_from = ca_keep_1
build_cost = 200
build_time = 730 #2y
levy_size = 0.1
garrison_size = 0.1
ai_creation_factor = 101


start = {
on_fail_title = {
OR = {
ROOT = {
AND = {
prestige = -100
}
FROM = { religion_group = muslim }
year = 1100
FROM = {
}
FROM = {
AND = {
prestige = -100
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1085
}
AND = {
FROM = { religion_group = christian }
year = 1120
}
AND = {
FROM = { religion_group = pagan_group }
year = 1150
}
}
}
}
}
}
ca_keep_3 = {
prerequisites = { ca_wall_2 }
upgrades_from = ca_keep_2
build_cost = 300
build_time = 1095 #3y
levy_size = 0.15
garrison_size = 0.15
ai_creation_factor = 100
start = {
any_defender = {
OR = {
limit = { character = FROM }
participation_scaled_prestige = 100
AND = {
}
FROM = { religion_group = muslim }
year = 1155
any_defender = {
limit = { NOT = { character = FROM } }
}
hidden_tooltip = { participation_scaled_prestige = 100 }
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1145
}
AND = {
FROM = { religion_group = christian }
year = 1175
}
AND = {
FROM = { religion_group = pagan_group }
year = 1240
}
}
}
}
}
}
ca_keep_4 = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 1 }
upgrades_from = ca_keep_3
build_cost = 400
build_time = 1460 #4y
levy_size = 0.2
garrison_size = 0.2
ai_creation_factor = 99


on_reverse_demand = {
start = {
OR = {
prestige = -150
AND = {
transfer_scaled_wealth = {
to = FROM
FROM = { religion_group = muslim }
year = 1225
value = 4.0
}
}
AND = {
ROOT = {
prestige = -150
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1230
imprison = FROM
}
}
AND = {
any_defender = {
FROM = { religion_group = christian }
limit = { character = FROM }
participation_scaled_prestige = 150
year = 1240
}
}
AND = {
any_defender = {
FROM = { religion_group = pagan_group }
limit = { NOT = { character = FROM } }
hidden_tooltip = { participation_scaled_prestige = 150 }
year = 1300
}
}
}
}
}
}
ca_keep_5 = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 3 }
upgrades_from = ca_keep_4
build_cost = 500
build_time = 2190 #6y
levy_size = 0.25
garrison_size = 0.2
ai_creation_factor = 98


on_reverse_demand_title = {
start = {
OR = {
ROOT = {
AND = {
remove_claim = PREV
}
FROM = { religion_group = muslim }
year = 1340
}
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1345
}
AND = {
FROM = { religion_group = christian }
year = 1350
}
AND = {
FROM = { religion_group = pagan_group }
year = 1420
}
}
}
}
}

ca_keep_6 = {
attacker_ai_victory_worth = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 5 }
factor = -1 # always accept
upgrades_from = ca_keep_5
build_cost = 500
build_time = 2190 #6y
levy_size = 0.3
garrison_size = 0.2
ai_creation_factor = 97
start = {
OR = {
AND = {
FROM = { religion_group = muslim }
year = 1360
}
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1380
}
AND = {
FROM = { religion_group = christian }
year = 1355
}
AND = {
FROM = { religion_group = pagan_group }
year = 1500
}
}
}
}
}
attacker_ai_defeat_worth = {
# Militia barracks, gives light infantry and archers.
factor = 100
ca_militia_barracks_1 = {
}
build_cost = 100

build_time = 365
defender_ai_victory_worth = {
light_infantry = 80
factor = -1 # always accept
archers = 10
}
ai_creation_factor = 100
defender_ai_defeat_worth = {
start = {
OR = {
factor = 100
}
AND = {
}
FROM = { religion_group = muslim }

year = 1076

}
AND = {
claim_on_liege = {
name = CB_NAME_CLAIM
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
war_name = WAR_NAME_CLAIM_LIEGE
year = 1066
sprite = 3
}
truce_days = 3650
AND = {
hostile_against_others = yes
FROM = { religion_group = christian }
major_revolt = yes
year = 1100

}
press_claim = yes
AND = {
can_call_vassals = yes
FROM = { religion_group = pagan_group }
year = 1066
can_use = {
}
AND = {
FROM = {
FROM = {
in_revolt = no
top_liege = {
liege = {
primary_title = {
in_revolt = no
OR = {
liege = {
title = k_castille
in_revolt = no
title = k_aragon
title = k_spanish_galicia
title = k_navarra
title = d_barcelona
}
}
}
}
year = 1066
}
}
}
}
}
}
}
}
ca_militia_barracks_2 = {
prerequisites = { ca_wall_1 }
upgrades_from = ca_militia_barracks_1
build_cost = 120
build_time = 547
light_infantry = 20
archers = 90
ai_creation_factor = 99


start = {
can_use_title = {
OR = {
OR = {
AND = {
FROM = {
has_landed_title = PREV
FROM = { religion_group = muslim }
}
year = 1095
holder_scope = {
}
AND = {
is_liege_or_above = FROM
}
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
}
year = 1130
}
OR = {
ROOT = { has_strong_claim = PREV }
AND = {
ROOT = { has_character_flag = faction_claimant_ultimatum_taken } # Faction war. Ignore claim strength.
FROM = { religion_group = christian }
year = 1150
AND = {
ROOT = { has_weak_claim = PREV }
}
AND = {
OR = {
is_pretender = yes # Checks vs ROOT character
FROM = { religion_group = pagan_group }
holder_scope = { has_regent = yes }
year = 1180
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
}
}
}
}
}
}
}
}
ca_militia_barracks_3 = {
trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
upgrades_from = ca_militia_barracks_2
build_cost = 300
build_time = 1095
light_infantry = 30
archers = 120
ai_creation_factor = 98


start = {
is_valid_title = {
OR = {
OR = {
AND = {
FROM = {
has_landed_title = PREV
FROM = { religion_group = muslim }
}
year = 1145
holder_scope = {
}
AND = {
is_liege_or_above = FROM
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1200
}
AND = {
FROM = { religion_group = christian }
year = 1190
}
AND = {
FROM = { religion_group = pagan_group }
year = 1240
}
}
}
}
OR = {
has_law = succ_feudal_elective
ROOT = { has_claim = PREV }
}
}
}
}


on_success = {
#Training grounds, gives morale and reinforce rate
any_attacker = {
ca_training_grounds_1 = {
prerequisites = { ca_wall_2 }
limit = { character = ROOT }
participation_scaled_prestige = 100
build_cost = 200
build_time = 730
hidden_tooltip = {
disband_event_forces = faction_revolters
land_morale = 0.1
levy_reinforce_rate = 0.1
ai_creation_factor = 89

start = {
OR = {
AND = {
FROM = { religion_group = muslim }
year = 1095
}
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1080
}
AND = {
FROM = { religion_group = christian }
year = 1100
}
AND = {
FROM = { religion_group = pagan_group }
year = 1066
}
}
}
}
}
any_attacker = {
}
limit = { NOT = { character = ROOT } }
ca_training_grounds_2 = {
trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
hidden_tooltip = { participation_scaled_prestige = 100 }
hidden_tooltip = {
upgrades_from = ca_training_grounds_1
disband_event_forces = faction_revolters
build_cost = 300
build_time = 1095
land_morale = 0.2
levy_reinforce_rate = 0.2
ai_creation_factor = 88
start = {
OR = {
AND = {
FROM = { religion_group = muslim }
year = 1110
}
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1125
}
AND = {
FROM = { religion_group = christian }
year = 1130
}
AND = {
FROM = { religion_group = pagan_group }
year = 1190
}
}
}
}
}
}
# Barracks, gives heavy infantry and pikemen
ca_barracks_1 = {
build_cost = 100
build_time = 365
heavy_infantry = 30
pikemen = 15
ai_creation_factor = 105
start = {
FROM = {
hidden_tooltip = { disband_event_forces = faction_loyalists }
OR = {
any_demesne_title = { # All titles
AND = {
FROM = { religion_group = muslim }
limit = {
year = 1100
OR = {
tier = king
tier = emperor
}
# is_titular = no
NOT = { has_law = centralization_0 }
}
}
AND = {
if = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
limit = { has_law = centralization_1 }
year = 1085
add_law = centralization_0
}
}
AND = {
if = {
FROM = { religion_group = christian }
limit = { has_law = centralization_2 }
year = 1075
add_law = centralization_1
}
}
AND = {
if = {
FROM = { religion_group = pagan_group }
limit = { has_law = centralization_3 }
year = 1100
add_law = centralization_2
}
}
AND = {
if = {
FROM = {
limit = { has_law = centralization_4 }
top_liege = {
add_law = centralization_3
primary_title = {
OR = {
title = k_castille
title = k_aragon
title = k_spanish_galicia
title = k_navarra
title = d_barcelona
}
}
}
}
year = 1066
}
}
}
}
}
}
if = {
}
ca_barracks_2 = {
limit = {
ROOT = {
prerequisites = { ca_wall_1 }
prisoner = yes
upgrades_from = ca_barracks_1
host = { character = FROM }
build_cost = 120
build_time = 547
heavy_infantry = 40
pikemen = 15
ai_creation_factor = 104
start = {
OR = {
AND = {
FROM = { religion_group = muslim }
year = 1175
}
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1105
}
AND = {
FROM = { religion_group = christian }
year = 1130
}
AND = {
FROM = { religion_group = pagan_group }
year = 1150
}
}
}
}
ROOT = { prisoner = no }
}
}
}
}
ca_barracks_3 = {
on_success_title = {
prerequisites = { ca_wall_2 }
if = {
upgrades_from = ca_barracks_2
build_cost = 200
limit = {
is_primary_holder_title = yes
build_time = 730
heavy_infantry = 45
pikemen = 20
ai_creation_factor = 103

start = {
OR = {
AND = {
FROM = { religion_group = muslim }
year = 1200
}
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1140
}
AND = {
FROM = { religion_group = christian }
year = 1175
}
AND = {
FROM = { religion_group = pagan_group }
year = 1250
}
}
}
FROM = { imprison = ROOT }
}
}
}
usurp_title_plus_barony_if_unlanded_and_vassals = ROOT
ca_barracks_4 = {
trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
if = {
upgrades_from = ca_barracks_3
build_cost = 300
limit = {
higher_tier_than = BARON
build_time = 1095
NOT = { culture = ROOT }
heavy_infantry = 50
pikemen = 25
ai_creation_factor = 102

start = {
OR = {
AND = {
FROM = { religion_group = muslim }
year = 1260
}
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1235
}
AND = {
FROM = { religion_group = christian }
year = 1230
}
AND = {
FROM = { religion_group = pagan_group }
year = 1300
}
}
}
hidden_tooltip = { conquest_culture = ROOT }
}
}
}
}
ca_barracks_5 = {
trigger = { TECH_CASTLE_CONSTRUCTION = 3 }
upgrades_from = ca_barracks_4
build_cost = 400
build_time = 2190
heavy_infantry = 60
pikemen = 25
ai_creation_factor = 101


start = {
on_fail = {
OR = {
ROOT = {
AND = {
prestige = -100
}
FROM = { religion_group = muslim }
year = 1350
any_defender = {
limit = { character = FROM }
}
participation_scaled_prestige = 50
AND = {
}
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1335
any_defender = {
limit = { NOT = { character = FROM } }
}
hidden_tooltip = { participation_scaled_prestige = 50 }
AND = {
}
FROM = { religion_group = christian }
year = 1330
hidden_tooltip = {
}
AND = {
any_attacker = {
FROM = { religion_group = pagan_group }
limit = { liege = { character = FROM } }
disband_event_forces = faction_revolters
year = 1400
}
}
}
}
}
FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } }
}
}
ca_barracks_6 = {
trigger = { TECH_CASTLE_CONSTRUCTION = 5 }
upgrades_from = ca_barracks_5
build_cost = 500
build_time = 2190
heavy_infantry = 65
pikemen = 30
ai_creation_factor = 100


on_reverse_demand = {
start = {
OR = {
ROOT = {
AND = {
prestige = -150
}
FROM = { religion_group = muslim }
year = 1400
any_defender = {
}
AND = {
limit = { character = FROM }
participation_scaled_prestige = 100
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
}
year = 1385
any_defender = {
}
limit = { NOT = { character = FROM } }
AND = {
hidden_tooltip = { participation_scaled_prestige = 100 }
FROM = { religion_group = christian }
}
year = 1370
}
AND = {
hidden_tooltip = {
any_attacker = {
FROM = { religion_group = pagan_group }
limit = { liege = { character = FROM } }
year = 1500
disband_event_forces = faction_revolters
}
prisoner = FROM
}
}
}
}
FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } }
}
}
on_attacker_leader_death = {
#Stable, gives light cavalry and some heavy cavalry
hidden_tooltip = {
ca_stable_1 = {
build_cost = 100
any_defender = {
build_time = 365
letter_event = {
light_cavalry = 45
id = 251
ai_creation_factor = 89
start = {
OR = {
AND = {
FROM = { religion_group = muslim }
year = 1076
}
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1080
}
AND = {
FROM = { religion_group = christian }
year = 1115
}
AND = {
FROM = { religion_group = pagan_group }
year = 1150
}
AND = {
FROM = {
top_liege = {
primary_title = {
OR = {
title = k_leon
title = k_castille
title = k_aragon
title = k_spanish_galicia
title = k_navarra
title = d_barcelona
}
}
}
}
year = 1066
}
}
}
}
}
}
end_war = invalid
}
}
ca_stable_2 = {
attacker_ai_victory_worth = {
prerequisites = { ca_wall_1 }
factor = -1 # always accept
upgrades_from = ca_stable_1
}
build_cost = 120
build_time = 547
attacker_ai_defeat_worth = {
light_cavalry = 55
factor = 100
ai_creation_factor = 88
}

defender_ai_victory_worth = {
factor = -1 # always accept
}
defender_ai_defeat_worth = {
factor = 100
}
}


claim_on_liege_plot = {
name = CB_NAME_CLAIM
war_name = WAR_NAME_CLAIM_LIEGE
sprite = 3
truce_days = 3650
hostile_against_others = yes


press_claim = yes
start = {
can_call_allies = no
OR = {
can_ask_to_join_war = no
AND = {

FROM = { religion_group = muslim }
can_use_title = {
year = 1090
}
OR = {
AND = {
FROM = {
has_landed_title = PREV
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
}
year = 1095
holder_scope = {
}
AND = {
is_liege_or_above = FROM
FROM = { religion_group = christian }
year = 1120
}
AND = {
FROM = { religion_group = pagan_group }
year = 1200
}
AND = {
FROM = {
top_liege = {
primary_title = {
title = k_seljuk_turks
}
}
}
year = 1066
}
}
}
}
}
}
}
ca_stable_3 = {
prerequisites = { ca_wall_2 }
upgrades_from = ca_stable_2
build_cost = 200
build_time = 730
light_cavalry = 55
knights = 5
ai_creation_factor = 87


start = {
is_valid_title = {
OR = {
OR = {
AND = {
FROM = {
has_landed_title = PREV
FROM = { religion_group = muslim }
}
year = 1165
holder_scope = {
}
AND = {
is_liege_or_above = FROM
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1145
}
AND = {
FROM = { religion_group = christian }
year = 1170
}
AND = {
FROM = { religion_group = pagan_group }
year = 1250
}
}
}
}
}
}
}
ca_stable_4 = {
trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
upgrades_from = ca_stable_3
build_cost = 300
build_time = 1095
light_cavalry = 55
knights = 10
ai_creation_factor = 86


start = {
on_success = {
OR = {
any_attacker = {
AND = {
limit = { character = ROOT }
participation_scaled_prestige = 100
FROM = { religion_group = muslim }
year = 1250
hidden_tooltip = {
disband_event_forces = faction_revolters
}
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1240
}
AND = {
FROM = { religion_group = christian }
year = 1230
}
AND = {
FROM = { religion_group = pagan_group }
year = 1350
}
}
}
}
}
any_attacker = {
}
limit = { NOT = { character = ROOT } }
ca_stable_5 = {
trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
hidden_tooltip = { participation_scaled_prestige = 100 }
hidden_tooltip = {
upgrades_from = ca_stable_4
disband_event_forces = faction_revolters
build_cost = 400
}
build_time = 2190
}
light_cavalry = 55
knights = 20
FROM = {
ai_creation_factor = 85

hidden_tooltip = { disband_event_forces = faction_loyalists }
start = {
OR = {
any_demesne_title = { # All titles
AND = {
FROM = { religion_group = muslim }
limit = {
year = 1340
OR = {
tier = king
tier = emperor
}
# is_titular = no
NOT = { has_law = centralization_0 }
}
}
AND = {
if = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
limit = { has_law = centralization_1 }
year = 1350
add_law = centralization_0
}
}
AND = {
if = {
FROM = { religion_group = christian }
limit = { has_law = centralization_2 }
year = 1335
add_law = centralization_1
}
}
AND = {
if = {
FROM = { religion_group = pagan_group }
limit = { has_law = centralization_3 }
year = 1450
add_law = centralization_2
}
if = {
limit = { has_law = centralization_4 }
add_law = centralization_3
}
}
}
}
Line 1,078: Line 745:
}
}
on_success_title = {
#Castle town, gives income
usurp_title_plus_barony_if_unlanded = ROOT
ca_town_1 = {
build_cost = 100
build_time = 365
tax_income = 1.5
ai_creation_factor = 100
start = {
if = {
OR = {
limit = {
AND = {
higher_tier_than = BARON
FROM = { religion_group = muslim }
NOT = { culture = ROOT }
year = 1080
}
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1090
}
AND = {
FROM = { religion_group = christian }
year = 1100
}
AND = {
FROM = { religion_group = pagan_group }
year = 1105
}
}
}
hidden_tooltip = { conquest_culture = ROOT }
}
ROOT = {
plot_succeeds = yes
}
}
}
}
ca_town_2 = {
prerequisites = { ca_wall_1 }
upgrades_from = ca_town_1
build_cost = 120
build_time = 547
tax_income = 2
ai_creation_factor = 99


start = {
on_fail = {
OR = {
ROOT = {
AND = {
prestige = -100
}
FROM = { religion_group = muslim }
year = 1110
any_defender = {
limit = { character = FROM }
}
participation_scaled_prestige = 50
AND = {
hidden_tooltip = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
disband_event_forces = faction_revolters
year = 1095
}
AND = {
FROM = { religion_group = christian }
year = 1115
}
AND = {
FROM = { religion_group = pagan_group }
year = 1140
}
}
}
}
}
any_defender = {
}
limit = { NOT = { character = FROM } }
ca_town_3 = {
hidden_tooltip = { participation_scaled_prestige = 50 }
prerequisites = { ca_wall_2 }
hidden_tooltip = {
upgrades_from = ca_town_2
disband_event_forces = faction_revolters
build_cost = 200
build_time = 730
tax_income = 2.5
ai_creation_factor = 98

start = {
OR = {
AND = {
FROM = { religion_group = muslim }
year = 1150
}
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1170
}
AND = {
FROM = { religion_group = christian }
year = 1185
}
AND = {
FROM = { religion_group = pagan_group }
year = 1210
}
}
}
}
}
FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } }
}
}
ca_town_4 = {
trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
upgrades_from = ca_town_3
build_cost = 300
build_time = 1095
tax_income = 3
ai_creation_factor = 97


on_reverse_demand = {
start = {
OR = {
ROOT = {
AND = {
prestige = -200
imprison = FROM
FROM = { religion_group = muslim }
}
year = 1200
any_defender = {
}
AND = {
limit = { character = FROM }
participation_scaled_prestige = 100
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1205
hidden_tooltip = {
disband_event_forces = faction_revolters
}
AND = {
FROM = { religion_group = christian }
year = 1230
}
AND = {
FROM = { religion_group = pagan_group }
year = 1390
}
}
}
}
}
any_defender = {
}
limit = { NOT = { character = FROM } }
ca_town_5 = {
trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
hidden_tooltip = { participation_scaled_prestige = 100 }
hidden_tooltip = {
upgrades_from = ca_town_4
disband_event_forces = faction_revolters
build_cost = 400
build_time = 2190
tax_income = 3.5
ai_creation_factor = 96

start = {
OR = {
AND = {
FROM = { religion_group = muslim }
year = 1410
}
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1443
}
AND = {
FROM = { religion_group = christian }
year = 1400
}
AND = {
FROM = { religion_group = pagan_group }
year = 1490
}
}
}
}
}
FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } }
}
}
on_attacker_leader_death = {
#Warrior Cult, special pagan building that gives more infantry to pagans
hidden_tooltip = {
ca_warrior_cult = {
auto_add_at_year = 10
any_defender = {
potential = {
letter_event = {
FROM = {
id = 251
religion_group = pagan_group
NOT = {
any_liege = {
NOT = { religion_group = pagan_group }
}
}
}
}
}
religion_group = pagan_group
}
}
build_cost = 10
end_war = invalid
build_time = 60
light_infantry = 140
heavy_infantry = 40
archers = 50
ai_creation_factor = 300 #AI should always build this if it can
}
}
attacker_ai_victory_worth = {
factor = -1 # always accept
}
attacker_ai_defeat_worth = {
# All cultural buildings follow the same pattern:
factor = 100
# tech required is 0, 1, 2, 4 for the levels of the buildings
}
# cost is 200 + 100 per level

# 60 maintenance of troops + 20 per level
defender_ai_victory_worth = {
# + 0.15 bonus in either offensive, defensive or morale sometimes split over different units or stats same on all levels
factor = -1 # always accept
}
defender_ai_defeat_worth = {
factor = 100
}
}

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


press_claim = yes
#Welsh and English Longbow archery range
can_call_allies = no
ca_culture_saxon_english_1 = {
can_attack_vassals = yes
potential = {

can_use_title = {
OR = {
FROM = {
FROM = {
OR = {
has_landed_title = PREV
culture = english
culture = welsh
}
}
}
holder_scope = {
}
de_facto_liege = ROOT
prerequisites = { ca_wall_2 }
build_cost = 200
build_time = 730
archers_offensive = 0.15
archers = 60
ai_creation_factor = 101
start = {
AND = {
FROM = { religion_group = christian }
year = 1120
has_building = ca_militia_barracks_1
}
}
}
}
}
}

ca_culture_saxon_english_2 = {
potential = {
is_valid_title = {
FROM = {
FROM = {
OR = {
has_landed_title = PREV
culture = english
culture = welsh
}
}
}
}
ROOT = {
trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
has_plot = plot_gain_vassal_title
upgrades_from = ca_culture_saxon_english_1
build_cost = 300
build_time = 1095
archers_offensive = 0.15
archers = 80
ai_creation_factor = 100
start = {
AND = {
FROM = { religion_group = christian }
year = 1160
has_building = ca_militia_barracks_1
}
}
}
}
}

ca_culture_saxon_english_3 = {
potential = {
on_success = {
FROM = {
ROOT = {
OR = {
prestige = 50
culture = english
culture = welsh
}
}
}
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
upgrades_from = ca_culture_saxon_english_2
on_success_title = {
build_cost = 400
usurp_title_plus_barony_if_unlanded = ROOT
build_time = 2190
ROOT = { plot_succeeds = yes }
archers_offensive = 0.15
}
archers = 100

ai_creation_factor = 99
on_fail = {
start = {
ROOT = {
AND = {
prestige = -100
}
FROM = { religion_group = christian }
year = 1200
any_defender = {
limit = { character = FROM }
has_building = ca_militia_barracks_1
participation_scaled_prestige = 50
}
}
any_defender = {
limit = { NOT = { character = FROM } }
hidden_tooltip = { participation_scaled_prestige = 50 }
}
}
}
}

ca_culture_saxon_english_4 = {
on_reverse_demand = {
potential = {
FROM = {
ROOT = {
OR = {
prestige = -200
}
culture = english
culture = welsh
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
}
}
}
}
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
upgrades_from = ca_culture_saxon_english_3
build_cost = 500
build_time = 2190
archers_offensive = 0.15
archers = 120
ai_creation_factor = 98
start = {
end_war = invalid
}
AND = {
FROM = { religion_group = christian }
attacker_ai_victory_worth = {
year = 1260
factor = -1 # always accept
has_building = ca_militia_barracks_1
}
}
}
attacker_ai_defeat_worth = {
factor = 100
}
}


defender_ai_victory_worth = {
#Scottish Schiltron
factor = -1 # always accept
ca_culture_scottish_1 = {
}
potential = {
FROM = {
defender_ai_defeat_worth = {
OR = {
culture = scottish
factor = 100
}
}

other_claim_on_liege = {
name = CB_NAME_CLAIM
war_name = WAR_NAME_OTHER_CLAIM
sprite = 4
truce_days = 3650
hostile_against_others = yes
major_revolt = yes

press_claim = yes
can_call_vassals = yes
can_use = {
FROM = {
in_revolt = no
liege = {
in_revolt = no
liege = {
in_revolt = no
}
}
}
}
}
}
}
prerequisites = { ca_wall_2 }

build_cost = 200
can_use_title = {
build_time = 730
pikemen = 30
OR = {
ROOT = { is_female = no }
pikemen_defensive = 0.15
NOT = { has_law = agnatic_succession }
ai_creation_factor = 101
start = {
AND = {
AND = {
lower_tier_than = KING
FROM = { religion_group = christian }
year = 1085
is_primary_holder_title = no
has_building = ca_barracks_1
}
}
FROMFROM = { has_character_flag = faction_claimant_ultimatum_taken } # Faction war. Ignore claim strength.
}
}

}
OR = {
ca_culture_scottish_2 = {
potential = {
FROM = {
FROM = {
OR = {
has_landed_title = PREV
culture = scottish
}
}
}
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
upgrades_from = ca_culture_scottish_1
build_cost = 300
build_time = 1095
pikemen = 40
pikemen_defensive = 0.15
ai_creation_factor = 100
start = {
OR = {
ROOT = { has_strong_claim = PREV }
FROMFROM = { has_character_flag = faction_claimant_ultimatum_taken } # Faction war. Ignore claim strength.
AND = {
AND = {
FROM = { religion_group = christian }
ROOT = { has_weak_claim = PREV }
year = 1165
has_building = ca_barracks_1
}
}
}
ca_culture_scottish_3 = {
potential = {
FROM = {
OR = {
OR = {
is_pretender = yes # Checks vs ROOT character
culture = scottish
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
}
}
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
upgrades_from = ca_culture_scottish_2
build_cost = 400
build_time = 2190
pikemen = 60
pikemen_defensive = 0.15
ai_creation_factor = 99
start = {
AND = {
FROM = { religion_group = christian }
year = 1210
has_building = ca_barracks_1
}
}
}
}
}
}
ca_culture_scottish_4 = {
potential = {
is_valid_title = {
OR = {
FROM = {
FROM = {
OR = {
has_landed_title = PREV
}
culture = scottish
holder_scope = {
}
is_liege_or_above = FROM
}
}
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
upgrades_from = ca_culture_scottish_3
build_cost = 500
build_time = 2190
pikemen = 80
pikemen_defensive = 0.15
ai_creation_factor = 98
start = {
OR = {
has_law = succ_feudal_elective
AND = {
FROM = { religion_group = christian }
ROOT = { has_claim = PREV }
year = 1260
has_building = ca_barracks_1
}
}
}
}
NOT = {
#Baltic tribes Heavy Infantry camps
any_war = { # when used in title scope, checks all wars for that title
ca_culture_group_baltic_1 = {
potential = {
attacker = {
FROM = {
character = ROOT
OR = {
culture_group = baltic
culture_group = finno_ugric
}
}
}
}
}
}
}
prerequisites = { ca_wall_2 }
build_cost = 200
build_time = 730
heavy_infantry = 30
heavy_infantry_defensive = 0.15
ai_creation_factor = 101


start = {
on_success = {
AND = {
any_attacker = {
limit = {
FROM = { religion_group = pagan_group }
year = 1066
}
}
}
ca_culture_group_baltic_2 = {
potential = {
FROM = {
OR = {
OR = {
culture_group = baltic
character = ROOT
culture_group = finno_ugric
character = PREV
}
}
}
}
participation_scaled_prestige = 100
hidden_tooltip = { disband_event_forces = faction_revolters }
}
}
any_attacker = {
trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
limit = {
upgrades_from = ca_culture_group_baltic_1
NOT = { character = ROOT }
build_cost = 300
NOT = { character = PREV }
build_time = 1095
heavy_infantry = 40
heavy_infantry_defensive = 0.15
ai_creation_factor = 100
start = {
AND = {
FROM = { religion_group = pagan_group }
year = 1120
}
}
hidden_tooltip = {
}
participation_scaled_prestige = 100
}
disband_event_forces = faction_revolters
ca_culture_group_baltic_3 = {
potential = {
FROM = {
OR = {
culture_group = baltic
culture_group = finno_ugric
}
}
}
}
}
ROOT = {
trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
opinion = {
upgrades_from = ca_culture_group_baltic_2
modifier = pressed_my_claim
build_cost = 400
build_time = 2190
who = PREV
heavy_infantry = 50
heavy_infantry_defensive = 0.15
ai_creation_factor = 99
start = {
AND = {
FROM = { religion_group = pagan_group }
year = 1183
}
}
}
}

}
FROM = {
ca_culture_group_baltic_4 = {
hidden_tooltip = { disband_event_forces = faction_loyalists }
potential = {
FROM = {
any_demesne_title = { # All titles
OR = {
culture_group = baltic
limit = {
culture_group = finno_ugric
OR = {
tier = king
tier = emperor
}
# is_titular = no
NOT = { has_law = centralization_0 }
}
if = {
limit = { has_law = centralization_1 }
add_law = centralization_0
}
if = {
limit = { has_law = centralization_2 }
add_law = centralization_1
}
if = {
limit = { has_law = centralization_3 }
add_law = centralization_2
}
if = {
limit = { has_law = centralization_4 }
add_law = centralization_3
}
}
}
}
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
upgrades_from = ca_culture_group_baltic_3
build_cost = 500
build_time = 2190
heavy_infantry = 60
heavy_infantry_defensive = 0.15
ai_creation_factor = 98
start = {
if = {
AND = {
limit = {
ROOT = {
FROM = { religion_group = pagan_group }
year = 1219
prisoner = yes
host = { character = FROM }
}
}
}
ROOT = { prisoner = no }
}
}
}
}
on_success_title = {
#Altaic horse breeders (and Persian)
if = {
ca_culture_group_altaic_1 = {
potential = {
limit = {
is_primary_holder_title = yes
FROM = {
OR = {
}
culture_group = altaic
hidden_tooltip = {
FROM = { set_character_flag = temp_other_claim_on_liege_prison }
culture_group = iranian
}
}
# 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 }
}
}
prerequisites = { ca_wall_2 }
build_cost = 200
build_time = 730
light_cavalry = 10
knights = 5
horse_archers = 10
horse_archers_offensive = 0.1
horse_archers_morale = 0.05
ai_creation_factor = 101
usurp_title_plus_barony_if_unlanded_and_vassals = ROOT
start = {
AND = {
if = {
year = 1066
limit = {
has_building = ca_wall_1
higher_tier_than = BARON
NOT = { culture = ROOT }
}
}
hidden_tooltip = { conquest_culture = ROOT }
}
}
}
}

ca_culture_group_altaic_2 = {
on_success_posttitle = {
potential = {
FROM = {
hidden_tooltip = {
OR = {
if = {
culture_group = altaic
limit = {
culture_group = iranian
top_liege = {
ROOT = {
NOT = {
top_liege = {
character = PREVPREV
}
}
}
}
}

ROOT = {
set_defacto_liege = PREV
}
}
}
}

}
if = {
trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
limit = {
upgrades_from = ca_culture_group_altaic_1
build_cost = 300
build_time = 1095
light_cavalry = 15
knights = 5
horse_archers = 15
horse_archers_offensive = 0.1
horse_archers_morale = 0.05
ai_creation_factor = 100
start = {
AND = {
year = 1150
has_building = ca_wall_1
}
AND = {
FROM = {
top_liege = {
top_liege = {
primary_title = {
ROOT = {
title = k_seljuk_turks
NOT = {
top_liege = {
character = PREVPREV
}
}
}
}
}
}
}
}

year = 1066
ROOT = {
set_defacto_liege = ROOT
}
}
if = {
limit = {
FROM = { has_character_flag = temp_other_claim_on_liege_prison }
}
FROM = {
imprison = ROOT
clr_character_flag = temp_other_claim_on_liege_prison
}
}
}
}
}
}
}

ca_culture_group_altaic_3 = {
potential = {
on_fail = {
FROM = {
prestige = -100
imprison = FROM
if = {
limit = {
OR = {
OR = {
culture_group = altaic
is_liege_of = ROOT
ROOT = { is_liege_or_above = FROM }
culture_group = iranian
}
}
}
ROOT = {
imprison = FROM
}
}
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
upgrades_from = ca_culture_group_altaic_2
build_cost = 400
build_time = 2190
light_cavalry = 15
knights = 10
horse_archers = 15
horse_archers_offensive = 0.1
horse_archers_morale = 0.05
ai_creation_factor = 99
start = {
any_defender = {
AND = {
limit = { character = FROM }
participation_scaled_prestige = 50
year = 1230
has_building = ca_wall_1
}
}
}
any_defender = {
}
limit = { NOT = { character = FROM } }
ca_culture_group_altaic_4 = {
hidden_tooltip = { participation_scaled_prestige = 50 }
potential = {
FROM = {
OR = {
culture_group = altaic
culture_group = iranian
}
}
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
upgrades_from = ca_culture_group_altaic_3
build_cost = 500
build_time = 2190
light_cavalry = 20
knights = 10
horse_archers = 20
horse_archers_offensive = 0.1
horse_archers_morale = 0.05
ai_creation_factor = 98
start = {
hidden_tooltip = {
AND = {
any_attacker = {
disband_event_forces = faction_revolters
year = 1290
has_building = ca_wall_1
}
}
}
}
FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } }
}
}

on_reverse_demand = {
#Frankish, Occitan, Norman and German Lists (and Breton)
prestige = -200
ca_culture_frank_norman_german_1 = {
potential = {
FROM = {
imprison = FROM
if = {
limit = {
OR = {
OR = {
culture = frankish
is_liege_of = ROOT
ROOT = { is_liege_or_above = FROM }
culture = occitan
culture = norman
culture = german
culture = breton
}
}
}
ROOT = {
imprison = FROM
}
}
}
}
prerequisites = { ca_wall_2 }
build_cost = 200
build_time = 730
knights = 15
knights_offensive = 0.15
ai_creation_factor = 101
start = {
any_defender = {
AND = {
limit = { character = FROM }
participation_scaled_prestige = 100
FROM = { religion_group = christian }
}
year = 1125
any_defender = {
has_building = ca_stable_1
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 } }
}
}
ca_culture_frank_norman_german_2 = {
attacker_ai_victory_worth = {
potential = {
factor = -1 # always accept
FROM = {
}
OR = {
culture = frankish
attacker_ai_defeat_worth = {
culture = occitan
culture = norman
factor = 100
}
culture = german

culture = breton
defender_ai_victory_worth = {
}
factor = -1 # always accept
}
defender_ai_defeat_worth = {
factor = 100
}
}


claim_all = {
name = CB_NAME_CLAIM_ALL
war_name = WAR_NAME_CLAIM_ALL
sprite = 5
truce_days = 3650
is_permanent = yes
can_ask_to_join_war = no
is_claim_all = yes

can_use = {
ROOT = {
total_claims = {
who = FROM
strong = yes # Count only strong claims
value = 2
}
}
}
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 1 }

upgrades_from = ca_culture_frank_norman_german_1
is_valid = {
build_cost = 300
build_time = 1095
ROOT = {
knights = 20
total_claims = {
who = FROM
knights_offensive = 0.15
strong = yes # Count only strong claims
ai_creation_factor = 100
value = 1 # must have at least one claim left
start = {
AND = {
FROM = { religion_group = christian }
year = 1140
has_building = ca_stable_1
}
}
}
}
}
}

ca_culture_frank_norman_german_3 = {
potential = {
on_add = {
FROM = {
ROOT = {
OR = {
any_claim = {
culture = frankish
limit = {
culture = occitan
holder_scope = {
culture = norman
OR = {
culture = german
character = FROM
culture = breton
is_liege_or_above = FROM
}
}
ROOT = { has_strong_claim = PREV }
}
}
press_claim = ROOT
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
upgrades_from = ca_culture_frank_norman_german_2
build_cost = 400
build_time = 2190
knights = 25
knights_offensive = 0.15
ai_creation_factor = 99
start = {
AND = {
FROM = { religion_group = christian }
year = 1180
has_building = ca_stable_1
}
}
}
}
}
}

ca_culture_frank_norman_german_4 = {
potential = {
on_success = {
FROM = {
ROOT = {
OR = {
any_claim = {
culture = frankish
limit = {
culture = occitan
holder_scope = {
culture = norman
OR = {
culture = german
character = FROM
culture = breton
is_liege_or_above = FROM
}
}
ROOT = { has_strong_claim = PREV }
}
usurp_title_plus_barony_if_unlanded = ROOT
if = {
limit = {
higher_tier_than = BARON
NOT = { culture = ROOT }
}
hidden_tooltip = { conquest_culture = ROOT }
}
}
}
}
}
}
hidden_tooltip = {
trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
ROOT = {
upgrades_from = ca_culture_frank_norman_german_3
build_cost = 500
if = {
build_time = 2190
limit = {
has_dlc = "Legacy of Rome"
knights = 30
OR = {
knights_offensive = 0.15
has_landed_title = e_byzantium
ai_creation_factor = 98
has_landed_title = e_roman_empire
}
start = {
religion_group = christian
AND = {
}
FROM = { religion_group = christian }
character_event = { id = LoR.30 days = 12 }
year = 1250
}
has_building = ca_stable_1
}
}
}
}
any_attacker = {
}
limit = { character = ROOT }
participation_scaled_prestige = 100
#Iberian Fast horse breeders
ca_culture_group_iberian_1 = {
potential = {
FROM = { culture_group = iberian }
}
}
any_attacker = {
prerequisites = { ca_wall_2 }
limit = { NOT = { character = ROOT } }
build_cost = 200
hidden_tooltip = { participation_scaled_prestige = 100 }
build_time = 730
light_cavalry = 30
light_cavalry_offensive = 0.15
ai_creation_factor = 101
start = {
AND = {
FROM = { religion_group = christian }
year = 1125
has_building = ca_stable_1
}
}
}
}
}

ca_culture_group_iberian_2 = {
potential = {
on_fail = {
ROOT = {
FROM = { culture_group = iberian }
prestige = -150
}
}
any_defender = {
trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
limit = { character = FROM }
upgrades_from = ca_culture_group_iberian_1
participation_scaled_prestige = 75
build_cost = 300
}
build_time = 1095
light_cavalry = 40
any_defender = {
limit = { NOT = { character = FROM } }
light_cavalry_offensive = 0.15
hidden_tooltip = { participation_scaled_prestige = 75 }
ai_creation_factor = 100
start = {
AND = {
FROM = { religion_group = christian }
year = 1140
has_building = ca_stable_1
}
}
}
}
}

ca_culture_group_iberian_3 = {
on_reverse_demand = {
potential = {
ROOT = {
FROM = { culture_group = iberian }
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 }
}
ROOT = {
remove_claim = PREV
}
}
}
}
any_defender = {
trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
limit = { character = FROM }
upgrades_from = ca_culture_group_iberian_2
participation_scaled_prestige = 200
build_cost = 400
}
build_time = 2190
light_cavalry = 50
FROM = {
if = {
light_cavalry_offensive = 0.15
limit = {
ai_creation_factor = 99
has_dlc = "Legacy of Rome"
start = {
OR = {
has_landed_title = e_byzantium
AND = {
has_landed_title = e_roman_empire
FROM = { religion_group = christian }
year = 1180
}
has_building = ca_stable_1
religion_group = christian
}
hidden_tooltip = { character_event = { id = LoR.30 days = 12 } }
}
}
}
any_defender = {
limit = { NOT = { character = FROM } }
hidden_tooltip = { participation_scaled_prestige = 200 }
}
}
}
}

ca_culture_group_iberian_4 = {
attacker_ai_victory_worth = {
potential = {
factor = -1 # always accept
FROM = { culture_group = iberian }
}
attacker_ai_defeat_worth = {
factor = 100
}

defender_ai_victory_worth = {
factor = -1 # always accept
}
defender_ai_defeat_worth = {
factor = 100
}
}


change_seniority_succession_law = {
name = CB_NAME_SENIORITY_SUCCESSION_LAW
war_name = WAR_NAME_SENIORITY_SUCCESSION_LAW
sprite = 6
truce_days = 3650
can_call_allies = no
can_ask_to_join_war = no
major_revolt = yes
attacker_alliance_occ_warscore = yes # Occupying any holding of any attacker counts towards war score
can_use = {
ROOT = {
vassal_of = FROM
}
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 4 }

upgrades_from = ca_culture_group_iberian_3
is_valid_title = {
build_cost = 500
build_time = 2190
NOT = {
has_law = succ_seniority
light_cavalry = 60
}
light_cavalry_offensive = 0.15
OR = {
ai_creation_factor = 98
tier = emperor
start = {
tier = king
is_primary_holder_title = yes
AND = {
FROM = { religion_group = christian }
year = 1250
has_building = ca_stable_1
}
}
}
}
}
on_success = {
#Italian Pike formations
FROM = {
ca_culture_italian_1 = {
hidden_tooltip = { disband_event_forces = faction_loyalists }
potential = {
FROM = { culture = italian }
any_demesne_title = { # All titles
limit = {
OR = {
tier = king
tier = emperor
}
# is_titular = no
NOT = { has_law = centralization_0 }
}
if = {
limit = { has_law = centralization_1 }
add_law = centralization_0
}
if = {
limit = { has_law = centralization_2 }
add_law = centralization_1
}
if = {
limit = { has_law = centralization_3 }
add_law = centralization_2
}
if = {
limit = { has_law = centralization_4 }
add_law = centralization_3
}
}
}
}
any_attacker = {
prerequisites = { ca_wall_2 }
limit = { character = ROOT }
build_cost = 200
participation_scaled_prestige = 100
build_time = 730
pikemen = 30
hidden_tooltip = {
disband_event_forces = faction_revolters
pikemen_morale = 0.15
}
ai_creation_factor = 101
}
start = {
any_attacker = {
limit = { NOT = { character = ROOT } }
AND = {
hidden_tooltip = {
FROM = { religion_group = christian }
participation_scaled_prestige = 100
year = 1085
disband_event_forces = faction_revolters
has_building = ca_barracks_1
}
}
}
}
}
}

ca_culture_italian_2 = {
on_success_title = {
potential = {
succession_w_cooldown = seniority
FROM = { culture = italian }
}

on_fail = {
ROOT = {
prestige = -100
}
any_defender = {
limit = { character = FROM }
participation_scaled_prestige = 50
}
any_defender = {
limit = { NOT = { character = FROM } }
hidden_tooltip = { participation_scaled_prestige = 50 }
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
upgrades_from = ca_culture_italian_1
build_cost = 300
build_time = 1095
pikemen = 40
pikemen_morale = 0.15
ai_creation_factor = 100
start = {
hidden_tooltip = {
AND = {
any_attacker = {
disband_event_forces = faction_revolters
FROM = { religion_group = christian }
year = 1145
add_character_modifier = {
name = faction_succ_seniority_ultimatum_timer
has_building = ca_barracks_1
hidden = yes
duration = 3650
}
}
}
}
}
FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } }
}
}

ca_culture_italian_3 = {
on_reverse_demand = {
potential = {
ROOT = {
FROM = { culture = italian }
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 }
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
upgrades_from = ca_culture_italian_2
build_cost = 400
build_time = 2190
pikemen = 50
pikemen_morale = 0.15
ai_creation_factor = 99
start = {
hidden_tooltip = {
AND = {
any_attacker = {
FROM = { religion_group = christian }
limit = { liege = { character = FROM } }
year = 1190
prisoner = FROM
disband_event_forces = faction_revolters
has_building = ca_barracks_1
add_character_modifier = {
name = faction_succ_seniority_ultimatum_timer
hidden = yes
duration = 3650
}
}
}
}
}
FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } }
}
}

ca_culture_italian_4 = {
attacker_ai_victory_worth = {
potential = {
FROM = { culture = italian }
factor = -1 # always accept
}
attacker_ai_defeat_worth = {
factor = 100
}

defender_ai_victory_worth = {
factor = -1 # always accept
}
defender_ai_defeat_worth = {
factor = 100
}
}


change_primogeniture_succession_law = {
name = CB_NAME_PRIMOGENITURE_SUCCESSION_LAW
war_name = WAR_NAME_PRIOGENITURE_SUCCESSION_LAW
sprite = 6
truce_days = 3650
can_call_allies = no
can_ask_to_join_war = no
major_revolt = yes
attacker_alliance_occ_warscore = yes # Occupying any holding of any attacker counts towards war score
can_use = {
ROOT = {
vassal_of = FROM
}
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
upgrades_from = ca_culture_italian_3
build_cost = 500
build_time = 2190
pikemen = 60
pikemen_morale = 0.15
ai_creation_factor = 98
start = {
is_valid_title = {
AND = {
NOT = {
has_law = succ_primogeniture
FROM = { religion_group = christian }
}
year = 1240
OR = {
has_building = ca_barracks_1
tier = emperor
}
tier = king
is_primary_holder_title = yes
}
}
}
}

on_success = {
#Russian Armories
FROM = {
ca_culture_russian_1 = {
hidden_tooltip = { disband_event_forces = faction_loyalists }
potential = {
FROM = { culture = russian }
any_demesne_title = { # All titles
limit = {
OR = {
tier = king
tier = emperor
}
# is_titular = no
NOT = { has_law = centralization_0 }
}
if = {
limit = { has_law = centralization_1 }
add_law = centralization_0
}
if = {
limit = { has_law = centralization_2 }
add_law = centralization_1
}
if = {
limit = { has_law = centralization_3 }
add_law = centralization_2
}
if = {
limit = { has_law = centralization_4 }
add_law = centralization_3
}
}
}
}
prerequisites = { ca_wall_2 }
build_cost = 200
build_time = 730
heavy_infantry = 30
heavy_infantry_defensive = 0.15
ai_creation_factor = 101
start = {
any_attacker = {
AND = {
limit = { character = ROOT }
participation_scaled_prestige = 100
FROM = { religion_group = christian }
year = 1085
hidden_tooltip = {
disband_event_forces = faction_revolters
has_building = ca_barracks_1
}
}
any_attacker = {
limit = { NOT = { character = ROOT } }
hidden_tooltip = {
participation_scaled_prestige = 100
disband_event_forces = faction_revolters
}
}
}
}
}
}

ca_culture_russian_2 = {
on_success_title = {
potential = {
succession_w_cooldown = primogeniture
FROM = { culture = russian }
}

on_fail = {
ROOT = {
prestige = -100
}
any_defender = {
limit = { character = FROM }
participation_scaled_prestige = 50
}
any_defender = {
limit = { NOT = { character = FROM } }
hidden_tooltip = { participation_scaled_prestige = 50 }
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
upgrades_from = ca_culture_russian_1
build_cost = 300
build_time = 1095
heavy_infantry = 40
heavy_infantry_defensive = 0.15
ai_creation_factor = 100
start = {
hidden_tooltip = {
AND = {
any_attacker = {
disband_event_forces = faction_revolters
FROM = { religion_group = christian }
year = 1140
add_character_modifier = {
name = faction_succ_primogeniture_ultimatum_timer
has_building = ca_barracks_1
hidden = yes
duration = 3650
}
}
}
}
}
FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } }
}
}

ca_culture_russian_3 = {
on_reverse_demand = {
potential = {
ROOT = {
FROM = { culture = russian }
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 }
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
upgrades_from = ca_culture_russian_2
build_cost = 400
build_time = 2190
heavy_infantry = 50
heavy_infantry_defensive = 0.15
ai_creation_factor = 99
start = {
hidden_tooltip = {
AND = {
any_attacker = {
FROM = { religion_group = christian }
limit = { liege = { character = FROM } }
year = 1195
prisoner = FROM
disband_event_forces = faction_revolters
has_building = ca_barracks_1
add_character_modifier = {
name = faction_succ_primogeniture_ultimatum_timer
hidden = yes
duration = 3650
}
}
}
}
}
FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } }
}
}

ca_culture_russian_4 = {
attacker_ai_victory_worth = {
potential = {
FROM = { culture = russian }
factor = -1 # always accept
}
attacker_ai_defeat_worth = {
factor = 100
}

defender_ai_victory_worth = {
factor = -1 # always accept
}
defender_ai_defeat_worth = {
factor = 100
}
}

change_feudal_elective_succession_law = {
name = CB_NAME_FEUDAL_ELECTIVE_SUCCESSION_LAW
war_name = WAR_NAME_FEUDAL_ELECTIVE_SUCCESSION_LAW
sprite = 6
truce_days = 3650
can_call_allies = no
can_ask_to_join_war = no
major_revolt = yes
attacker_alliance_occ_warscore = yes # Occupying any holding of any attacker counts towards war score
can_use = {
ROOT = {
vassal_of = FROM
}
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 4 }

upgrades_from = ca_culture_russian_3
is_valid_title = {
build_cost = 500
build_time = 2190
NOT = {
has_law = succ_feudal_elective
heavy_infantry = 60
heavy_infantry_defensive = 0.15
ai_creation_factor = 98
start = {
AND = {
FROM = { religion_group = christian }
year = 1240
has_building = ca_barracks_1
}
}
}
OR = {
tier = emperor
tier = king
is_primary_holder_title = yes
}

# OR = {
# AND = {
# tier = emperor
# OR = {
# ROOT = { tier = king }
# ROOT = { tier = duke }
# }
# }
# AND = {
# tier = king
# ROOT = { tier = duke }
# }
# AND = {
# tier = duke
# ROOT = { tier = count }
# }
# }

}
}
on_success = {
# Scandinavian Housecarls (and Saxon)
FROM = {
ca_culture_group_north_germanic_1 = {
potential = {
hidden_tooltip = { disband_event_forces = faction_loyalists }
FROM = {
OR = {
any_demesne_title = { # All titles
culture_group = north_germanic
culture = saxon
limit = {
OR = {
tier = king
tier = emperor
}
# is_titular = no
NOT = { has_law = centralization_0 }
}
if = {
limit = { has_law = centralization_1 }
add_law = centralization_0
}
if = {
limit = { has_law = centralization_2 }
add_law = centralization_1
}
if = {
limit = { has_law = centralization_3 }
add_law = centralization_2
}
if = {
limit = { has_law = centralization_4 }
add_law = centralization_3
}
}
}
}
}
}
any_attacker = {
prerequisites = { ca_wall_2 }
limit = { character = ROOT }
build_cost = 200
participation_scaled_prestige = 100
build_time = 730
heavy_infantry = 30
hidden_tooltip = {
disband_event_forces = faction_revolters
heavy_infantry_offensive = 0.15
ai_creation_factor = 101
start = {
AND = {
FROM = { religion_group = christian }
year = 1066
has_building = ca_barracks_1
}
}
}
}
any_attacker = {
}
limit = { NOT = { character = ROOT } }
ca_culture_group_north_germanic_2 = {
potential = {
hidden_tooltip = {
participation_scaled_prestige = 100
FROM = {
disband_event_forces = faction_revolters
OR = {
culture_group = north_germanic
culture = saxon
}
}
}
}
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
upgrades_from = ca_culture_group_north_germanic_1
on_success_title = {
build_cost = 300
succession_w_cooldown = feudal_elective
build_time = 1095
}
heavy_infantry = 40

heavy_infantry_offensive = 0.15
on_fail = {
ai_creation_factor = 101
ROOT = {
prestige = -100
}
any_defender = {
limit = { character = FROM }
participation_scaled_prestige = 50
}
any_defender = {
limit = { NOT = { character = FROM } }
hidden_tooltip = { participation_scaled_prestige = 50 }
}
start = {
hidden_tooltip = {
AND = {
any_attacker = {
disband_event_forces = faction_revolters
FROM = { religion_group = christian }
year = 1120
add_character_modifier = {
name = faction_succ_feudal_elective_ultimatum_timer
has_building = ca_barracks_1
hidden = yes
duration = 3650
}
}
}
}
}
FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } }
}
}
ca_culture_group_north_germanic_3 = {
on_reverse_demand = {
potential = {
FROM = {
ROOT = {
OR = {
prestige = -200
prisoner = FROM
culture_group = north_germanic
}
culture = saxon
any_defender = {
}
limit = { character = FROM }
}
participation_scaled_prestige = 100
}
any_defender = {
limit = { NOT = { character = FROM } }
hidden_tooltip = { participation_scaled_prestige = 100 }
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
upgrades_from = ca_culture_group_north_germanic_2
build_cost = 400
build_time = 2190
heavy_infantry = 50
heavy_infantry_offensive = 0.15
ai_creation_factor = 101
start = {
hidden_tooltip = {
AND = {
any_attacker = {
FROM = { religion_group = christian }
limit = { liege = { character = FROM } }
year = 1183
prisoner = FROM
disband_event_forces = faction_revolters
has_building = ca_barracks_1
add_character_modifier = {
name = faction_succ_feudal_elective_ultimatum_timer
hidden = yes
duration = 3650
}
}
}
}
}
FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } }
}
}

ca_culture_group_north_germanic_4 = {
attacker_ai_victory_worth = {
potential = {
factor = -1 # always accept
}
attacker_ai_defeat_worth = {
factor = 100
}

defender_ai_victory_worth = {
factor = -1 # always accept
}
defender_ai_defeat_worth = {
factor = 100
}
}


invasion = {
name = CB_NAME_INVASION
war_name = WAR_NAME_INVASION
sprite = 7
truce_days = 3650
hostile_against_others = yes
can_ask_to_join_war = no
can_use_title = {
OR = {
FROM = {
FROM = {
OR = {
has_landed_title = PREV
culture_group = north_germanic
culture = saxon
}
}
}
holder_scope = {
}
is_liege_or_above = FROM
trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
upgrades_from = ca_culture_group_north_germanic_3
build_cost = 500
build_time = 2190
heavy_infantry = 60
heavy_infantry_offensive = 0.15
ai_creation_factor = 101
start = {
AND = {
FROM = { religion_group = christian }
year = 1219
has_building = ca_barracks_1
}
}
}
}
}
}
is_valid_title = {
# Hungarian Hussars (and West Slavic)
OR = {
ca_culture_hungarian_1 = {
potential = {
FROM = {
FROM = {
has_landed_title = PREV
OR = {
culture = hungarian
culture_group = west_slavic
}
}
}
holder_scope = {
}
is_liege_or_above = FROM
prerequisites = { ca_wall_2 }
build_cost = 200
build_time = 730
light_cavalry = 30
light_cavalry_defensive = 0.15
ai_creation_factor = 101
start = {
AND = {
FROM = { religion_group = christian }
year = 1125
has_building = ca_stable_1
}
}
}
}
}
}

ca_culture_hungarian_2 = {
potential = {
on_success = {
FROM = {
ROOT = {
OR = {
prestige = 200
}
culture = hungarian
any_attacker = {
culture_group = west_slavic
limit = { character = ROOT }
}
participation_scaled_prestige = 200
}
}
any_attacker = {
limit = { NOT = { character = ROOT } }
hidden_tooltip = { participation_scaled_prestige = 200 }
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
upgrades_from = ca_culture_hungarian_1
build_cost = 300
build_time = 1095
light_cavalry = 40
light_cavalry_defensive = 0.15
ai_creation_factor = 101
start = {
hidden_tooltip = {
AND = {
ROOT = {
occupy_minors_of_occupied_settlements = FROM
FROM = { religion_group = christian }
gain_all_occupied_titles = FROM
year = 1140
give_nickname = nick_the_conqueror
has_building = ca_stable_1
}
}
ROOT = {
}
if = {
}
limit = {
ca_culture_hungarian_3 = {
has_dlc = "Legacy of Rome"
potential = {
FROM = {
OR = {
has_landed_title = e_byzantium
OR = {
has_landed_title = e_roman_empire
culture = hungarian
}
culture_group = west_slavic
religion_group = christian
}
character_event = { id = LoR.30 days = 12 }
}
}
}
}
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
upgrades_from = ca_culture_hungarian_2
build_cost = 400
build_time = 2190
light_cavalry = 50
light_cavalry_defensive = 0.15
ai_creation_factor = 101
start = {
FROM = {
AND = {
prestige = -200
FROM = { religion_group = christian }
year = 1180
has_building = ca_stable_1
}
}
}
}
}

ca_culture_hungarian_4 = {
on_success_title = {
potential = {
custom_tooltip = invasion_succ_tip
FROM = {
OR = {
hidden_tooltip = {
culture = hungarian
usurp_title_plus_barony_if_unlanded = ROOT
culture_group = west_slavic
FROM = { set_defacto_liege = ROOT }
if = {
limit = {
FROM = { is_liege_or_above = ROOT }
}
}
FROM = { imprison = ROOT }
}
}
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
upgrades_from = ca_culture_hungarian_3
build_cost = 500
build_time = 2190
light_cavalry = 60
light_cavalry_defensive = 0.15
ai_creation_factor = 101
start = {
if = {
AND = {
limit = {
higher_tier_than = BARON
FROM = { religion_group = christian }
year = 1250
NOT = { culture = ROOT }
has_building = ca_stable_1
}
}
hidden_tooltip = { conquest_culture = ROOT }
}
}
}
}

on_fail = {
# Arabian Camel Cavalry
ROOT = {
ca_culture_group_arabic_1 = {
potential = {
prestige = -200
FROM = { culture_group = arabic }
}
}
FROM = {
prerequisites = { ca_wall_2 }
build_cost = 200
prestige = 100
build_time = 730
light_cavalry = 30
light_cavalry_defensive = 0.15
ai_creation_factor = 101
start = {
AND = {
FROM = { religion_group = muslim }
year = 1076
has_building = ca_stable_1
}
}
}
any_defender = {
}
limit = { character = FROM }
ca_culture_group_arabic_2 = {
participation_scaled_prestige = 100
potential = {
FROM = { culture_group = arabic }
}
}
any_defender = {
trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
limit = { NOT = { character = FROM } }
upgrades_from = ca_culture_group_arabic_1
hidden_tooltip = { participation_scaled_prestige = 100 }
build_cost = 300
build_time = 1095
light_cavalry = 40
light_cavalry_defensive = 0.15
ai_creation_factor = 101
start = {
AND = {
FROM = { religion_group = muslim }
year = 1120
has_building = ca_stable_1
}
}
}
}
}

ca_culture_group_arabic_3 = {
on_reverse_demand = {
potential = {
ROOT = {
FROM = { culture_group = arabic }
prestige = -200
transfer_scaled_wealth = {
to = FROM
value = 8.0
}
}
}
FROM = {
trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
prestige = 200
upgrades_from = ca_culture_group_arabic_2
}
build_cost = 400
build_time = 2190
any_defender = {
limit = { character = FROM }
light_cavalry = 50
participation_scaled_prestige = 200
light_cavalry_defensive = 0.15
}
ai_creation_factor = 101
FROM = {
start = {
if = {
AND = {
limit = {
has_dlc = "Legacy of Rome"
FROM = { religion_group = muslim }
year = 1183
OR = {
has_landed_title = e_byzantium
has_building = ca_stable_1
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 }
}
}
}
}

ca_culture_group_arabic_4 = {
on_reverse_demand_title = {
potential = {
ROOT = {
FROM = { culture_group = arabic }
remove_claim = PREV
}
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 4 }

upgrades_from = ca_culture_group_arabic_3
on_attacker_leader_death = {
build_cost = 500
build_time = 2190
hidden_tooltip = {
light_cavalry = 60
any_defender = {
letter_event = {
light_cavalry_defensive = 0.15
id = 251
ai_creation_factor = 101
}
start = {
AND = {
FROM = { religion_group = muslim }
year = 1219
has_building = ca_stable_1
}
}
}
}

end_war = whitepeace
}

attacker_ai_victory_worth = {
factor = 150
}
}
attacker_ai_defeat_worth = {
# Byzantine Cataphracts
factor = 100
ca_culture_group_byzantine_1 = {
}
potential = {

FROM = { culture_group = byzantine }
defender_ai_victory_worth = {
factor = -1 # always accept
}
defender_ai_defeat_worth = {
factor = 100
}
}


tribal_invasion = {
name = CB_NAME_INVASION
war_name = WAR_NAME_INVASION
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

can_use = {
ROOT = {
OR = {
AND = {
primary_title = { is_tribal_type_title = yes }
has_horde_culture = yes
NOT = { religion_group = christian }
}
AND = {
mercenary = yes
NOT = {
num_of_titles = 2
}
}
}
}
}
prerequisites = { ca_wall_2 }
build_cost = 200
build_time = 730
knights = 10
horse_archers = 10
knights_offensive = 0.075
horse_archers_offensive = 0.075
ai_creation_factor = 101
start = {
ROOT = {
NOT = { is_liege_or_above = FROM }
AND = {
FROM = { religion_group = christian }
year = 1125
has_building = ca_stable_1
}
}
}
}
}
ca_culture_group_byzantine_2 = {
potential = {
is_valid_title = {
FROM = { culture_group = byzantine }
FROM = {
any_realm_title = {
}
de_jure_liege_or_above = PREVPREV
trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
upgrades_from = ca_culture_group_byzantine_1
build_cost = 300
build_time = 1095
knights = 15
horse_archers = 10
knights_offensive = 0.075
horse_archers_offensive = 0.075
ai_creation_factor = 101
start = {
AND = {
FROM = { religion_group = christian }
year = 1140
has_building = ca_stable_1
}
}
}
}
}
}

ca_culture_group_byzantine_3 = {
potential = {
on_success = {
ROOT = {
FROM = { culture_group = byzantine }
prestige = 200
}
}
any_attacker = {
trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
limit = { character = ROOT }
upgrades_from = ca_culture_group_byzantine_2
participation_scaled_prestige = 200
build_cost = 400
build_time = 2190
knights = 15
horse_archers = 20
knights_offensive = 0.075
horse_archers_offensive = 0.075
ai_creation_factor = 101
start = {
AND = {
FROM = { religion_group = christian }
year = 1180
has_building = ca_stable_1
}
}
}
any_attacker = {
}
limit = { NOT = { character = ROOT } }
ca_culture_group_byzantine_4 = {
hidden_tooltip = { participation_scaled_prestige = 200 }
potential = {
}
FROM = { culture_group = byzantine }
FROM = {
prestige = -200
}
}
hidden_tooltip = {
trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
ROOT = {
upgrades_from = ca_culture_group_byzantine_3
occupy_minors_of_occupied_settlements = FROM
build_cost = 500
gain_all_occupied_titles = FROM
build_time = 2190
knights = 20
horse_archers = 20
knights_offensive = 0.075
horse_archers_offensive = 0.075
ai_creation_factor = 101
start = {
AND = {
FROM = { religion_group = christian }
year = 1250
has_building = ca_stable_1
}
}
}
}
}
}
on_success_title = {
# Irish Gallowglass
custom_tooltip = tribal_invasion_succ_tip
ca_culture_irish_1 = {
potential = {
hidden_tooltip = {
FROM = { culture = irish }
ROOT = {
vassalize_or_take_under_title = {
}
title = PREV
prerequisites = { ca_wall_2 }
build_cost = 200
enemy = FROM
is_crusade = yes # Even if the title holder is not participating in the war, gain holdings occupied by all Crusade participants
build_time = 730
}
heavy_infantry = 30
heavy_infantry_defensive = 0.15
ai_creation_factor = 101
start = {
AND = {
FROM = { religion_group = christian }
year = 1125
has_building = ca_barracks_1
}
}
}
}
}
}

ca_culture_irish_2 = {
potential = {
on_fail = {
FROM = { culture = irish }
FROM = {
prestige = 100
}
}
any_defender = {
trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
limit = { character = FROM }
upgrades_from = ca_culture_irish_1
participation_scaled_prestige = 100
build_cost = 300
build_time = 1095
heavy_infantry = 40
heavy_infantry_defensive = 0.15
ai_creation_factor = 101
start = {
AND = {
FROM = { religion_group = christian }
year = 1140
has_building = ca_barracks_1
}
}
}
any_defender = {
}
limit = { NOT = { character = FROM } }
ca_culture_irish_3 = {
hidden_tooltip = { participation_scaled_prestige = 100 }
potential = {
FROM = { culture = irish }
}
}
ROOT = {
trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
prestige = -200
upgrades_from = ca_culture_irish_2
build_cost = 400
build_time = 2190
heavy_infantry = 50
heavy_infantry_defensive = 0.15
ai_creation_factor = 101
start = {
AND = {
FROM = { religion_group = christian }
year = 1180
has_building = ca_barracks_1
}
}
}
}
}

ca_culture_irish_4 = {
on_reverse_demand = {
potential = {
FROM = { culture = irish }
ROOT = {
prestige = -200
}
transfer_scaled_wealth = {
trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
to = FROM
upgrades_from = ca_culture_irish_3
build_cost = 500
value = 4.0
build_time = 2190
heavy_infantry = 60
heavy_infantry_defensive = 0.15
ai_creation_factor = 101
start = {
AND = {
FROM = { religion_group = christian }
year = 1250
has_building = ca_barracks_1
}
}
}
}
FROM = {
}
prestige = 200
# Ethiopian Light Infantry Drilling Ground
ca_culture_ethiopian_1 = {
potential = {
FROM = { culture = ethiopian }
}
}
FROM = {
prerequisites = { ca_wall_2 }
build_cost = 200
if = {
build_time = 730
limit = {
has_dlc = "Legacy of Rome"
light_infantry = 60
OR = {
light_infantry_offensive = 0.15
has_landed_title = e_byzantium
ai_creation_factor = 101
has_landed_title = e_roman_empire
}
start = {
religion_group = christian
AND = {
year = 1066
}
hidden_tooltip = { character_event = { id = LoR.30 days = 12 } }
has_building = ca_barracks_1
}
}
}
}
any_defender = {
}
limit = { character = FROM }
ca_culture_ethiopian_2 = {
participation_scaled_prestige = 200
potential = {
FROM = { culture = ethiopian }
}
}
any_defender = {
trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
limit = { NOT = { character = FROM } }
upgrades_from = ca_culture_ethiopian_1
hidden_tooltip = { participation_scaled_prestige = 200 }
build_cost = 300
build_time = 1095
light_infantry = 80
light_infantry_offensive = 0.15
ai_creation_factor = 101
start = {
AND = {
year = 1120
has_building = ca_barracks_1
}
}
}
}
}

ca_culture_ethiopian_3 = {
attacker_ai_victory_worth = {
potential = {
factor = 200
FROM = { culture = ethiopian }
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
attacker_ai_defeat_worth = {
upgrades_from = ca_culture_ethiopian_2
build_cost = 400
factor = 100
}
build_time = 2190

light_infantry = 100
defender_ai_victory_worth = {
light_infantry_offensive = 0.15
factor = -1 # always accept
ai_creation_factor = 101
}
start = {
defender_ai_defeat_worth = {
AND = {
year = 1183
factor = 100
}
has_building = ca_barracks_1
}

crusade = {
name = CB_NAME_CRUSADE
war_name = WAR_NAME_CRUSADE
sprite = 9
truce_days = 3650
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

can_use = {
OR = {
ROOT = {
religion_group = christian
year = 1090
}
ROOT = {
religion = sunni
year = 1187 # Allow if the Caliphate has survived this long
}
ROOT = {
religion = shiite
year = 1187 # Allow if the Caliphate has survived this long
}
}
}
}
ROOT = {
}
can_call_crusade = yes
ca_culture_ethiopian_4 = {
has_called_crusade = no
potential = {
religion_authority = 0.05
FROM = { culture = ethiopian }
}
}
FROM = {
trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
OR = {
upgrades_from = ca_culture_ethiopian_3
NOT = { religion_group = ROOT }
build_cost = 500
build_time = 2190
is_heresy_of = ROOT
is_parent_religion = ROOT
light_infantry = 120
light_infantry_offensive = 0.15
ai_creation_factor = 101
start = {
AND = {
year = 1219
has_building = ca_barracks_1
}
}
}
}
NOT = { # Not if the Schism has been mended
}
# West African Free Warrior Lodge
ca_culture_west_african_1 = {
potential = {
FROM = { culture_group = west_african }
}
prerequisites = { ca_wall_2 }
build_cost = 200
build_time = 730
light_infantry = 30
archers = 30
light_infantry_offensive = 0.15
ai_creation_factor = 101
start = {
AND = {
AND = {
year = 1066
religion = catholic
has_global_flag = schism_mended
has_building = ca_barracks_1
}
}
}
}
}
}

ca_culture_west_african_2 = {
potential = {
can_use_title = {
FROM = { culture_group = west_african }
FROM = {
any_realm_title = {
}
de_jure_liege_or_above = PREVPREV
trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
}
upgrades_from = ca_culture_west_african_1
build_cost = 300
independent = yes # Don't declare Crusades on revolters - chances are high the war will invalidate
build_time = 1095
light_infantry = 40
num_of_realm_counties = {
archers = 40
value = 6
light_infantry_offensive = 0.15
title = PREV
ai_creation_factor = 101
start = {
AND = {
year = 1120
has_building = ca_barracks_1
}
}
}
}
}
}

ca_culture_west_african_3 = {
potential = {
is_valid = {
ROOT = {
FROM = { culture_group = west_african }
can_call_crusade = yes
}
}
FROM = {
trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
OR = {
upgrades_from = ca_culture_west_african_2
NOT = { religion_group = ROOT }
build_cost = 400
build_time = 2190
is_heresy_of = ROOT
is_parent_religion = ROOT
light_infantry = 50
archers = 50
light_infantry_offensive = 0.15
ai_creation_factor = 101
start = {
AND = {
year = 1183
has_building = ca_barracks_1
}
}
}
}
}
}

ca_culture_west_african_4 = {
potential = {
is_valid_title = {
FROM = { culture_group = west_african }
FROM = {
any_realm_title = {
}
de_jure_liege_or_above = PREVPREV
trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
upgrades_from = ca_culture_west_african_3
build_cost = 500
build_time = 2190
light_infantry = 60
archers = 60
light_infantry_offensive = 0.15
ai_creation_factor = 101
start = {
AND = {
year = 1219
has_building = ca_barracks_1
}
}
}
}
}
}

on_success_title = {
# South Slavic Cavalry
if = {
ca_culture_group_south_slavic_1 = {
potential = {
limit = {
has_holder = yes
FROM = { culture_group = south_slavic }
holder_scope = {
religion = ROOT
}
}
holder_scope = {
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
}
}
}
}
prerequisites = { ca_wall_2 }
build_cost = 200
build_time = 730
knights = 5
light_cavalry = 20
knights_defensive = 0.075
light_cavalry_defensive = 0.075
ai_creation_factor = 101
start = {
if = {
AND = {
limit = {
OR = {
FROM = { religion_group = christian }
year = 1125
has_holder = no
has_building = ca_stable_1
NOT = {
holder_scope = {
religion = ROOT
}
}
}
}
most_participating_attacker = {
gain_settlements_under_title = {
title = PREV
enemy = FROM
}
if = {
limit = {
primary_title = { is_primary_type_title = no } # Mercs, the Pope, Holy Orders, etc
PREV = { has_holder = no }
OR = {
NOT = { character = ROOT }
independent = yes
liege = {
tier = EMPEROR
}
}
}
usurp_title = PREV
if = {
limit = {
NOT = { culture = PREV }
}
hidden_tooltip = { PREV = { conquest_culture = THIS } }
}
}
}
}
}
}
}
ca_culture_group_south_slavic_2 = {
potential = {
FROM = { culture_group = south_slavic }
}
trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
upgrades_from = ca_culture_group_south_slavic_1
build_cost = 300
build_time = 1095
knights = 10
light_cavalry = 20
knights_defensive = 0.075
light_cavalry_defensive = 0.075
ai_creation_factor = 101
start = {
any_attacker = {
AND = {
limit = { character = ROOT }
participation_scaled_prestige = 500
FROM = { religion_group = christian }
participation_scaled_piety = 1000
year = 1140
if = {
has_building = ca_stable_1
limit = {
religion_group = muslim
}
participation_scaled_decadence = -100
}
}
}
}
any_attacker = {
}
limit = { NOT = { character = ROOT } }
ca_culture_group_south_slavic_3 = {
potential = {
hidden_tooltip = {
participation_scaled_prestige = 500
FROM = { culture_group = south_slavic }
participation_scaled_piety = 1000
if = {
limit = {
religion_group = muslim
}
participation_scaled_decadence = -100
}
}
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
upgrades_from = ca_culture_group_south_slavic_2
build_cost = 400
build_time = 2190
knights = 15
light_cavalry = 20
knights_defensive = 0.075
light_cavalry_defensive = 0.075
ai_creation_factor = 101
start = {
ROOT = {
AND = {
religion_authority = 0.2
FROM = { religion_group = christian }
year = 1180
has_building = ca_stable_1
}
}
}
ca_culture_group_south_slavic_4 = {
potential = {
FROM = { culture_group = south_slavic }
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
upgrades_from = ca_culture_group_south_slavic_3
build_cost = 500
build_time = 2190
knights = 15
light_cavalry = 30
knights_defensive = 0.075
light_cavalry_defensive = 0.075
ai_creation_factor = 101
start = {
FROM = {
AND = {
piety = -100
FROM = { religion_group = christian }
year = 1250
has_building = ca_stable_1
}
}
}
}
}

on_fail = {
# Dutch Urban Militia
ROOT = {
ca_culture_dutch_1 = {
potential = {
piety = -100
religion_authority = -0.05
FROM = { culture = dutch }
}
}
prerequisites = { ca_wall_2 }
build_cost = 200
build_time = 730
pikemen = 15
light_infantry = 30
light_infantry_offensive = 0.075
pikemen_offensive = 0.075
ai_creation_factor = 101
start = {
any_defender = {
AND = {
limit = { character = FROM }
participation_scaled_piety = 200
year = 1085
participation_scaled_prestige = 100
has_building = ca_barracks_1
if = {
limit = {
religion_group = muslim
}
participation_scaled_decadence = -50
}
}
}
}
any_defender = {
}
limit = { NOT = { character = FROM } }
ca_culture_dutch_2 = {
potential = {
hidden_tooltip = {
participation_scaled_piety = 200
FROM = { culture = dutch }
participation_scaled_prestige = 100
if = {
limit = {
religion_group = muslim
}
participation_scaled_decadence = -50
}
}
}
}
trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
upgrades_from = ca_culture_dutch_1
build_cost = 300
build_time = 1095
pikemen = 20
light_infantry = 40
light_infantry_offensive = 0.075
pikemen_offensive = 0.075
ai_creation_factor = 101
start = {
FROM = {
AND = {
religion_authority = 0.025
}
year = 1145
FROM = {
has_building = ca_barracks_1
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 } }
}
}
}
}
}
}

ca_culture_dutch_3 = {
on_reverse_demand = {
potential = {
FROM = { culture = dutch }
ROOT = {
piety = -200
religion_authority = -0.1
}
}
FROM = {
trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
piety = 100
upgrades_from = ca_culture_dutch_2
religion_authority = 0.05
build_cost = 400
}
build_time = 2190
pikemen = 25
any_defender = {
limit = { character = FROM }
light_infantry = 50
participation_scaled_piety = 300
light_infantry_offensive = 0.075
participation_scaled_prestige = 150
pikemen_offensive = 0.075
if = {
ai_creation_factor = 101
limit = {
religion_group = muslim
start = {
AND = {
}
participation_scaled_decadence = -100
year = 1190
has_building = ca_barracks_1
}
}
}
}
FROM = {
}
if = {
ca_culture_dutch_4 = {
potential = {
limit = {
has_dlc = "Legacy of Rome"
FROM = { culture = dutch }
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 = {
trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
limit = { NOT = { character = FROM } }
upgrades_from = ca_culture_dutch_3
build_cost = 500
hidden_tooltip = {
participation_scaled_piety = 300
build_time = 2190
participation_scaled_prestige = 150
pikemen = 30
light_infantry = 60
if = {
limit = {
light_infantry_offensive = 0.075
religion_group = muslim
pikemen_offensive = 0.075
}
ai_creation_factor = 101
participation_scaled_decadence = -100
}
start = {
AND = {
year = 1240
has_building = ca_barracks_1
}
}
}
}
}

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
}
}
}
}


religious = {
name = CB_NAME_RELIGIOUS
war_name = WAR_NAME_RELIGIOUS
sprite = 9
truce_days = 3650
is_permanent = 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 = {
# City
city = {
ROOT = {
ct_wall_q_1 = {
NOT = {
has_character_modifier = holy_war_cooldown
prerequisites = { ct_wall_1 }
}
build_cost = 50
NOT = { religion_group = pagan_group }
build_time = 182
NOT = { same_realm = FROM }
fort_level = 0.4
ai_creation_factor = 60
start = {
OR = {
OR = {
NOT = { religion_group = FROM }
is_heresy_of = FROM
is_parent_religion = FROM
AND = {
AND = {
FROM = { religion_group = muslim }
religion_group = muslim
year = 1076
NOT = { religion = FROM }
FROM = {
NOT = {
any_current_enemy = {
NOT = {
religion_group = muslim
}
}
}
}
}
}
}
NOT = {
AND = {
AND = {
religion_group = muslim
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1066
OR = {
FROM = { religion = bogomilist }
FROM = { religion = miaphysite }
}
}
}
AND = {
}
OR = {
FROM = { religion_group = christian }
year = 1080
ai = no
}
piety = 150
AND = {
}
top_liege = {
FROM = { religion_group = pagan_group }
year = 1120
religion_group = ROOT
NOT = { religion = FROM }
OR = {
religion = ROOT
AND = {
is_heretic = no
ROOT = { is_heretic = no }
}
}
}
}
}
}
}
}
}
ct_wall_q_2 = {
on_add = {
ROOT = {
prerequisites = { ct_wall_2 }
piety = -100
upgrades_from = ct_wall_q_1
add_character_modifier = {
build_cost = 50
name = holy_war_cooldown
build_time = 182
fort_level = 0.4
duration = 2555
}
ai_creation_factor = 59
}
}


start = {
is_valid = {
ROOT = {
NOT = { religion_group = pagan_group }
NOT = { same_realm = FROM }
OR = {
OR = {
NOT = { religion_group = FROM }
is_heresy_of = FROM
is_parent_religion = FROM
AND = {
AND = {
FROM = { religion_group = muslim }
religion_group = muslim
year = 1100
NOT = { religion = FROM }
}
}
AND = {
}
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
top_liege = {
year = 1096
NOT = { religion = FROM }
}
}
}
on_success = {
any_attacker = {
limit = { character = ROOT }
participation_scaled_piety = 100
participation_scaled_prestige = 50
if = {
limit = {
religion_group = muslim
}
}
participation_scaled_decadence = -10
AND = {
}
FROM = { religion_group = christian }
}
year = 1150
any_attacker = {
}
limit = { NOT = { character = ROOT } }
AND = {
hidden_tooltip = {
FROM = { religion_group = pagan_group }
participation_scaled_piety = 100
year = 1200
participation_scaled_prestige = 50
if = {
limit = {
religion_group = muslim
}
participation_scaled_decadence = -10
}
}
}
}
}
}
}
ROOT = { religion_authority = 0.01 }
ct_wall_q_3 = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 1 }
FROM = { religion_authority = -0.01 }
FROM = { piety = -100 }
upgrades_from = ct_wall_q_2
build_cost = 50
FROM = { prestige = -50 }
}
build_time = 182
fort_level = 0.5
ai_creation_factor = 58


on_success_title = {
start = {
OR = {
ROOT = {
gain_settlements_under_title = {
AND = {
title = PREV
FROM = { religion_group = muslim }
year = 1170
enemy = FROM
}
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1180
}
AND = {
FROM = { religion_group = christian }
year = 1175
}
AND = {
FROM = { religion_group = pagan_group }
year = 1250
}
}
}
}
}
}
}
ct_wall_q_4 = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 3 }
upgrades_from = ct_wall_q_3
build_cost = 100
build_time = 365
fort_level = 1
ai_creation_factor = 57


start = {
on_fail = {
OR = {
ROOT = { piety = -50 }
AND = {
ROOT = { prestige = -100 }
}
FROM = { religion_group = muslim }

year = 1235
on_reverse_demand = {
ROOT = {
transfer_scaled_wealth = {
to = FROM
value = 4.0
}
}
any_defender = {
limit = { character = FROM }
participation_scaled_piety = 200
participation_scaled_prestige = 100
if = {
limit = {
religion_group = muslim
}
}
participation_scaled_decadence = -10
AND = {
}
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
}
year = 1250
any_defender = {
}
limit = { NOT = { character = FROM } }
AND = {
hidden_tooltip = {
FROM = { religion_group = christian }
participation_scaled_piety = 200
year = 1240
participation_scaled_prestige = 100
}
AND = {
if = {
limit = {
FROM = { religion_group = pagan_group }
year = 1340
religion_group = muslim
}
participation_scaled_decadence = -10
}
}
}
}
}
}
FROM = { religion_authority = 0.01 }
ROOT = { religion_authority = -0.01 }
}
}
ct_wall_q_5 = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 5 }
upgrades_from = ct_wall_q_4
build_cost = 100
build_time = 365
fort_level = 1
ai_creation_factor = 56


attacker_ai_victory_worth = {
start = {
factor = -1 # always accept
OR = {
}
AND = {
FROM = { religion_group = muslim }
attacker_ai_defeat_worth = {
year = 1350
factor = 100
}
}
AND = {

FROM = { top_liege = { primary_title = { title = e_byzantium } } }
defender_ai_victory_worth = {
year = 1355
factor = -1 # always accept
}
}
AND = {
FROM = { religion_group = christian }
defender_ai_defeat_worth = {
year = 1345
factor = 100
}
}
AND = {
}
FROM = { religion_group = pagan_group }

year = 1450
excommunicated_ruler = {
name = CB_NAME_EXCOMMUNICATED_RULER
war_name = WAR_NAME_EXCOMMUNICATED_RULER
sprite = 11
truce_days = 3650
is_permanent = yes
can_ask_to_join_war = no

can_use = {
FROM = {
excommunicated_for = ROOT
in_revolt = no
NOT = {
any_current_enemy = {
NOT = {
religion_group = ROOT
}
}
}
}
}
Line 2,957: Line 2,729:
}
}


ct_wall_1 = {
is_valid = {
build_cost = 50
FROM = {
excommunicated_for = ROOT
build_time = 365
}
fort_level = 0.4
}
levy_size = 0.025

tax_income = 0.2
on_success = {
ai_creation_factor = 99
ROOT = {
start = {
if = {
OR = {
limit = {
AND = {
FROM = {
primary_title = {
FROM = { religion_group = muslim }
year = 1076
tier = BARON
}
}
}
}
AND = {
ROOT = {
piety = 10
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1066
prestige = 50
}
}
AND = {
}
if = {
FROM = { religion_group = christian }
year = 1066
limit = {
FROM = {
primary_title = {
tier = COUNT
}
}
}
}
AND = {
ROOT = {
piety = 20
FROM = { religion_group = pagan_group }
year = 1100
prestige = 100
}
}
}
}
}
if = {
limit = {
}
ct_wall_2 = {
FROM = {
primary_title = {
upgrades_from = ct_wall_1
build_cost = 50
tier = DUKE
}
build_time = 547
}
fort_level = 0.4
levy_size = 0.025
tax_income = 0.2
ai_creation_factor = 98

start = {
OR = {
AND = {
FROM = { religion_group = muslim }
year = 1080
}
}
AND = {
ROOT = {
piety = 30
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1076
prestige = 150
}
}
AND = {
}
if = {
FROM = { religion_group = christian }
year = 1130
limit = {
FROM = {
primary_title = {
tier = KING
}
}
}
}
AND = {
ROOT = {
piety = 50
FROM = { religion_group = pagan_group }
year = 1170
prestige = 200
}
}
if = {
limit = {
FROM = {
primary_title = {
tier = EMPEROR
}
}
}
ROOT = {
piety = 70
prestige = 400
}
}
}
}
}
}
}
ct_wall_3 = {
upgrades_from = ct_wall_2
build_cost = 100
build_time = 730
fort_level = 0.4
levy_size = 0.05
tax_income = 0.2
ai_creation_factor = 97


start = {
FROM = {
OR = {
excommunicate = no
AND = {
prestige = -200
rightful_religious_head_scope = {
FROM = { religion_group = muslim }
year = 1150
opinion = {
}
who = PREV
modifier = opinion_repented_sins
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1140
}
AND = {
FROM = { religion_group = christian }
year = 1170
}
AND = {
FROM = { religion_group = pagan_group }
year = 1230
}
}
}
}
abdicate = yes
}
}
}
}
ct_wall_4 = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 2 }
upgrades_from = ct_wall_3
build_cost = 100
build_time = 1095
fort_level = 0.5
levy_size = 0.05
tax_income = 0.2
ai_creation_factor = 96


start = {
on_fail = {
OR = {
ROOT = {
AND = {
piety = -50
prestige = -100
FROM = { religion_group = muslim }
}
year = 1220
}
}

AND = {
on_reverse_demand = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1230
ROOT = {
piety = -100
}
AND = {
prestige = -200
transfer_scaled_wealth = {
FROM = { religion_group = christian }
year = 1235
to = FROM
}
value = 4.0
AND = {
FROM = { religion_group = pagan_group }
year = 1290
}
}
}
}
FROM = {
prestige = 200
}
}
}
}
ct_wall_5 = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 4 }
upgrades_from = ct_wall_4
build_cost = 150
build_time = 1460
fort_level = 1.0
levy_size = 0.075
tax_income = 0.5
ai_creation_factor = 95



start = {
attacker_ai_victory_worth = {
OR = {
factor = -1 # always accept
AND = {
}
FROM = { religion_group = muslim }
year = 1325
attacker_ai_defeat_worth = {
}
AND = {
factor = 100
}
FROM = { top_liege = { primary_title = { title = e_byzantium } } }

year = 1345
defender_ai_victory_worth = {
}
factor = -1 # always accept
AND = {
}
FROM = { religion_group = christian }
year = 1340
defender_ai_defeat_worth = {
}
AND = {
factor = 100
}
FROM = { religion_group = pagan_group }
}
year = 1420

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 = {
ROOT = {
de_facto_liege = FROM
}
FROM = {
NOT = {
any_war = {
attacker = {
character = FROM
}
OR = {
using_cb = bid_for_independence
using_cb = depose_liege
}
}
}
}
}
}
}
}
}
ct_training_grounds_1 = {
build_cost = 150
build_time = 547
levy_size = 0.05
garrison_size = 0.05
ai_creation_factor = 98


start = {
is_valid = {
ROOT = {
OR = {
OR = {
AND = {
liege = {
character = PREV # either independent
FROM = { religion_group = muslim }
year = 1085
}
}
AND = {
liege = {
FROM = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
is_liege_or_above = PREV # or have shared liege
year = 1066
}
}
AND = {
FROM = { religion_group = christian }
year = 1095
}
AND = {
FROM = { religion_group = pagan_group }
year = 1066
}
}
}
}
}
FROM = {
higher_tier_than = ROOT
}
}
}
}
ct_training_grounds_2 = {
prerequisites = { ct_wall_1 }
upgrades_from = ct_training_grounds_1
build_cost = 200
build_time = 730
levy_size = 0.075
garrison_size = 0.1
ai_creation_factor = 97


start = {
on_success = {
OR = {
if = {
AND = {
limit = {
FROM = { religion_group = muslim }
FROM = {
year = 1112
independent = no
}
}
AND = {
}
FROM = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1097
liege = {
}
ROOT = {
AND = {
set_defacto_liege = PREV
}
FROM = { religion_group = christian }
year = 1118
}
AND = {
FROM = { religion_group = pagan_group }
year = 1145
}
}
}
}
}
}
}
ct_training_grounds_3 = {
upgrades_from = ct_training_grounds_2
build_cost = 300
build_time = 1095
levy_size = 0.1
garrison_size = 0.15
ai_creation_factor = 96


start = {
if = {
OR = {
limit = {
AND = {
FROM = {
independent = yes
FROM = { religion_group = muslim }
year = 1155
}
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1176
}
AND = {
FROM = { religion_group = christian }
year = 1188
}
AND = {
FROM = { religion_group = pagan_group }
year = 1228
}
}
}
ROOT = {
set_defacto_liege = ROOT
}
}
}
}
}
ct_training_grounds_4 = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 1 }
upgrades_from = ct_training_grounds_3
build_cost = 400
build_time = 1460
levy_size = 0.125
garrison_size = 0.2
ai_creation_factor = 95


start = {
hidden_tooltip = {
OR = {
ROOT = {
AND = {
prestige = 100
any_demesne_title = {
FROM = { religion_group = muslim }
year = 1212
add_pressed_claim = FROM
}
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1218
}
AND = {
FROM = { religion_group = christian }
year = 1208
}
AND = {
FROM = { religion_group = pagan_group }
year = 1430
}
}
}
}
}
}
}
any_attacker = {
ct_training_grounds_5 = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 3 }
limit = { character = ROOT }
participation_scaled_prestige = 100
upgrades_from = ct_training_grounds_4
}
build_cost = 500
build_time = 2190
any_attacker = {
limit = { NOT = { character = ROOT } }
levy_size = 0.15
hidden_tooltip = { participation_scaled_prestige = 100 }
garrison_size = 0.25
}
ai_creation_factor = 94


start = {
FROM = {
any_demesne_title = { # All titles
OR = {
AND = {
limit = {
FROM = { religion_group = muslim }
OR = {
year = 1398
tier = king
tier = emperor
}
# is_titular = no
NOT = { has_law = centralization_0 }
}
}
AND = {
if = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
limit = { has_law = centralization_1 }
year = 1410
add_law = centralization_0
}
}
AND = {
if = {
FROM = { religion_group = christian }
limit = { has_law = centralization_2 }
year = 1393
add_law = centralization_1
}
}
AND = {
if = {
FROM = { religion_group = pagan_group }
limit = { has_law = centralization_3 }
year = 1440
add_law = centralization_2
}
if = {
limit = { has_law = centralization_4 }
add_law = centralization_3
}
}
}
}
}
}
}
}
ct_training_grounds_6 = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 5 }
upgrades_from = ct_training_grounds_5
build_cost = 500
build_time = 2190
levy_size = 0.15
garrison_size = 0.25
ai_creation_factor = 93


start = {
on_fail = {
OR = {
ROOT = {
AND = {
prestige = -50
}
FROM = { religion_group = muslim }
year = 1418
any_attacker = {
limit = { character = ROOT }
}
participation_scaled_prestige = -50
AND = {
}
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1447
any_attacker = {
limit = { NOT = { character = ROOT } }
}
hidden_tooltip = { participation_scaled_prestige = -50 }
AND = {
}
FROM = { religion_group = christian }
}
year = 1418

}
on_reverse_demand = {
AND = {
ROOT = {
FROM = { religion_group = pagan_group }
year = 1508
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
}

attacker_ai_victory_worth = {
factor = -1 # always accept
}
}
attacker_ai_defeat_worth = {
ct_barracks_1 = {
build_cost = 100
factor = 150
}
build_time = 365

light_infantry = 60
defender_ai_victory_worth = {
archers = 30
factor = -1 # always accept
ai_creation_factor = 95
}
defender_ai_defeat_worth = {
factor = 100
}
}

depose_liege = {
name = CB_NAME_DEPOSE_LIEGE
war_name = WAR_NAME_DEPOSE_LIEGE
sprite = 12
truce_days = 3650
is_permanent = yes
can_call_vassals = yes

can_use = {
ROOT = {
de_facto_liege = FROM
}
# cannot depose
start = {
OR = {
FROM = {
AND = {
in_revolt = no
liege = {
FROM = { religion_group = muslim }
year = 1076
in_revolt = no
liege = {
in_revolt = no
}
}
AND = {
}
NOT = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1066
any_war = {
}
OR = {
AND = { # Cannot depose liege when our liege is currently involved in such a war
AND = {
attacker = {
FROM = { religion_group = christian }
year = 1095
character = FROM
}
}
AND = {
OR = {
using_cb = bid_for_independence
FROM = { religion_group = pagan_group }
year = 1066
using_cb = depose_liege
}
}
AND = { # Cannot depose liege if someone else is already deposing liege
defender = {
character = FROM
}
using_cb = depose_liege
}
}
}
}
}
}
}
}
}
}
ct_barracks_2 = {
prerequisites = { ct_wall_1 }
upgrades_from = ct_barracks_1
build_cost = 120
build_time = 547
light_infantry = 40
archers = 70
ai_creation_factor = 94


start = {
is_valid = {
ROOT = {
OR = {
OR = {
AND = {
liege = {
character = PREV # either independent
FROM = { religion_group = muslim }
year = 1105
}
}
AND = {
liege = {
FROM = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
is_liege_or_above = PREV # or have shared liege
year = 1090
}
}
AND = {
FROM = { religion_group = christian }
year = 1110
}
AND = {
FROM = { religion_group = pagan_group }
year = 1135
}
}
}
}
}
FROM = {
higher_tier_than = ROOT
}
}
}
}
ct_barracks_3 = {
prerequisites = { ct_wall_2 }
upgrades_from = ct_barracks_2
build_cost = 200
build_time = 730
light_infantry = 80
archers = 50
ai_creation_factor = 93


start = {
on_success = {
OR = {
FROM = {
AND = {
prestige = -500
any_demesne_title = { # All titles
FROM = { religion_group = muslim }
year = 1145
limit = {
OR = {
tier = king
tier = emperor
}
# is_titular = no
NOT = { has_law = centralization_0 }
}
}
AND = {
if = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
limit = { has_law = centralization_1 }
year = 1170
add_law = centralization_0
}
}
AND = {
if = {
FROM = { religion_group = christian }
limit = { has_law = centralization_2 }
year = 1180
add_law = centralization_1
}
}
AND = {
if = {
FROM = { religion_group = pagan_group }
limit = { has_law = centralization_3 }
year = 1220
add_law = centralization_2
}
if = {
limit = { has_law = centralization_4 }
add_law = centralization_3
}
}
}
}

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 }
}
}
}
}
ct_barracks_4 = {
trigger = { TECH_CITY_CONSTRUCTION = 1 }
upgrades_from = ct_barracks_3
build_cost = 300
build_time = 1095
light_infantry = 60
archers = 90
ai_creation_factor = 92


start = {
on_fail = {
ROOT = {
prestige = -100
}
}

on_reverse_demand = {
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 = 150
}

defender_ai_victory_worth = {
factor = -1 # always accept
}
defender_ai_defeat_worth = {
factor = 100
}
}

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_use = {
ROOT = {
de_facto_liege = FROM
}
}

is_valid = {
ROOT = {
OR = {
OR = {
AND = {
liege = {
character = PREV # either independent
FROM = { religion_group = muslim }
year = 1205
}
}
AND = {
liege = {
FROM = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
is_liege_or_above = PREV # or have shared liege
year = 1210
}
}
AND = {
FROM = { religion_group = christian }
year = 1200
}
AND = {
FROM = { religion_group = pagan_group }
year = 1420
}
}
}
}
}
FROM = {
higher_tier_than = ROOT
}
}
}
}
ct_barracks_5 = {
trigger = { TECH_CITY_CONSTRUCTION = 3 }
upgrades_from = ct_barracks_4
build_cost = 400
build_time = 2190
light_infantry = 100
archers = 70
ai_creation_factor = 91


start = {
on_success = {
OR = {
ROOT = {
AND = {
primary_title = {
add_pressed_claim = FROM
FROM = { religion_group = muslim }
}
year = 1390
}
FROM = {
prestige = -500
remove_opinion = {
who = ROOT
modifier = declared_war
}
any_demesne_title = { # All titles
limit = {
OR = {
tier = king
tier = emperor
}
# is_titular = no
NOT = { has_law = centralization_0 }
}
}
AND = {
if = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
limit = { has_law = centralization_1 }
year = 1400
add_law = centralization_0
}
}
AND = {
if = {
FROM = { religion_group = christian }
limit = { has_law = centralization_2 }
year = 1385
add_law = centralization_0
}
}
AND = {
if = {
FROM = { religion_group = pagan_group }
limit = { has_law = centralization_3 }
year = 1430
add_law = centralization_1
}
if = {
limit = { has_law = centralization_4 }
add_law = centralization_2
}
}
}
}
abdicate = yes
}
any_attacker = {
limit = { character = ROOT }
participation_scaled_prestige = 250
}
any_attacker = {
limit = { NOT = { character = ROOT } }
hidden_tooltip = { participation_scaled_prestige = 250 }
}
}
}
}
ct_barracks_6 = {
trigger = { TECH_CITY_CONSTRUCTION = 5 }
upgrades_from = ct_barracks_5
build_cost = 500
build_time = 2190
light_infantry = 80
archers = 110
ai_creation_factor = 90


start = {
on_fail = {
OR = {
ROOT = {
AND = {
prestige = -100
}
FROM = { religion_group = muslim }
year = 1410
FROM = {
remove_opinion = {
}
AND = {
who = ROOT
modifier = declared_war
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1438
}
AND = {
FROM = { religion_group = christian }
year = 1410
}
AND = {
FROM = { religion_group = pagan_group }
year = 1500
}
}
}
}
}
}

on_reverse_demand = {
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 = {
ct_guard_1 = {
build_cost = 100
factor = 150
}
build_time = 365

pikemen = 45
defender_ai_victory_worth = {
ai_creation_factor = 96
factor = -1 # always accept
}
start = {
defender_ai_defeat_worth = {
factor = 100
}
}

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 = {
ROOT = {
de_facto_liege = FROM
}
}

is_valid = {
ROOT = {
OR = {
OR = {
AND = {
liege = {
character = PREV # either independent
FROM = { religion_group = muslim }
year = 1075
}
}
AND = {
liege = {
FROM = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
is_liege_or_above = PREV # or have shared liege
year = 1066
}
}
AND = {
FROM = { religion_group = christian }
year = 1095
}
AND = {
FROM = { religion_group = pagan_group }
year = 1066
}
}
}
}
}
FROM = {
higher_tier_than = ROOT
}
}
}
}
ct_guard_2 = {
prerequisites = { ct_wall_1 }
upgrades_from = ct_guard_1
build_cost = 120
build_time = 547
pikemen = 55
ai_creation_factor = 95


start = {
on_success = {
OR = {
ROOT = {
AND = {
prestige = 200
primary_title = {
FROM = { religion_group = muslim }
year = 1110
add_pressed_claim = FROM
}
}
FROM = {
prestige = -500
remove_opinion = {
who = ROOT
modifier = declared_war
}
any_demesne_title = { # All titles
limit = {
OR = {
tier = king
tier = emperor
}
# is_titular = no
NOT = { has_law = centralization_0 }
}
}
AND = {
if = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
limit = { has_law = centralization_1 }
year = 1095
add_law = centralization_0
}
}
AND = {
if = {
FROM = { religion_group = christian }
limit = { has_law = centralization_2 }
year = 1115
add_law = centralization_0
}
}
AND = {
if = {
FROM = { religion_group = pagan_group }
limit = { has_law = centralization_3 }
year = 1140
add_law = centralization_1
}
if = {
limit = { has_law = centralization_4 }
add_law = centralization_2
}
}
}
}
abdicate = yes
}
}
}
}

ct_guard_3 = {
on_fail = {
prerequisites = { ct_wall_2 }
ROOT = {
upgrades_from = ct_guard_2
build_cost = 200
prestige = -100
}
build_time = 730
pikemen = 65
ai_creation_factor = 94
start = {
FROM = {
OR = {
prestige = -100
AND = {
remove_opinion = {
who = ROOT
FROM = { religion_group = muslim }
year = 1150
modifier = declared_war
}
}
}

on_reverse_demand = {
ROOT = {
prestige = -200
prisoner = FROM
}
FROM = {
prestige = 50
}
}

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
}
}


succession_on_liege = {
name = CB_NAME_SUCCESSION
war_name = WAR_NAME_SUCCESSION
sprite = 13
truce_days = 3650
hostile_against_others = yes
press_claim = yes
can_call_vassals = yes

allow_whitepeace = no

is_valid_title = {
FROM = {
has_landed_title = PREV
}
}
on_success = {
FROM = {
prestige = -100
any_demesne_title = {
limit = {
tier = FROM
}
}
usurp_title_plus_barony_if_unlanded = ROOT
AND = {
}
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
}
year = 1175
any_attacker = {
limit = { character = ROOT }
participation_scaled_prestige = 200
}
any_attacker = {
limit = { NOT = { character = ROOT } }
hidden_tooltip = { participation_scaled_prestige = 200 }
}
}
on_success_title = {
if = {
limit = {
OR = {
tier = king
tier = emperor
}
}
AND = {
# is_titular = no
FROM = { religion_group = christian }
NOT = { has_law = centralization_0 }
}
year = 1185
}
if = {
limit = { has_law = centralization_1 }
AND = {
add_law = centralization_0
FROM = { religion_group = pagan_group }
}
year = 1225
if = {
limit = { has_law = centralization_2 }
add_law = centralization_1
}
if = {
limit = { has_law = centralization_3 }
add_law = centralization_2
}
if = {
limit = { has_law = centralization_4 }
add_law = centralization_3
}
}
}
on_fail = {
ROOT = {
prestige = -50
}
FROM = {
prestige = 50
}
}

on_reverse_demand = {
ROOT = {
imprison = FROM
}
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 = {
ROOT = {
remove_claim = PREV
}
}
on_attacker_leader_death = {
hidden_tooltip = {
any_defender = {
letter_event = {
id = 251
}
}
}
}
}
}
end_war = invalid
}
}

ct_guard_4 = {
attacker_ai_victory_worth = {
trigger = { TECH_CITY_CONSTRUCTION = 2 }
factor = -1 # always accept
upgrades_from = ct_guard_3
}
build_cost = 300
build_time = 1095
attacker_ai_defeat_worth = {
pikemen = 75
factor = 150
ai_creation_factor = 93
}

start = {
defender_ai_victory_worth = {
OR = {
factor = -1 # always accept
AND = {
}
FROM = { religion_group = muslim }
year = 1210
defender_ai_defeat_worth = {
}
AND = {
factor = 100
}
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
}
year = 1215

}

AND = {
other_succession = {
FROM = { religion_group = christian }
name = CB_NAME_SUCCESSION
year = 1205
war_name = WAR_NAME_OTHER_SUCCESSION
}
AND = {
sprite = 14
truce_days = 3650
FROM = { religion_group = pagan_group }
hostile_against_others = yes
year = 1425
press_claim = yes
can_call_vassals = yes

allow_whitepeace = no

can_use_title = {
OR = {
ROOT = { is_female = no }
NOT = { has_law = agnatic_succession }
AND = {
lower_tier_than = KING
is_primary_holder_title = no
}
}
}

is_valid_title = {

FROM = {
has_landed_title = PREV
}
}

on_success = {
ROOT = {
opinion = {
modifier = pressed_my_claim
who = PREV
}
}
prestige = 50
any_attacker = {
limit = { character = ROOT }
participation_scaled_prestige = 100
}
any_attacker = {
limit = { NOT = { character = ROOT } }
hidden_tooltip = { participation_scaled_prestige = 100 }
}
}

on_success_title = {
usurp_title_plus_barony_if_unlanded = ROOT
if = {
limit = {
OR = {
tier = king
tier = emperor
}
}
# is_titular = no
NOT = { has_law = centralization_0 }
}
if = {
limit = { has_law = centralization_1 }
add_law = centralization_0
}
if = {
limit = { has_law = centralization_2 }
add_law = centralization_1
}
if = {
limit = { has_law = centralization_3 }
add_law = centralization_2
}
if = {
limit = { has_law = centralization_4 }
add_law = centralization_3
}
}
}
}
}
}
ct_guard_5 = {
trigger = { TECH_CITY_CONSTRUCTION = 4 }
upgrades_from = ct_guard_4
build_cost = 400
build_time = 2190
pikemen = 85
ai_creation_factor = 92


on_success_posttitle = {
start = {
OR = {
hidden_tooltip = {
AND = {
if = {
FROM = { religion_group = muslim }
limit = {
year = 1395
top_liege = {
ROOT = {
NOT = {
top_liege = {
character = PREVPREV
}
}
}
}
}
}

AND = {
ROOT = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1405
set_defacto_liege = PREV
}
}
AND = {
}

FROM = { religion_group = christian }
year = 1390
if = {
limit = {
top_liege = {
ROOT = {
NOT = {
top_liege = {
character = PREVPREV
}
}
}
}
}
}

AND = {
ROOT = {
FROM = { religion_group = pagan_group }
year = 1435
set_defacto_liege = ROOT
}
}
}
}
Line 3,610: Line 3,670:
}
}
ct_marketplace_1 = {
on_fail = {
build_cost = 100
prestige = -50
build_time = 365
FROM = {
tax_income = 2.5
prestige = 50
}
ai_creation_factor = 110
}

start = {
on_reverse_demand = {
OR = {
AND = {
prestige = -200

FROM = { religion_group = muslim }
year = 1070
ROOT = {
imprison = FROM
}
}
AND = {
any_defender = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
limit = { character = FROM }
year = 1080
participation_scaled_prestige = 100
}
}
AND = {
any_defender = {
FROM = { religion_group = christian }
limit = { NOT = { character = FROM } }
year = 1090
hidden_tooltip = { participation_scaled_prestige = 100 }
}
}
AND = {
}
FROM = { religion_group = pagan_group }

year = 1095
on_reverse_demand_title = {
ROOT = {
remove_claim = PREV
}
}
on_defender_leader_death = {
hidden_tooltip = {
any_attacker = {
letter_event = {
id = 251
}
}
}
}
}
}
end_war = invalid
}
}
ct_marketplace_2 = {
prerequisites = { ct_wall_1 }
upgrades_from = ct_marketplace_1
build_cost = 120
build_time = 547
tax_income = 3
ai_creation_factor = 109


attacker_ai_victory_worth = {
start = {
factor = -1 # always accept
OR = {
}
AND = {
FROM = { religion_group = muslim }
attacker_ai_defeat_worth = {
year = 1100
factor = 100
}
}
AND = {

FROM = { top_liege = { primary_title = { title = e_byzantium } } }
defender_ai_victory_worth = {
year = 1085
factor = -1 # always accept
}
}
AND = {
FROM = { religion_group = christian }
defender_ai_defeat_worth = {
year = 1105
factor = 100
}
}
AND = {
}
FROM = { religion_group = pagan_group }

year = 1130

}
other_succession_on_liege = {
name = CB_NAME_SUCCESSION
war_name = WAR_NAME_OTHER_SUCCESSION
sprite = 15
truce_days = 3650
hostile_against_others = yes
press_claim = yes
can_call_vassals = yes

allow_whitepeace = no

can_use_title = {
OR = {
ROOT = { is_female = no }
NOT = { has_law = agnatic_succession }
AND = {
lower_tier_than = KING
is_primary_holder_title = no
}
}
}
}
}
}
ct_marketplace_3 = {
prerequisites = { ct_wall_2 }
upgrades_from = ct_marketplace_2
build_cost = 200
build_time = 730
tax_income = 3.5
ai_creation_factor = 108


start = {
is_valid_title = {
OR = {
FROM = {
AND = {
has_landed_title = PREV
}
FROM = { religion_group = muslim }
}
year = 1140
on_success = {
ROOT = {
opinion = {
modifier = pressed_my_claim
who = PREV
}
}
# If the claimant has the wrong government type, take care of that first.
if = {
limit = {
FROM = {
primary_title = {
higher_tier_than = ROOT
}
is_feudal = yes
}
}
AND = {
ROOT = {
is_ruler = yes
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1160
OR = {
is_theocracy = yes
is_republic = yes
}
}
}
AND = {
}
FROM = { religion_group = christian }
ROOT = { abdicate = yes }
}
year = 1175
}
AND = {
FROM = {
any_demesne_title = {
FROM = { religion_group = pagan_group }
year = 1200
limit = {
tier = FROM
}
}
usurp_title_plus_barony_if_unlanded = ROOT
}
}
}
any_attacker = {
limit = { character = ROOT }
participation_scaled_prestige = 100
}
any_attacker = {
limit = { NOT = { character = ROOT } }
hidden_tooltip = { participation_scaled_prestige = 100 }
}
}
}
}
ct_marketplace_4 = {
trigger = { TECH_CITY_CONSTRUCTION = 1 }
upgrades_from = ct_marketplace_3
build_cost = 300
build_time = 1095
tax_income = 4
ai_creation_factor = 107


on_success_title = {
start = {
OR = {
if = {
AND = {
limit = {
FROM = { religion_group = muslim }
OR = {
year = 1195
tier = king
}
tier = emperor
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1190
}
AND = {
FROM = { religion_group = christian }
year = 1200
}
AND = {
FROM = { religion_group = pagan_group }
year = 1400
}
}
# is_titular = no
NOT = { has_law = centralization_0 }
}
if = {
limit = { has_law = centralization_1 }
add_law = centralization_0
}
if = {
limit = { has_law = centralization_2 }
add_law = centralization_1
}
if = {
limit = { has_law = centralization_3 }
add_law = centralization_2
}
if = {
limit = { has_law = centralization_4 }
add_law = centralization_3
}
}
}
}
}
}
ct_marketplace_5 = {
trigger = { TECH_CITY_CONSTRUCTION = 3 }
upgrades_from = ct_marketplace_4
build_cost = 400
build_time = 2190
tax_income = 4.5
ai_creation_factor = 106


on_success_posttitle = {
start = {
OR = {
hidden_tooltip = {
AND = {
if = {
FROM = { religion_group = muslim }
limit = {
year = 1380
top_liege = {
ROOT = {
NOT = {
top_liege = {
character = PREVPREV
}
}
}
}
}
}

AND = {
ROOT = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1390
set_defacto_liege = PREV
}
}
AND = {
}

FROM = { religion_group = christian }
year = 1375
if = {
limit = {
top_liege = {
ROOT = {
NOT = {
top_liege = {
character = PREVPREV
}
}
}
}
}
}

AND = {
ROOT = {
FROM = { religion_group = pagan_group }
year = 1425
set_defacto_liege = ROOT
}
}
}
}
}
}
}
}
ct_marketplace_6 = {
on_fail = {
trigger = { TECH_CITY_CONSTRUCTION = 5 }
prestige = -50
upgrades_from = ct_marketplace_5
build_cost = 500
FROM = {
build_time = 2190
prestige = 50
}
tax_income = 5
}
ai_creation_factor = 105


on_reverse_demand = {
start = {
OR = {
prestige = -200
AND = {
imprison = FROM

FROM = { religion_group = muslim }
year = 1400
ROOT = {
imprison = FROM
}
}
AND = {
any_defender = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
limit = { character = FROM }
year = 1433
participation_scaled_prestige = 100
}
}
AND = {
any_defender = {
FROM = { religion_group = christian }
limit = { NOT = { character = FROM } }
year = 1400
hidden_tooltip = { participation_scaled_prestige = 100 }
}
}
AND = {
}
FROM = { religion_group = pagan_group }

year = 1490
on_reverse_demand_title = {
ROOT = {
remove_claim = PREV
}
}
on_defender_leader_death = {
hidden_tooltip = {
any_attacker = {
letter_event = {
id = 251
}
}
}
}
}
}
end_war = invalid
}

attacker_ai_victory_worth = {
factor = -1 # always accept
}
}
attacker_ai_defeat_worth = {
ct_port_1 = {
potential = {
factor = 100
}
port = yes

defender_ai_victory_worth = {
factor = -1 # always accept
}
defender_ai_defeat_worth = {
factor = 100
}
}

dejure_county_claim = {
name = CB_NAME_DEJURECLAIM
war_name = WAR_NAME_DEJURECLAIM
sprite = 16
truce_days = 3650
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

can_use_title = {
tier = count
OR = {
FROM = {
has_landed_title = PREV
}
holder_scope = {
is_liege_or_above = FROM
}
}
}
build_cost = 100
build_time = 365
tax_income = 2.5
galleys = 2
ai_creation_factor = 110
start = {
OR = {
kingdom = {
holder = ROOT
}
empire = {
holder = ROOT
}
dejure_liege_title = {
holder = ROOT
}
}

NOT = {
OR = {
OR = {
AND = {
ROOT = {
has_landed_title = PREV
FROM = { religion_group = muslim }
year = 1076
}
}
AND = {
holder_scope = {
is_liege_or_above = ROOT
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1100
}
AND = {
FROM = { religion_group = christian }
year = 1090
}
AND = {
FROM = { religion_group = pagan_group }
year = 1150
}
}
}
}
}
}
}
}

ct_port_2 = {
potential = {
is_valid_title = {
port = yes
OR = {
FROM = {
has_landed_title = PREV
}
holder_scope = {
is_liege_or_above = FROM
}
}
}
}
prerequisites = { ct_wall_1 }
upgrades_from = ct_port_1
build_cost = 120
build_time = 547
tax_income = 3
galleys = 2
ai_creation_factor = 109


on_success_title = {
start = {
OR = {
if = {
AND = {
limit = {
holder_scope = {
FROM = { religion_group = muslim }
year = 1096
tier = count
NOT = {
num_of_count_titles = 2
}
}
}
AND = {
}

FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1140
holder_scope = {
set_defacto_liege = ROOT
}
}

if = {
limit = {
holder_scope = {
OR = {
higher_tier_than = count
num_of_count_titles = 2
}
}
}
AND = {
}

FROM = { religion_group = christian }
usurp_title_plus_barony_if_unlanded = ROOT
year = 1115
any_de_jure_vassal_title = { # take all baronies under the one we're fighting for
}
AND = {
limit = {
has_holder = yes
FROM = { religion_group = pagan_group }
year = 1200
NOT = {
de_facto_liege = PREV
}
holder_scope = {
OR = {
character = FROM
is_liege_or_above = FROM
}
}
}
}

usurp_title_plus_barony_if_unlanded = ROOT
}
}
}
any_attacker = {
limit = { character = ROOT }
participation_scaled_prestige = 100
}
any_attacker = {
limit = { NOT = { character = ROOT } }
hidden_tooltip = { participation_scaled_prestige = 100 }
}
}
}
}

ct_port_3 = {
potential = {
on_fail_title = {
port = yes
ROOT = {
prestige = -100
}
}
any_defender = {
prerequisites = { ct_wall_2 }
limit = { character = FROM }
upgrades_from = ct_port_2
participation_scaled_prestige = 50
build_cost = 200
}
build_time = 730
tax_income = 3.5
any_defender = {
limit = { NOT = { character = FROM } }
galleys = 2
hidden_tooltip = { participation_scaled_prestige = 50 }
ai_creation_factor = 108
}
}


on_reverse_demand = {
start = {
OR = {
ROOT = {
AND = {
prestige = -200
transfer_scaled_wealth = {
FROM = { religion_group = muslim }
year = 1145
to = FROM
}
value = 4.0
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1210
}
AND = {
FROM = { religion_group = christian }
year = 1180
}
AND = {
FROM = { religion_group = pagan_group }
year = 1230
}
}
}
}
any_defender = {
limit = { character = FROM }
participation_scaled_prestige = 100
}
any_defender = {
limit = { NOT = { character = FROM } }
hidden_tooltip = { participation_scaled_prestige = 100 }
}
}
}
}

ct_port_4 = {
attacker_ai_victory_worth = {
potential = {
factor = -1 # always accept
port = yes
}
attacker_ai_defeat_worth = {
factor = 100
}

defender_ai_victory_worth = {
factor = -1 # always accept
}
defender_ai_defeat_worth = {
factor = 100
}
}

dejure_barony_claim = {
name = CB_NAME_DEJUREBARONYCLAIM
war_name = WAR_NAME_DEJUREBARONYCLAIM
sprite = 16
truce_days = 3650
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

can_use_title = {
tier = baron
dejure_liege_title = {
AND = {
has_holder = yes
ROOT = {
has_landed_title = PREV
}
}
}
}
trigger = { TECH_CITY_CONSTRUCTION = 2 }
upgrades_from = ct_port_3
build_cost = 300
build_time = 1095
tax_income = 4
galleys = 3
ai_creation_factor = 107


start = {
NOT = {
OR = {
OR = {
AND = {
ROOT = {
has_landed_title = PREV
FROM = { religion_group = muslim }
year = 1190
}
}
AND = {
holder_scope = {
is_liege_or_above = ROOT
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1240
}
}
AND = {
}
}
FROM = { religion_group = christian }

year = 1220
}
OR = {
AND = {
FROM = {
has_landed_title = PREV
FROM = { religion_group = pagan_group }
}
year = 1350
holder_scope = {
is_liege_or_above = FROM
}
}

NOT = {
holder_scope = {
liege = {
ROOT = {
liege = {
character = PREVPREV
}
}
}
}
}
}
}
}
}
}

ct_port_5 = {
potential = {
is_valid_title = {
port = yes
OR = {
FROM = {
has_landed_title = PREV
}
holder_scope = {
is_liege_or_above = FROM
}
}
}
}
trigger = { TECH_CITY_CONSTRUCTION = 4 }
upgrades_from = ct_port_4
build_cost = 400
build_time = 2190
tax_income = 4.5
galleys = 3
ai_creation_factor = 106


on_success_title = {
start = {
usurp_title_plus_barony_if_unlanded = ROOT
OR = {
AND = {
any_attacker = {
FROM = { religion_group = muslim }
limit = { character = ROOT }
participation_scaled_prestige = 50
year = 1250
}
}
AND = {
any_attacker = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
limit = { NOT = { character = ROOT } }
hidden_tooltip = { participation_scaled_prestige = 50 }
year = 1340
}
}
}
AND = {

FROM = { religion_group = christian }
on_fail_title = {
year = 1290
ROOT = {
}
AND = {
prestige = -50
}
FROM = { religion_group = pagan_group }
year = 1400
any_defender = {
limit = { character = FROM }
}
participation_scaled_prestige = 25
}
any_defender = {
limit = { NOT = { character = FROM } }
hidden_tooltip = { participation_scaled_prestige = 25 }
}
}

on_reverse_demand = {
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 }
}
}
}
}


attacker_ai_victory_worth = {
ct_university_1 = {
factor = -1 # always accept
trigger = { TECH_CITY_CONSTRUCTION = 1 }
}
build_cost = 600
build_time = 1095
attacker_ai_defeat_worth = {
tech_growth_modifier = 0.2
factor = 100
ai_creation_factor = 107
}


defender_ai_victory_worth = {
start = {
factor = -1 # always accept
OR = {
}
AND = {
FROM = { religion_group = muslim }
defender_ai_defeat_worth = {
year = 1390
factor = 100
}
}
AND = {
}
FROM = { top_liege = { primary_title = { title = e_byzantium } } }

year = 1400
other_dejure_barony_claim = {
}
name = CB_NAME_DEJUREBARONYCLAIM
AND = {
war_name = WAR_NAME_OTHER_DEJUREBARONYCLAIM
FROM = { religion_group = christian }
sprite = 16
year = 1385
truce_days = 3650
}
hostile_against_others = yes
AND = {
is_permanent = yes
FROM = { religion_group = pagan_group }
other_de_jure_claim = yes # Optimization for de jure claims of vassals
year = 1430
press_claim = yes
}
can_ask_to_join_war = no

can_use = {
NOT = {
ROOT = {
character = PREV
}
}
}
}
}
}
ct_university_2 = {
trigger = { TECH_CITY_CONSTRUCTION = 3 }
upgrades_from = ct_university_1
build_cost = 800
build_time = 2190
tech_growth_modifier = 0.3
ai_creation_factor = 106


start = {
can_use_title = {
OR = {
tier = baron

AND = {
dejure_liege_title = {
FROM = { religion_group = muslim }
year = 1440
AND = {
has_holder = yes
}
AND = {
ROOT = {
has_landed_title = PREV
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1450
}
AND = {
FROM = { religion_group = christian }
year = 1435
}
AND = {
FROM = { religion_group = pagan_group }
year = 1480
}
}
}
}
}
}
}
ct_university_3 = {
trigger = { TECH_CITY_CONSTRUCTION = 4 }
upgrades_from = ct_university_2
build_cost = 800
build_time = 2190
tech_growth_modifier = 0.3
ai_creation_factor = 105


start = {
NOT = {
OR = {
OR = {
AND = {
ROOT = {
has_landed_title = PREV
FROM = { religion_group = muslim }
year = 1490
}
}
AND = {
holder_scope = {
is_liege_or_above = ROOT
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1500
}
}
AND = {
}
}
FROM = { religion_group = christian }

year = 1485
}
OR = {
AND = {
FROM = {
has_landed_title = PREV
FROM = { religion_group = pagan_group }
}
year = 1530
holder_scope = {
is_liege_or_above = FROM
}
}

NOT = {
holder_scope = {
liege = {
ROOT = {
liege = {
character = PREVPREV
}
}
}
}
}
}
}
}
}

is_valid_title = {
OR = {
FROM = {
has_landed_title = PREV
}
holder_scope = {
is_liege_or_above = FROM
}
}
}

on_success = {
ROOT = {
opinion = {
modifier = pressed_my_claim
who = PREV
}
}
any_attacker = {
limit = { character = ROOT }
participation_scaled_prestige = 50
}
any_attacker = {
limit = { NOT = { character = ROOT } }
hidden_tooltip = { participation_scaled_prestige = 50 }
}
}

on_success_title = {
usurp_title_plus_barony_if_unlanded = ROOT
}

on_fail = {
prestige = -50
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 = {
prestige = -50
transfer_scaled_wealth = {
to = FROM
value = 4.0
}
ROOT = {
prestige = -50
}
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
}

defender_ai_victory_worth = {
factor = -1 # always accept
}
defender_ai_defeat_worth = {
factor = 100
}
}
}
}




other_dejure_county_claim = {
# Temple
name = CB_NAME_DEJURECLAIM
temple = {
war_name = WAR_NAME_OTHER_DEJURECLAIM
tp_wall_q_1 = {
sprite = 16
prerequisites = { tp_wall_1 }
truce_days = 3650
build_cost = 50
hostile_against_others = yes
build_time = 182
is_permanent = yes
fort_level = 0.5
other_de_jure_claim = yes # Optimization for de jure claims of vassals
ai_creation_factor = 82
press_claim = yes
can_ask_to_join_war = no
start = {

OR = {
AND = {
can_use = {
NOT = {
FROM = { religion_group = muslim }
year = 1076
ROOT = {
character = PREV
}
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1066
}
AND = {
FROM = { religion_group = christian }
year = 1100
}
AND = {
FROM = { religion_group = pagan_group }
year = 1110
}
}
}
}
}
}
}
tp_wall_q_2 = {
prerequisites = { tp_wall_2 }
upgrades_from = tp_wall_q_1
build_cost = 50
build_time = 182
fort_level = 0.5
ai_creation_factor = 81


start = {
can_use_title = {
OR = {
tier = count
AND = {
dejure_liege_title = {
AND = {
FROM = { religion_group = muslim }
year = 1115
has_holder = yes
}
ROOT = {
AND = {
has_landed_title = PREV
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1120
}
AND = {
FROM = { religion_group = christian }
year = 1165
}
AND = {
FROM = { religion_group = pagan_group }
year = 1185
}
}
}
}
}
}
}
tp_wall_q_3 = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 1 }
upgrades_from = tp_wall_q_2
build_cost = 50
build_time = 182
fort_level = 0.5
ai_creation_factor = 80


start = {
NOT = {
OR = {
OR = {
AND = {
ROOT = {
has_landed_title = PREV
FROM = { religion_group = muslim }
year = 1195
}
}
AND = {
holder_scope = {
is_liege_or_above = ROOT
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1185
}
AND = {
FROM = { religion_group = christian }
year = 1210
}
AND = {
FROM = { religion_group = pagan_group }
year = 1250
}
}
}
}

OR = {
FROM = {
has_landed_title = PREV
}
holder_scope = {
is_liege_or_above = FROM
}
}
}
}
}
}
tp_wall_q_4 = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 3 }
upgrades_from = tp_wall_q_3
build_cost = 100
build_time = 365
fort_level = 1
ai_creation_factor = 79


start = {
is_valid_title = {
OR = {
OR = {
AND = {
FROM = {
has_landed_title = PREV
FROM = { religion_group = muslim }
}
year = 1255
holder_scope = {
}
AND = {
is_liege_or_above = FROM
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1265
}
AND = {
FROM = { religion_group = christian }
year = 1260
}
AND = {
FROM = { religion_group = pagan_group }
year = 1300
}
}
}
}
}
}
}
tp_wall_q_5 = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 5 }
upgrades_from = tp_wall_q_4
build_cost = 100
build_time = 365
fort_level = 1
ai_creation_factor = 78


start = {
on_success = {
OR = {
ROOT = {
AND = {
opinion = {
modifier = pressed_my_claim
FROM = { religion_group = muslim }
year = 1380
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 = {
if = {
limit = {
holder_scope = {
tier = count
NOT = {
num_of_count_titles = 2
}
}
}
AND = {
}

FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1370
holder_scope = {
set_defacto_liege = ROOT
}
}

if = {
limit = {
holder_scope = {
OR = {
higher_tier_than = count
num_of_count_titles = 2
}
}
}
AND = {
}

FROM = { religion_group = christian }
usurp_title_plus_barony_if_unlanded = ROOT
year = 1337
any_de_jure_vassal_title = { # take all baronies under the one we're fighting for
}
AND = {
limit = {
has_holder = yes
FROM = { religion_group = pagan_group }
year = 1410
NOT = {
de_facto_liege = PREV
}
holder_scope = {
OR = {
character = FROM
is_liege_or_above = FROM
}
}
}
}

usurp_title_plus_barony_if_unlanded = ROOT
}
}
}
}
}
}


tp_wall_1 = {
on_fail = {
build_cost = 50
prestige = -50
build_time = 365
ROOT = {
fort_level = 0.5
prestige = -100
}
levy_size = 0.025
tax_income = 0.2
any_defender = {
limit = { character = FROM }
ai_creation_factor = 97
participation_scaled_prestige = 50
}
any_defender = {
limit = { NOT = { character = FROM } }
hidden_tooltip = { participation_scaled_prestige = 50 }
}
}


on_reverse_demand = {
start = {
OR = {
prestige = -100
AND = {
transfer_scaled_wealth = {
to = FROM
FROM = { religion_group = muslim }
year = 1076
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 }
}
}

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
}
}


change_gavelkind_succession_law = {
name = CB_NAME_GAVELKIND_SUCCESSION_LAW
war_name = WAR_NAME_GAVELKIND_SUCCESSION_LAW
sprite = 6
truce_days = 3650
can_call_allies = no
can_ask_to_join_war = no
major_revolt = yes
attacker_alliance_occ_warscore = yes # Occupying any holding of any attacker counts towards war score
can_use = {
ROOT = {
vassal_of = FROM
}
}

is_valid_title = {
NOT = {
has_law = succ_gavelkind
}
OR = {
tier = emperor
tier = king
is_primary_holder_title = yes
}
}
on_success = {
FROM = {
hidden_tooltip = { disband_event_forces = faction_loyalists }
any_demesne_title = { # All titles
limit = {
OR = {
tier = king
tier = emperor
}
# is_titular = no
NOT = { has_law = centralization_0 }
}
}
AND = {
if = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
limit = { has_law = centralization_1 }
year = 1066
add_law = centralization_0
}
}
AND = {
if = {
FROM = { religion_group = christian }
limit = { has_law = centralization_2 }
year = 1080
add_law = centralization_1
}
}
AND = {
if = {
FROM = { religion_group = pagan_group }
limit = { has_law = centralization_3 }
year = 1066
add_law = centralization_2
}
if = {
limit = { has_law = centralization_4 }
add_law = centralization_3
}
}
}
}
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
}
}
}
}
}
}
tp_wall_2 = {
upgrades_from = tp_wall_1
build_cost = 50
build_time = 547
fort_level = 0.5
levy_size = 0.025
tax_income = 0.2
ai_creation_factor = 96


on_success_title = {
start = {
succession_w_cooldown = gavelkind
OR = {
}
AND = {

FROM = { religion_group = muslim }
on_fail = {
year = 1090
ROOT = {
}
AND = {
prestige = -100
}
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1066
any_defender = {
limit = { character = FROM }
}
participation_scaled_prestige = 50
AND = {
}
FROM = { religion_group = christian }
year = 1140
any_defender = {
limit = { NOT = { character = FROM } }
}
hidden_tooltip = { participation_scaled_prestige = 50 }
AND = {
}
FROM = { religion_group = pagan_group }
year = 1150
hidden_tooltip = {
any_attacker = {
disband_event_forces = faction_revolters
add_character_modifier = {
name = faction_succ_gavelkind_ultimatum_timer
hidden = yes
duration = 3650
}
}
}
}
}
}
FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } }
}
}
tp_wall_3 = {
upgrades_from = tp_wall_2
build_cost = 100
build_time = 730
fort_level = 1.0
levy_size = 0.05
tax_income = 0.2
ai_creation_factor = 95


on_reverse_demand = {
start = {
OR = {
ROOT = {
AND = {
prestige = -200
prisoner = FROM
FROM = { religion_group = muslim }
}
year = 1160
any_defender = {
}
AND = {
limit = { character = FROM }
participation_scaled_prestige = 100
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
}
year = 1150
any_defender = {
}
limit = { NOT = { character = FROM } }
AND = {
hidden_tooltip = { participation_scaled_prestige = 100 }
FROM = { religion_group = christian }
}
year = 1180
}
AND = {
hidden_tooltip = {
any_attacker = {
FROM = { religion_group = pagan_group }
limit = { liege = { character = FROM } }
year = 1235
prisoner = FROM
disband_event_forces = faction_revolters
add_character_modifier = {
name = faction_succ_gavelkind_ultimatum_timer
hidden = yes
duration = 3650
}
}
}
}
}
}
FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } }
}
}
tp_wall_4 = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 2 }
upgrades_from = tp_wall_3
build_cost = 100
build_time = 1095
fort_level = 1.0
levy_size = 0.05
tax_income = 0.2
ai_creation_factor = 94


attacker_ai_victory_worth = {
start = {
factor = -1 # always accept
OR = {
}
AND = {
FROM = { religion_group = muslim }
attacker_ai_defeat_worth = {
year = 1230
factor = 100
}
}
AND = {

FROM = { top_liege = { primary_title = { title = e_byzantium } } }
defender_ai_victory_worth = {
year = 1240
factor = -1 # always accept
}
}
AND = {
FROM = { religion_group = christian }
defender_ai_defeat_worth = {
year = 1255
factor = 100
}
}
AND = {
}
FROM = { religion_group = pagan_group }

year = 1280
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
attacker_alliance_occ_warscore = yes # Occupying any holding of any attacker counts towards war score
can_use = {
ROOT = {
vassal_of = FROM
}
}
can_use_title = {
holder_scope = { independent = yes }
OR = {
tier = king
tier = emperor
}
OR = {
has_law = centralization_1
has_law = centralization_2
has_law = centralization_3
has_law = centralization_4
}
}

on_success = {
ROOT = {
opinion = {
modifier = opinion_lowered_crown_authority
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 } }
}
}
tp_wall_5 = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 4 }
upgrades_from = tp_wall_4
build_cost = 150
build_time = 1460
fort_level = 1.5
levy_size = 0.075
tax_income = 0.5
ai_creation_factor = 93


on_success_title = {
start = {
OR = {
if = {
limit = { has_law = centralization_1 }
AND = {
add_law_w_cooldown = centralization_0
FROM = { religion_group = muslim }
}
year = 1340
}
if = {
limit = { has_law = centralization_2 }
AND = {
add_law_w_cooldown = centralization_1
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
}
year = 1350
if = {
limit = { has_law = centralization_3 }
add_law_w_cooldown = centralization_2
}
if = {
limit = { has_law = centralization_4 }
add_law_w_cooldown = centralization_3
}
}

on_fail = {
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_lower_CA_ultimatum_timer
hidden = yes
duration = 3650
}
}
AND = {
}
}
FROM = { religion_group = christian }
FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } }
year = 1330
}
}

AND = {
on_reverse_demand = {
FROM = { religion_group = pagan_group }
year = 1400
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_lower_CA_ultimatum_timer
hidden = yes
duration = 3650
}
}
}
}
}
}
FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } }
}
}


attacker_ai_victory_worth = {
tp_monastery_1 = {
factor = -1 # always accept
build_cost = 150
}
build_time = 547
levy_size = 0.05
attacker_ai_defeat_worth = {
garrison_size = 0.05
factor = 100
ai_creation_factor = 96
}


defender_ai_victory_worth = {
start = {
factor = -1 # always accept
OR = {
}
AND = {
FROM = { religion_group = muslim }
defender_ai_defeat_worth = {
year = 1070
factor = 100
}
}
AND = {
}
FROM = { top_liege = { primary_title = { title = e_byzantium } } }

year = 1075

}
coastal_republic = {
AND = {
name = CB_NAME_COASTAL_REPUBLIC
FROM = { religion_group = christian }
war_name = WAR_NAME_COASTAL_REPUBLIC
year = 1080
sprite = 1
}
truce_days = 3650
AND = {
is_permanent = yes
FROM = { religion_group = pagan_group }
check_all_titles = yes
year = 1066
can_ask_to_join_war = no
}

can_use = {
ROOT = {
is_republic = yes
capital_scope = {
port = yes
}
}
}
}
}
}
tp_monastery_2 = {
prerequisites = { tp_wall_1 }
upgrades_from = tp_monastery_1
build_cost = 200
build_time = 730
levy_size = 0.075
garrison_size = 0.1
ai_creation_factor = 95


start = {
can_use_title = {
OR = {
tier = COUNT
AND = {
location = {
port = yes
FROM = { religion_group = muslim }
}
year = 1130
}
}

AND = {
is_valid = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1115
ROOT = {
is_republic = yes
}
AND = {
capital_scope = {
port = yes
FROM = { religion_group = christian }
year = 1135
}
AND = {
FROM = { religion_group = pagan_group }
year = 1160
}
}
}
}
}
}
}
tp_monastery_3 = {
upgrades_from = tp_monastery_2
build_cost = 300
build_time = 1095
levy_size = 0.1
garrison_size = 0.15
ai_creation_factor = 94


start = {
is_valid_title = {
OR = {
tier = COUNT
AND = {
location = {
port = yes
FROM = { religion_group = muslim }
}
year = 1180
}
}

AND = {
on_success_title = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
any_de_jure_vassal_title = {
year = 1190
}
limit = {
AND = {
holding_type = CITY
FROM = { religion_group = christian }
year = 1185
}
AND = {
FROM = { religion_group = pagan_group }
year = 1280
}
}
}
usurp_title = ROOT
}
}
usurp_title = ROOT
}
tp_monastery_4 = {
any_attacker = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 1 }
limit = { character = ROOT }
participation_scaled_prestige = 100
upgrades_from = tp_monastery_3
}
build_cost = 400
build_time = 1460
any_attacker = {
limit = { NOT = { character = ROOT } }
levy_size = 0.125
hidden_tooltip = { participation_scaled_prestige = 100 }
garrison_size = 0.2
}
ai_creation_factor = 93
}


start = {
on_fail = {
OR = {
ROOT = {
AND = {
prestige = -100
}
FROM = { religion_group = muslim }
year = 1250
any_defender = {
limit = { character = FROM }
}
participation_scaled_prestige = 50
AND = {
}
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1280
any_defender = {
limit = { NOT = { character = FROM } }
}
hidden_tooltip = { participation_scaled_prestige = 50 }
AND = {
}
FROM = { religion_group = christian }
}
year = 1290

}
on_reverse_demand = {
AND = {
ROOT = {
FROM = { religion_group = pagan_group }
year = 1400
prestige = -200
transfer_scaled_wealth = {
}
to = FROM
value = 4.0
}
}
}
}
any_defender = {
}
limit = { character = FROM }
tp_monastery_5 = {
participation_scaled_prestige = 100
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 3 }
}
upgrades_from = tp_monastery_4
build_cost = 500
any_defender = {
limit = { NOT = { character = FROM } }
build_time = 2190
hidden_tooltip = { participation_scaled_prestige = 100 }
levy_size = 0.15
}
garrison_size = 0.25
}
ai_creation_factor = 92


attacker_ai_victory_worth = {
start = {
factor = -1 # always accept
OR = {
}
AND = {
FROM = { religion_group = muslim }
attacker_ai_defeat_worth = {
year = 1430
factor = 100
}
}
AND = {

FROM = { top_liege = { primary_title = { title = e_byzantium } } }
defender_ai_victory_worth = {
year = 1463
factor = -1 # always accept
}
}
AND = {
FROM = { religion_group = christian }
defender_ai_defeat_worth = {
year = 1425
factor = 100
}
}
AND = {
}
FROM = { religion_group = pagan_group }

year = 1600

}
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
can_call_allies = no
can_ask_to_join_war = no

can_use_title = {
OR = {
FROM = {
has_landed_title = PREV
}
holder_scope = {
is_liege_or_above = FROM
}
}
}
}
}
}
tp_monastery_6 = {
trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 5 }
upgrades_from = tp_monastery_5
build_cost = 500
build_time = 2190
levy_size = 0.15
garrison_size = 0.25
ai_creation_factor = 91


start = {
is_valid_title = {
OR = {
OR = {
AND = {
FROM = {
has_landed_title = PREV
FROM = { religion_group = muslim }
}
year = 1500
holder_scope = {
is_liege_or_above = FROM
}
}
}

on_success = {
any_attacker = {
participation_scaled_prestige = 100
}
FROM = {
any_demesne_title = { # All titles
limit = {
OR = {
tier = king
tier = emperor
}
# is_titular = no
NOT = { has_law = centralization_0 }
}
}
AND = {
if = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
limit = { has_law = centralization_1 }
year = 1500
add_law = centralization_0
}
}
AND = {
if = {
FROM = { religion_group = christian }
limit = { has_law = centralization_2 }
year = 1500
add_law = centralization_1
}
}
AND = {
if = {
FROM = { religion_group = pagan_group }
limit = { has_law = centralization_3 }
year = 1500
add_law = centralization_2
}
if = {
limit = { has_law = centralization_4 }
add_law = centralization_3
}
}
}
}
Line 4,513: Line 5,021:
}
}
tp_barracks_1 = {
on_success_title = {
build_cost = 100
FROM = {
build_time = 365
random_vassal = {
light_infantry = 60
limit = {
archers = 30
tier = count
any_demesne_title = {
ai_creation_factor = 94
tier = count

start = {
dejure_liege_title = {
OR = {
ROOT = {
AND = {
plot_target_title = {
title = PREVPREV
FROM = { religion_group = muslim }
year = 1095
}
}
}
AND = {
}
}
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1093
}
AND = {
FROM = { religion_group = christian }
year = 1110
}
AND = {
FROM = { religion_group = pagan_group }
year = 1066
}
}
grant_title = PREVPREV
}
}
}
}
}
}
tp_barracks_2 = {
prerequisites = { tp_wall_1 }
upgrades_from = tp_barracks_1
build_cost = 120
build_time = 547
light_infantry = 65
archers = 45
ai_creation_factor = 93


start = {
on_fail = {
OR = {
ROOT = {
AND = {
prestige = -100
}
FROM = { religion_group = muslim }
year = 1135
any_defender = {
limit = { character = FROM }
}
participation_scaled_prestige = 50
AND = {
}
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1120
any_defender = {
limit = { NOT = { character = FROM } }
}
hidden_tooltip = { participation_scaled_prestige = 50 }
AND = {
}
FROM = { religion_group = christian }
}
year = 1140

}
on_reverse_demand = {
AND = {
ROOT = {
FROM = { religion_group = pagan_group }
year = 1165
prestige = -200
imprison = FROM
}
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
}
attacker_ai_victory_worth = {
factor = -1 # always accept
}
attacker_ai_defeat_worth = {
factor = 100
}
}
tp_barracks_3 = {
prerequisites = { tp_wall_2 }
upgrades_from = tp_barracks_2
build_cost = 200
build_time = 730
light_infantry = 70
archers = 60
ai_creation_factor = 92


defender_ai_victory_worth = {
start = {
factor = -1 # always accept
}
defender_ai_defeat_worth = {
factor = 100
}
}

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
can_use = {
ROOT = {
NOT = { is_liege_or_above = FROM }
}
}

can_use_title = {
tier = count
OR = {
FROM = {
has_landed_title = PREV
}
holder_scope = {
is_liege_or_above = FROM
NOT = { same_realm = ROOT }
}
}
ROOT = {
NOT = { religion_group = christian }
piety = 50
}

NOT = {
OR = {
OR = {
AND = {
ROOT = {
has_landed_title = PREV
FROM = { religion_group = muslim }
year = 1190
}
}
AND = {
holder_scope = {
is_liege_or_above = ROOT
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1200
}
}
AND = {
}
}
FROM = { religion_group = christian }
year = 1195
location = {
}
AND = {
any_neighbor_province = {
owner = {
FROM = { religion_group = pagan_group }
year = 1300
OR = {
character = ROOT
is_liege_or_above = ROOT
}
}
}
}
}
}
}
}
}
tp_barracks_4 = {
trigger = { TECH_TEMPLE_CONSTRUCTION = 1 }
upgrades_from = tp_barracks_3
build_cost = 300
build_time = 1095
light_infantry = 75
archers = 75
ai_creation_factor = 91


start = {
is_valid_title = {
OR = {
OR = {
AND = {
FROM = {
has_landed_title = PREV
FROM = { religion_group = muslim }
}
year = 1260
holder_scope = {
}
AND = {
is_liege_or_above = FROM
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1290
}
AND = {
FROM = { religion_group = christian }
year = 1300
}
AND = {
FROM = { religion_group = pagan_group }
year = 1410
}
}
}
}
}
}
}
tp_barracks_5 = {
trigger = { TECH_TEMPLE_CONSTRUCTION = 3 }
upgrades_from = tp_barracks_4
build_cost = 400
build_time = 2190
light_infantry = 85
archers = 85
ai_creation_factor = 90


on_success_title = {
start = {
OR = {
if = {
AND = {
limit = {
holder_scope = {
FROM = { religion_group = muslim }
year = 1440
tier = count
NOT = { num_of_count_titles = 2 }
lower_tier_than = ROOT
}
}
AND = {
}

FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1473
holder_scope = {
set_defacto_liege = ROOT
}
}

if = {
limit = {
holder_scope = {
OR = {
higher_tier_than = count
num_of_count_titles = 2
NOT = { lower_tier_than = ROOT }
}
}
}
AND = {
}

FROM = { religion_group = christian }
usurp_title_plus_barony_if_unlanded = ROOT
year = 1435
any_de_jure_vassal_title = { # take all baronies under the one we're fighting for
}
AND = {
limit = {
has_holder = yes
FROM = { religion_group = pagan_group }
year = 1700
NOT = {
de_facto_liege = PREV
}
holder_scope = {
OR = {
character = FROM
is_liege_or_above = FROM
}
}
}
}

usurp_title_plus_barony_if_unlanded = ROOT
}
}
}
any_attacker = {
limit = { character = ROOT }
participation_scaled_prestige = 100
}
any_attacker = {
limit = { NOT = { character = ROOT } }
hidden_tooltip = { participation_scaled_prestige = 100 }
}
}
}
}
tp_barracks_6 = {
trigger = { TECH_TEMPLE_CONSTRUCTION = 5 }
upgrades_from = tp_barracks_5
build_cost = 500
build_time = 2190
light_infantry = 95
archers = 95
ai_creation_factor = 89


start = {
on_fail_title = {
OR = {
ROOT = {
AND = {
prestige = -100
}
FROM = { religion_group = muslim }
year = 1450
any_defender = {
limit = { character = FROM }
}
participation_scaled_prestige = 50
AND = {
}
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1483
any_defender = {
limit = { NOT = { character = FROM } }
}
hidden_tooltip = { participation_scaled_prestige = 50 }
AND = {
}
FROM = { religion_group = christian }
}
year = 1445

}
on_reverse_demand = {
AND = {
ROOT = {
FROM = { religion_group = pagan_group }
year = 1710
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 }
}
}
}
}
tp_elite_barracks_1 = {
on_add = {
ROOT = { piety = -50 }
build_cost = 100
}
build_time = 365
heavy_infantry = 45
ai_creation_factor = 95


attacker_ai_victory_worth = {
start = {
factor = -1 # always accept
OR = {
}
AND = {
FROM = { religion_group = muslim }
attacker_ai_defeat_worth = {
year = 1100
factor = 100
}

defender_ai_victory_worth = {
factor = -1 # always accept
}
defender_ai_defeat_worth = {
factor = 100
}
}

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 = {
ROOT = { has_character_flag = decadence_invader }
}

on_success = {
FROM = {
any_demesne_title = { # All titles
limit = {
OR = {
tier = king
tier = emperor
}
NOT = { has_law = centralization_0 }
}
}
AND = {
if = {
add_law = centralization_0
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1103
}
}
AND = {
}
}
FROM = { religion_group = christian }
year = 1120
ROOT = {
}
AND = {
prestige = 200
piety = 100
FROM = { religion_group = pagan_group }
occupy_minors_of_occupied_settlements = FROM
year = 1066
gain_all_occupied_titles = FROM
give_nickname = nick_the_conqueror
}
any_attacker = {
limit = { character = ROOT }
participation_scaled_prestige = 200
participation_scaled_piety = 100
}
any_attacker = {
limit = { NOT = { character = ROOT } }
hidden_tooltip = {
participation_scaled_prestige = 200
participation_scaled_piety = 100
}
}
FROM = {
prestige = -200
primary_title = {
holder_scope = {
any_demesne_title = {
limit = {
tier = PREVPREV
}
usurp_title_plus_barony_if_unlanded = ROOT
if = {
limit = {
higher_tier_than = BARON
NOT = { culture = ROOT }
}
hidden_tooltip = { conquest_culture = ROOT }
}
}
}
}
}
}
set_defacto_liege = ROOT
imprison = ROOT
}
hidden_tooltip = {
ROOT = { disband_event_forces = decadence_revolters }
}
}
}
}
tp_elite_barracks_2 = {
prerequisites = { tp_wall_1 }
upgrades_from = tp_elite_barracks_1
build_cost = 120
build_time = 730
heavy_infantry = 55
ai_creation_factor = 94


start = {
on_fail = {
OR = {
ROOT = {
AND = {
prestige = -200
}
FROM = { religion_group = muslim }
year = 1145
FROM = {
prestige = 100
}
}
AND = {
any_defender = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
limit = { character = FROM }
year = 1130
participation_scaled_prestige = 100
}
}
AND = {
any_defender = {
FROM = { religion_group = christian }
limit = { NOT = { character = FROM } }
year = 1150
hidden_tooltip = { participation_scaled_prestige = 100 }
}
}
AND = {
hidden_tooltip = {
FROM = { religion_group = pagan_group }
ROOT = { disband_event_forces = decadence_revolters }
year = 1175
}
}
}

on_reverse_demand = {
ROOT = { set_defacto_liege = FROM }
ROOT = {
prestige = -200
transfer_scaled_wealth = {
to = FROM
value = 8.0
}
}
}
FROM = {
prestige = 200
}
ROOT = {
imprison = FROM
disband_event_forces = decadence_revolters
}
}
}
}
tp_elite_barracks_3 = {
prerequisites = { tp_wall_2 }
upgrades_from = tp_elite_barracks_2
build_cost = 200
build_time = 730
heavy_infantry = 65
ai_creation_factor = 93


on_reverse_demand_title = {
start = {
OR = {
ROOT = {
AND = {
remove_claim = PREV
}
FROM = { religion_group = muslim }
}
year = 1200

}
attacker_ai_victory_worth = {
AND = {
factor = 100
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
}
year = 1210
}
attacker_ai_defeat_worth = {
AND = {
factor = 100
FROM = { religion_group = christian }
}
year = 1205

}
defender_ai_victory_worth = {
AND = {
factor = -1 # always accept
FROM = { religion_group = pagan_group }
}
year = 1320
defender_ai_defeat_worth = {
factor = 150
}
}

muslim_invasion = {
name = CB_NAME_INVASION
war_name = WAR_NAME_INVASION
sprite = 8
truce_days = 3650
hostile_against_others = yes
is_permanent = yes
can_ask_to_join_war = 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

can_use = {
ROOT = {
religion_group = muslim
piety = 600
NOT = {
decadence = 30
}
}
NOT = {
# These use 'tribal_invasion' instead:
ROOT = {
OR = {
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 }
}
}
can_use_title = {
# Muslims require the target to have at least 6 counties within the target kingdom
FROM = {
num_of_realm_counties = {
value = 6
title = PREV
}
}
}
is_valid_title = {
FROM = {
any_realm_title = {
de_jure_liege_or_above = PREVPREV
}
}
}
on_add = {
ROOT = { piety = -500 }
}
}
tp_elite_barracks_4 = {
trigger = { TECH_TEMPLE_CONSTRUCTION = 1 }
upgrades_from = tp_elite_barracks_3
build_cost = 300
build_time = 1095
heavy_infantry = 75
ai_creation_factor = 92


start = {
on_success = {
OR = {
ROOT = {
AND = {
prestige = 200
}
FROM = { religion_group = muslim }
year = 1320
any_attacker = {
limit = { character = ROOT }
participation_scaled_prestige = 200
if = {
limit = {
religion_group = muslim
FROM = { NOT = { religion_group = muslim } }
}
}
participation_scaled_decadence = -20
AND = {
}
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
}
year = 1310
any_attacker = {
limit = { NOT = { character = ROOT } }
hidden_tooltip = {
participation_scaled_prestige = 200
if = {
limit = {
religion_group = muslim
FROM = { NOT = { religion_group = muslim } }
}
participation_scaled_decadence = -20
}
}
AND = {
}
}
FROM = { religion_group = christian }
year = 1305
FROM = {
prestige = -200
}
}
AND = {
}
FROM = { religion_group = pagan_group }
year = 1410
on_success_title = {
custom_tooltip = tribal_invasion_succ_tip
hidden_tooltip = {
ROOT = {
vassalize_or_take_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
}
}
}
}
}
}
}
}
tp_elite_barracks_5 = {
trigger = { TECH_TEMPLE_CONSTRUCTION = 3 }
upgrades_from = tp_elite_barracks_4
build_cost = 400
build_time = 2190
heavy_infantry = 85
ai_creation_factor = 91


start = {
on_fail = {
OR = {
FROM = {
AND = {
prestige = 100
}
FROM = { religion_group = muslim }
year = 1460
FROM = {
}
if = {
AND = {
limit = {
has_dlc = "Legacy of Rome"
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1480
OR = {
has_landed_title = e_byzantium
}
has_landed_title = e_roman_empire
AND = {
FROM = { religion_group = christian }
}
religion_group = christian
year = 1500
}
AND = {
FROM = { religion_group = pagan_group }
year = 1500
}
}
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
}
}
}
}
tp_elite_barracks_6 = {
trigger = { TECH_TEMPLE_CONSTRUCTION = 5 }
upgrades_from = tp_elite_barracks_5
build_cost = 500
build_time = 2190
heavy_infantry = 95
ai_creation_factor = 90


on_reverse_demand = {
start = {
OR = {
ROOT = {
AND = {
prestige = -200
transfer_scaled_wealth = {
FROM = { religion_group = muslim }
year = 1500
to = FROM
}
value = 4.0
AND = {
}
decadence = 10
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
}
year = 1500
FROM = {
}
AND = {
prestige = 200
}
FROM = { religion_group = christian }
year = 1500
FROM = {
}
if = {
AND = {
limit = {
has_dlc = "Legacy of Rome"
FROM = { religion_group = pagan_group }
year = 1500
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 }
}
}
}

attacker_ai_victory_worth = {
factor = 100
}
}
attacker_ai_defeat_worth = {
tp_town_1 = {
build_cost = 100
factor = 100
}
build_time = 365

tax_income = 1.5
defender_ai_victory_worth = {
ai_creation_factor = 95
factor = -1 # always accept
}
defender_ai_defeat_worth = {
factor = 150
}
}

cb_faction_independence = {
name = CB_NAME_INDEPENDENCE
war_name = WAR_NAME_FACTION_INDEPENDENCE
sprite = 12
truce_days = 3650
major_revolt = yes
can_call_allies = no
can_ask_to_join_war = yes
attacker_alliance_occ_warscore = yes # Occupying any holding of any attacker counts towards war score
can_use = {
ROOT = {
vassal_of = FROM
}
}


start = {
is_valid = {
ROOT = {
OR = {
OR = {
AND = {
liege = {
character = PREV # either independent
FROM = { religion_group = muslim }
year = 1090
}
}
AND = {
liege = {
FROM = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
is_liege_or_above = PREV # or have shared liege
year = 1095
}
}
AND = {
FROM = { religion_group = christian }
year = 1105
}
AND = {
FROM = { religion_group = pagan_group }
year = 1066
}
}
}
}
}
FROM = {
higher_tier_than = ROOT
}
}
}
}
tp_town_2 = {
prerequisites = { tp_wall_1 }
upgrades_from = tp_town_1
build_cost = 120
build_time = 547
tax_income = 2
ai_creation_factor = 94


start = {
on_success = {
OR = {
if = {
AND = {
limit = {
FROM = { religion_group = muslim }
FROM = {
year = 1120
independent = yes
}
}
AND = {
}
any_attacker = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1105
limit = {
OR = {
vassal_of = FROM
liege_before_war = {
character = FROM
}
}
}
}
AND = {
set_defacto_liege = THIS
hidden_tooltip = {
FROM = { religion_group = christian }
year = 1125
prestige = 100
any_demesne_title = {
}
AND = {
add_pressed_claim = FROM
}
FROM = { religion_group = pagan_group }
year = 1150
}
}
}
}
}
}
}
tp_town_3 = {
any_attacker = {
prerequisites = { tp_wall_2 }
limit = { character = ROOT }
participation_scaled_prestige = 100
upgrades_from = tp_town_2
build_cost = 200
hidden_tooltip = {
disband_event_forces = faction_revolters
build_time = 730
}
tax_income = 2.5
}
ai_creation_factor = 93
any_attacker = {
limit = { NOT = { character = ROOT } }
hidden_tooltip = {
participation_scaled_prestige = 100
disband_event_forces = faction_revolters
}
}


start = {
FROM = {
OR = {
hidden_tooltip = { disband_event_forces = faction_loyalists }
AND = {
FROM = { religion_group = muslim }
any_demesne_title = { # All titles
year = 1160
limit = {
OR = {
tier = king
tier = emperor
}
NOT = { has_law = centralization_0 }
}
}
AND = {
if = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
limit = { has_law = centralization_1 }
year = 1180
add_law = centralization_0
}
}
AND = {
if = {
FROM = { religion_group = christian }
limit = { has_law = centralization_2 }
year = 1195
add_law = centralization_1
}
}
AND = {
if = {
FROM = { religion_group = pagan_group }
limit = { has_law = centralization_3 }
year = 1220
add_law = centralization_2
}
if = {
limit = { has_law = centralization_4 }
add_law = centralization_3
}
}
}
}
}
}
}
}
tp_town_4 = {
trigger = { TECH_TEMPLE_CONSTRUCTION = 2 }
upgrades_from = tp_town_3
build_cost = 300
build_time = 1095
tax_income = 3
ai_creation_factor = 92


start = {
on_fail = {
OR = {
ROOT = {
AND = {
prestige = -50
prisoner = FROM
FROM = { religion_group = muslim }
add_character_modifier = {
year = 1210
name = faction_independence_ultimatum_timer
}
AND = {
hidden = yes
duration = 3650
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
}
year = 1215
hidden_tooltip = {
}
disband_event_forces = faction_revolters
AND = {
}
FROM = { religion_group = christian }
}
year = 1240
any_attacker = {
}
AND = {
limit = { character = ROOT }
participation_scaled_prestige = -50
FROM = { religion_group = pagan_group }
}
year = 1400
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 } }
}

on_reverse_demand = {
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 }
}
}
}
}
tp_town_5 = {
trigger = { TECH_TEMPLE_CONSTRUCTION = 4 }
upgrades_from = tp_town_4
build_cost = 400
build_time = 2190
tax_income = 3.5
ai_creation_factor = 91


on_attacker_leader_death = {
start = {
OR = {
hidden_tooltip = {
AND = {
any_defender = {
letter_event = {
FROM = { religion_group = muslim }
year = 1420
id = 251
}
AND = {
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
year = 1453
}
AND = {
FROM = { religion_group = christian }
year = 1410
}
AND = {
FROM = { religion_group = pagan_group }
year = 1500
}
}
}
}
}
}

end_war = invalid
}
}


attacker_ai_victory_worth = {
tp_school_1 = {
factor = -1 # always accept
prerequisites = { tp_wall_1 }
}
build_cost = 120
build_time = 547
attacker_ai_defeat_worth = {
tech_growth_modifier = 0.1
factor = 150
ai_creation_factor = 93
}


defender_ai_victory_worth = {
start = {
factor = -1 # always accept
OR = {
}
AND = {
FROM = { religion_group = muslim }
defender_ai_defeat_worth = {
year = 1090
factor = 100
}
}
AND = {
}
FROM = { top_liege = { primary_title = { title = e_byzantium } } }

year = 1100
imperial_reconquest = {
}
name = CB_NAME_IMPERIAL
AND = {
war_name = WAR_NAME_IMPERIAL
FROM = { religion_group = christian }
sprite = 17
year = 1150
truce_days = 3650
}
is_permanent = yes
AND = {
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
FROM = { religion_group = pagan_group }

year = 1200
can_use = {
}
ROOT = {
has_landed_title = e_roman_empire
independent = yes
religion_group = christian
NOT = { same_realm = FROM }
}
FROM = {
NOT = { religion_group = muslim }
}
}

can_use_title = {
OR = {
de_jure_liege_or_above = k_byzantium
de_jure_liege_or_above = k_anatolia
de_jure_liege_or_above = k_armenia
de_jure_liege_or_above = k_bulgaria
de_jure_liege_or_above = k_serbia
de_jure_liege_or_above = k_croatia
de_jure_liege_or_above = k_italy
de_jure_liege_or_above = k_sicily
de_jure_liege_or_above = k_bavaria
de_jure_liege_or_above = k_burgundy
de_jure_liege_or_above = k_france
de_jure_liege_or_above = k_aquitaine
de_jure_liege_or_above = k_brittany
de_jure_liege_or_above = k_england
de_jure_liege_or_above = k_wales
de_jure_liege_or_above = k_frisia
de_jure_liege_or_above = k_lotharingia
de_jure_liege_or_above = k_aragon
de_jure_liege_or_above = k_castille
de_jure_liege_or_above = k_andalusia
de_jure_liege_or_above = k_leon
de_jure_liege_or_above = k_spanish_galicia
de_jure_liege_or_above = k_portugal
de_jure_liege_or_above = k_navarra
de_jure_liege_or_above = k_syria
de_jure_liege_or_above = k_jerusalem
de_jure_liege_or_above = k_egypt
de_jure_liege_or_above = k_africa
de_jure_liege_or_above = k_mauretania
de_jure_liege_or_above = k_papal_state
de_jure_liege_or_above = k_venice
}
}
is_valid = {
ROOT = {
independent = yes
religion_group = christian
NOT = { same_realm = FROM }
}
}
on_success = {
any_attacker = {
limit = { character = ROOT }
participation_scaled_prestige = 100
}
any_attacker = {
limit = { NOT = { character = ROOT } }
hidden_tooltip = {
participation_scaled_prestige = 100
}
}
}
}
FROM = { prestige = -100 }
}
}
tp_school_2 = {
prerequisites = { tp_wall_2 }
upgrades_from = tp_school_1
build_cost = 120
build_time = 547
tech_growth_modifier = 0.2
ai_creation_factor = 92


on_success_title = {
start = {
usurp_title_plus_barony_if_unlanded = ROOT
OR = {
}
AND = {

FROM = { religion_group = muslim }
on_fail = {
year = 1140
ROOT = { prestige = -150 }
}

on_reverse_demand = {
ROOT = {
transfer_scaled_wealth = {
to = FROM
value = 4.0
}
ROOT = { prestige = -200 }
}
any_defender = {
limit = { character = FROM }
participation_scaled_piety = 100
participation_scaled_prestige = 200
if = {
limit = {
religion_group = muslim
}
}
participation_scaled_decadence = -10
AND = {
}
FROM = { top_liege = { primary_title = { title = e_byzantium } } }
}
year = 1150
any_defender = {
}
limit = { NOT = { character = FROM } }
AND = {
hidden_tooltip = {
FROM = { religion_group = christian }
participation_scaled_piety = 100
year = 1180
participation_scaled_prestige = 200
}
AND = {
if = {
limit = {
FROM = { religion_group = pagan_group }
year = 1250
religion_group = muslim
}
participation_scaled_decadence = -10
}
}
}
}
}
}
}

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
}
}
}
}

Revision as of 10:37, 20 January 2013

    1. normal scopes(including posttitle scopes) ##
  1. ROOT = receiver
  2. FROM = giver
  3. <no scope change> = attacker or receiver
    1. title scopes ##
  4. ROOT = receiver
  5. FROM = giver
  6. <no scope change> = thirdparty landed title
  7. the following effects/triggers exists (example execution order: on_success->on_success_title->on_success_posttitle):
  8. 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
  9. Added on_attacker_leader_death, on_defender_leader_death and on_thirdparty_death, which all trigger when corresponding character dies
  10. These three all have war scopes, which currently has the following scope changes:
  11. attacker, defender, thirdparty(only valid if thirdparty character is involved), thirdparty_title(only valid if thirdparty title is involved)

claim = { name = CB_NAME_CLAIM war_name = WAR_NAME_CLAIM sprite = 1 truce_days = 3650 hostile_against_others = yes can_ask_to_join_war = no

press_claim = yes

can_use_title = { OR = { ROOT = { is_female = no } NOT = { ROOT = { religion_group = muslim } } } OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } 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 } 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 } } } }

is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } ROOT = { has_claim = PREV } }

on_success_title = { usurp_title_plus_barony_if_unlanded = ROOT

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 } }

on_fail_title = { 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 = { ROOT = { prestige = -150 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 = { ROOT = { remove_claim = PREV } }

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 } }


other_claim = { name = CB_NAME_CLAIM war_name = WAR_NAME_OTHER_CLAIM sprite = 2 truce_days = 3650 hostile_against_others = yes can_ask_to_join_war = no

press_claim = yes

can_use_title = { OR = { ROOT = { is_female = no } AND = { NOT = { ROOT = { religion_group = muslim } } NOT = { succ_law_title = { has_law = agnatic_succession } } }

  1. Old version always allowed women to go for secondary titles
  2. AND = {
  3. lower_tier_than = KING
  4. is_primary_holder_title = no
  5. }

} OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = 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 } 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 } } } }

is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } ROOT = { has_claim = PREV } }

on_success = { hidden_tooltip = { 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 } } FROM = { prestige = -100 } }

on_success_title = { if = { limit = { controls_religion = yes holder_scope = { religion = catholic } } holder_scope = { abdicate_to = ROOT } }

if = { limit = { OR = { controls_religion = no NOT = { holder_scope = { religion = catholic } } } }

if = { limit = { holder_scope = { same_realm = FROMFROM # The current holder and the one pressing my claim are in the same larger realm } } ROOT = { set_character_flag = other_claim_tmp_flag } }

if = { limit = { ROOT = { is_ruler = yes is_liege_or_above = FROMFROM # The claimant is a vassal ruler of the presser } } ROOT = { set_character_flag = claimant_is_vassal_ruler_flag } }

usurp_title_plus_barony_if_unlanded = ROOT

hidden_tooltip = {

# If we were erroneously vassalized, break free if = { limit = { NOT = { ROOT = { has_character_flag = claimant_is_vassal_ruler_flag } } holder_scope = { is_liege_or_above = FROMFROM } NOT = { de_jure_liege_or_above = FROMFROM } ROOT = { NOT = { dynasty = FROMFROM } } } ROOT = { set_defacto_liege = ROOT } }

# try and vassalize, but only conditionally if = { limit = { NOT = { holder_scope = { is_liege_or_above = FROMFROM } } OR = { de_jure_liege_or_above = FROMFROM ROOT = { has_character_flag = claimant_is_vassal_ruler_flag } ROOT = { dynasty = FROMFROM } } } ROOT = { set_defacto_liege = FROMFROM } }

# check if the previous effect managed to make us part of the same realm # if not, we'll break the other realm if = { limit = { NOT = { ROOT = { has_character_flag = other_claim_tmp_flag } } FROM = { FROM = { top_liege = { ROOT = { top_liege = { NOT = { character = PREVPREV } } } } } } } ROOT = { set_defacto_liege = ROOT } }

# If we have become independent from our mutual liege, restore that vassal tie if = { limit = { ROOT = { has_character_flag = other_claim_tmp_flag de_facto_liege = ROOT } } FROM = { FROM = { top_liege = { ROOT = { set_defacto_liege = PREV } } } } }

ROOT = { clr_character_flag = other_claim_tmp_flag clr_character_flag = claimant_is_vassal_ruler_flag } } }

if = { limit = { higher_tier_than = BARON NOT = { culture = ROOT } } hidden_tooltip = { conquest_culture = ROOT } } }

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 = { 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 = { ROOT = { remove_claim = PREV } }

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 } }


claim_on_liege = { name = CB_NAME_CLAIM war_name = WAR_NAME_CLAIM_LIEGE sprite = 3 truce_days = 3650 hostile_against_others = yes major_revolt = yes

press_claim = yes can_call_vassals = yes

can_use = { FROM = { in_revolt = no liege = { in_revolt = no liege = { in_revolt = no } } } }

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 } } } }

is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } OR = { has_law = succ_feudal_elective ROOT = { has_claim = PREV } } }

on_success = { 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 } any_demesne_title = { # All titles limit = { OR = { tier = king tier = emperor }

  1. is_titular = no

NOT = { has_law = centralization_0 } } if = { limit = { has_law = centralization_1 } add_law = centralization_0 } if = { limit = { has_law = centralization_2 } add_law = centralization_1 } if = { limit = { has_law = centralization_3 } add_law = centralization_2 } if = { limit = { has_law = centralization_4 } add_law = centralization_3 } } } if = { limit = { ROOT = { prisoner = yes host = { character = FROM } } } ROOT = { prisoner = no } } }

on_success_title = { if = { limit = { is_primary_holder_title = yes } FROM = { imprison = ROOT } }

usurp_title_plus_barony_if_unlanded_and_vassals = ROOT

if = { limit = { higher_tier_than = BARON NOT = { culture = ROOT } } hidden_tooltip = { conquest_culture = ROOT } } }

on_fail = { 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_reverse_demand = { 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_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 }

defender_ai_victory_worth = { factor = -1 # always accept }

defender_ai_defeat_worth = { factor = 100 } }


claim_on_liege_plot = { name = CB_NAME_CLAIM war_name = WAR_NAME_CLAIM_LIEGE sprite = 3 truce_days = 3650 hostile_against_others = yes

press_claim = yes can_call_allies = no can_ask_to_join_war = no

can_use_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } }

is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } }

on_success = { 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 }

any_demesne_title = { # All titles limit = { OR = { tier = king tier = emperor }

  1. is_titular = no

NOT = { has_law = centralization_0 } } if = { limit = { has_law = centralization_1 } add_law = centralization_0 } if = { limit = { has_law = centralization_2 } add_law = centralization_1 } if = { limit = { has_law = centralization_3 } add_law = centralization_2 } if = { limit = { has_law = centralization_4 } add_law = centralization_3 } } } }

on_success_title = { usurp_title_plus_barony_if_unlanded = ROOT

if = { limit = { higher_tier_than = BARON NOT = { culture = ROOT } } hidden_tooltip = { conquest_culture = ROOT } } ROOT = { plot_succeeds = yes } }

on_fail = { 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_reverse_demand = { 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_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 }

defender_ai_victory_worth = { factor = -1 # always accept }

defender_ai_defeat_worth = { factor = 100 } }

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

press_claim = yes can_call_allies = no can_attack_vassals = yes

can_use_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { de_facto_liege = ROOT } } }

is_valid_title = { FROM = { has_landed_title = PREV } ROOT = { has_plot = plot_gain_vassal_title } }

on_success = { ROOT = { prestige = 50 } }

on_success_title = { usurp_title_plus_barony_if_unlanded = ROOT ROOT = { plot_succeeds = yes } }

on_fail = { 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 = { 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_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 }

defender_ai_victory_worth = { factor = -1 # always accept }

defender_ai_defeat_worth = { factor = 100 } }

other_claim_on_liege = { name = CB_NAME_CLAIM war_name = WAR_NAME_OTHER_CLAIM sprite = 4 truce_days = 3650 hostile_against_others = yes major_revolt = yes

press_claim = yes can_call_vassals = yes

can_use = { FROM = { in_revolt = no liege = { in_revolt = no liege = { in_revolt = no } } } }

can_use_title = { 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 = { FROM = { has_landed_title = PREV } }

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 } } } }

is_valid_title = { 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_success = { 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 } }

FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists }

any_demesne_title = { # All titles limit = { OR = { tier = king tier = emperor }

  1. is_titular = no

NOT = { has_law = centralization_0 } } if = { limit = { has_law = centralization_1 } add_law = centralization_0 } if = { limit = { has_law = centralization_2 } add_law = centralization_1 } if = { limit = { has_law = centralization_3 } add_law = centralization_2 } if = { limit = { has_law = centralization_4 } add_law = centralization_3 } } }

if = { limit = { ROOT = { prisoner = yes host = { character = FROM } } } ROOT = { prisoner = no } } }

on_success_title = { if = { limit = { is_primary_holder_title = yes } hidden_tooltip = { FROM = { set_character_flag = temp_other_claim_on_liege_prison } } }

# 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 = ROOT

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 } }

if = { limit = { top_liege = { ROOT = { NOT = { top_liege = { character = PREVPREV } } } } }

ROOT = { set_defacto_liege = ROOT } }

if = { limit = { FROM = { has_character_flag = temp_other_claim_on_liege_prison } } FROM = { imprison = ROOT clr_character_flag = temp_other_claim_on_liege_prison } } } }

on_fail = { prestige = -100

imprison = FROM if = { 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 = { prestige = -200

imprison = FROM if = { 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 } } }

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 } }


claim_all = { name = CB_NAME_CLAIM_ALL war_name = WAR_NAME_CLAIM_ALL sprite = 5 truce_days = 3650 is_permanent = yes can_ask_to_join_war = no is_claim_all = yes

can_use = { 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 = { ROOT = { any_claim = { limit = { holder_scope = { OR = { character = FROM is_liege_or_above = FROM } } ROOT = { has_strong_claim = PREV } } press_claim = ROOT } } }

on_success = { ROOT = { any_claim = { limit = { holder_scope = { OR = { character = FROM is_liege_or_above = FROM } } ROOT = { has_strong_claim = PREV } } usurp_title_plus_barony_if_unlanded = ROOT 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_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_reverse_demand = { 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 } } ROOT = { remove_claim = PREV } } } 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 } } }

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 } }


change_seniority_succession_law = { name = CB_NAME_SENIORITY_SUCCESSION_LAW war_name = WAR_NAME_SENIORITY_SUCCESSION_LAW sprite = 6 truce_days = 3650 can_call_allies = no can_ask_to_join_war = no major_revolt = yes

attacker_alliance_occ_warscore = yes # Occupying any holding of any attacker counts towards war score

can_use = { ROOT = { vassal_of = FROM } }

is_valid_title = { NOT = { has_law = succ_seniority } OR = { tier = emperor tier = king is_primary_holder_title = yes } }

on_success = { FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } any_demesne_title = { # All titles limit = { OR = { tier = king tier = emperor }

  1. is_titular = no

NOT = { has_law = centralization_0 } } if = { limit = { has_law = centralization_1 } add_law = centralization_0 } if = { limit = { has_law = centralization_2 } add_law = centralization_1 } if = { limit = { has_law = centralization_3 } add_law = centralization_2 } if = { limit = { has_law = centralization_4 } add_law = centralization_3 } } } 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 } } }

on_success_title = { succession_w_cooldown = seniority }

on_fail = { 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_succ_seniority_ultimatum_timer hidden = yes duration = 3650 } } } FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } } }

on_reverse_demand = { 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_succ_seniority_ultimatum_timer hidden = yes duration = 3650 } } }

FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } } }

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 } }


change_primogeniture_succession_law = { name = CB_NAME_PRIMOGENITURE_SUCCESSION_LAW war_name = WAR_NAME_PRIOGENITURE_SUCCESSION_LAW sprite = 6 truce_days = 3650 can_call_allies = no can_ask_to_join_war = no major_revolt = yes

attacker_alliance_occ_warscore = yes # Occupying any holding of any attacker counts towards war score

can_use = { ROOT = { vassal_of = FROM } }

is_valid_title = { NOT = { has_law = succ_primogeniture } OR = { tier = emperor tier = king is_primary_holder_title = yes } }


on_success = { FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists }

any_demesne_title = { # All titles limit = { OR = { tier = king tier = emperor }

  1. is_titular = no

NOT = { has_law = centralization_0 } } if = { limit = { has_law = centralization_1 } add_law = centralization_0 } if = { limit = { has_law = centralization_2 } add_law = centralization_1 } if = { limit = { has_law = centralization_3 } add_law = centralization_2 } if = { limit = { has_law = centralization_4 } add_law = centralization_3 } } }

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 } } }

on_success_title = { succession_w_cooldown = primogeniture }

on_fail = { 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_succ_primogeniture_ultimatum_timer hidden = yes duration = 3650 } } }

FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } } }

on_reverse_demand = { 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_succ_primogeniture_ultimatum_timer hidden = yes duration = 3650 } } }

FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } } }

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 } }

change_feudal_elective_succession_law = { name = CB_NAME_FEUDAL_ELECTIVE_SUCCESSION_LAW war_name = WAR_NAME_FEUDAL_ELECTIVE_SUCCESSION_LAW sprite = 6 truce_days = 3650 can_call_allies = no can_ask_to_join_war = no major_revolt = yes

attacker_alliance_occ_warscore = yes # Occupying any holding of any attacker counts towards war score

can_use = { ROOT = { vassal_of = FROM } }

is_valid_title = { NOT = { has_law = succ_feudal_elective } OR = { tier = emperor tier = king is_primary_holder_title = yes }

  1. OR = {
  2. AND = {
  3. tier = emperor
  4. OR = {
  5. ROOT = { tier = king }
  6. ROOT = { tier = duke }
  7. }
  8. }
  9. AND = {
  10. tier = king
  11. ROOT = { tier = duke }
  12. }
  13. AND = {
  14. tier = duke
  15. ROOT = { tier = count }
  16. }
  17. }

}

on_success = { FROM = {

hidden_tooltip = { disband_event_forces = faction_loyalists }

any_demesne_title = { # All titles limit = { OR = { tier = king tier = emperor }

  1. is_titular = no

NOT = { has_law = centralization_0 } } if = { limit = { has_law = centralization_1 } add_law = centralization_0 } if = { limit = { has_law = centralization_2 } add_law = centralization_1 } if = { limit = { has_law = centralization_3 } add_law = centralization_2 } if = { limit = { has_law = centralization_4 } add_law = centralization_3 } } } 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 } } }

on_success_title = { succession_w_cooldown = feudal_elective }

on_fail = { 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_succ_feudal_elective_ultimatum_timer hidden = yes duration = 3650 } } } FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } } }

on_reverse_demand = { 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_succ_feudal_elective_ultimatum_timer hidden = yes duration = 3650 } } }

FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } } }

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 } }


invasion = { name = CB_NAME_INVASION war_name = WAR_NAME_INVASION sprite = 7 truce_days = 3650 hostile_against_others = yes can_ask_to_join_war = no

can_use_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } }

is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } }

on_success = { 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 = { occupy_minors_of_occupied_settlements = FROM gain_all_occupied_titles = FROM give_nickname = nick_the_conqueror } 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 } } } }

FROM = { prestige = -200 } }

on_success_title = { custom_tooltip = invasion_succ_tip

hidden_tooltip = { usurp_title_plus_barony_if_unlanded = ROOT FROM = { set_defacto_liege = ROOT } 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_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_reverse_demand = { 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 = { ROOT = { remove_claim = PREV } }

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 } }


tribal_invasion = { name = CB_NAME_INVASION war_name = WAR_NAME_INVASION 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

can_use = { ROOT = { OR = { AND = { primary_title = { is_tribal_type_title = yes } has_horde_culture = yes NOT = { religion_group = christian } } AND = { mercenary = yes NOT = { num_of_titles = 2 } } } }

ROOT = { NOT = { is_liege_or_above = FROM } } }

is_valid_title = { FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV } } }

on_success = { 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 = { occupy_minors_of_occupied_settlements = FROM gain_all_occupied_titles = FROM } } }

on_success_title = { custom_tooltip = tribal_invasion_succ_tip hidden_tooltip = { ROOT = { vassalize_or_take_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 } } } }

on_fail = { FROM = { prestige = 100 } 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 = { ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } } 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 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 200 } } }

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 } }

crusade = { name = CB_NAME_CRUSADE war_name = WAR_NAME_CRUSADE sprite = 9 truce_days = 3650 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

can_use = { OR = { ROOT = { religion_group = christian year = 1090 } ROOT = { religion = sunni year = 1187 # Allow if the Caliphate has survived this long } ROOT = { religion = shiite year = 1187 # Allow if the Caliphate has survived this long } } ROOT = { can_call_crusade = yes has_called_crusade = no religion_authority = 0.05 } FROM = { OR = { NOT = { religion_group = ROOT } is_heresy_of = ROOT is_parent_religion = ROOT } } NOT = { # Not if the Schism has been mended AND = { religion = catholic has_global_flag = schism_mended } } }

can_use_title = { 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

num_of_realm_counties = { value = 6 title = PREV } } }

is_valid = { ROOT = { can_call_crusade = yes } FROM = { OR = { NOT = { religion_group = ROOT } is_heresy_of = ROOT is_parent_religion = ROOT } } }

is_valid_title = { FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV } } }

on_success_title = { if = { limit = { has_holder = yes holder_scope = { religion = ROOT } } holder_scope = { 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 } } }

if = { limit = { OR = { has_holder = no NOT = { holder_scope = { religion = ROOT } } } }

most_participating_attacker = { gain_settlements_under_title = { title = PREV enemy = FROM } if = { limit = { primary_title = { is_primary_type_title = no } # Mercs, the Pope, Holy Orders, etc PREV = { has_holder = no } OR = { NOT = { character = ROOT } independent = yes liege = { tier = EMPEROR } } } usurp_title = PREV

if = { limit = { NOT = { culture = PREV } } hidden_tooltip = { PREV = { conquest_culture = THIS } } } } } }

any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 500 participation_scaled_piety = 1000 if = { limit = { religion_group = muslim } participation_scaled_decadence = -100 } } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 500 participation_scaled_piety = 1000 if = { limit = { religion_group = muslim } participation_scaled_decadence = -100 } } }

ROOT = { religion_authority = 0.2 }

FROM = { piety = -100 } }

on_fail = { ROOT = { piety = -100 religion_authority = -0.05 }

any_defender = { limit = { character = FROM } participation_scaled_piety = 200 participation_scaled_prestige = 100 if = { limit = { religion_group = muslim } participation_scaled_decadence = -50 } } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_piety = 200 participation_scaled_prestige = 100 if = { limit = { religion_group = muslim } participation_scaled_decadence = -50 } } }

FROM = { religion_authority = 0.025 } 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 } } } } }

on_reverse_demand = { ROOT = { piety = -200 religion_authority = -0.1 } FROM = { piety = 100 religion_authority = 0.05 } any_defender = { limit = { character = FROM } participation_scaled_piety = 300 participation_scaled_prestige = 150 if = { limit = { religion_group = muslim } 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 } } } } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_piety = 300 participation_scaled_prestige = 150 if = { limit = { religion_group = muslim } participation_scaled_decadence = -100 } } } }

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 } }

religious = { name = CB_NAME_RELIGIOUS war_name = WAR_NAME_RELIGIOUS sprite = 9 truce_days = 3650 is_permanent = 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 = { ROOT = { NOT = { has_character_modifier = holy_war_cooldown } NOT = { religion_group = pagan_group } NOT = { same_realm = FROM } OR = { NOT = { religion_group = FROM } is_heresy_of = FROM is_parent_religion = FROM AND = { religion_group = muslim NOT = { religion = FROM } FROM = { NOT = { any_current_enemy = { NOT = { religion_group = muslim } } } } } } NOT = { AND = { religion_group = muslim OR = { FROM = { religion = bogomilist } FROM = { religion = miaphysite } } } } OR = { ai = no piety = 150 } top_liege = { religion_group = ROOT NOT = { religion = FROM } OR = { religion = ROOT AND = { is_heretic = no ROOT = { is_heretic = no } } } } } } on_add = { ROOT = { piety = -100 add_character_modifier = { name = holy_war_cooldown duration = 2555 } } }

is_valid = { ROOT = { NOT = { religion_group = pagan_group } NOT = { same_realm = FROM } OR = { NOT = { religion_group = FROM } is_heresy_of = FROM is_parent_religion = FROM AND = { religion_group = muslim NOT = { religion = FROM } } } top_liege = { NOT = { religion = FROM } } } }

on_success = { any_attacker = { limit = { character = ROOT } participation_scaled_piety = 100 participation_scaled_prestige = 50 if = { limit = { religion_group = muslim } participation_scaled_decadence = -10 } } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_piety = 100 participation_scaled_prestige = 50 if = { limit = { religion_group = muslim } participation_scaled_decadence = -10 } } }

ROOT = { religion_authority = 0.01 } FROM = { religion_authority = -0.01 } FROM = { piety = -100 } FROM = { prestige = -50 } }

on_success_title = { ROOT = { gain_settlements_under_title = { title = PREV enemy = FROM } } }

on_fail = { ROOT = { piety = -50 } ROOT = { prestige = -100 } }

on_reverse_demand = { ROOT = { transfer_scaled_wealth = { to = FROM value = 4.0 } } any_defender = { limit = { character = FROM } participation_scaled_piety = 200 participation_scaled_prestige = 100 if = { limit = { religion_group = muslim } participation_scaled_decadence = -10 } } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_piety = 200 participation_scaled_prestige = 100 if = { limit = { religion_group = muslim } participation_scaled_decadence = -10 } } } FROM = { religion_authority = 0.01 } ROOT = { religion_authority = -0.01 } }

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 } }

excommunicated_ruler = { name = CB_NAME_EXCOMMUNICATED_RULER war_name = WAR_NAME_EXCOMMUNICATED_RULER sprite = 11 truce_days = 3650

is_permanent = yes can_ask_to_join_war = no

can_use = { FROM = { excommunicated_for = ROOT in_revolt = no NOT = { any_current_enemy = { NOT = { religion_group = ROOT } } } } }

is_valid = { FROM = { excommunicated_for = ROOT } }

on_success = { ROOT = { if = { limit = { FROM = { primary_title = { tier = BARON } } } ROOT = { piety = 10 prestige = 50 } } if = { limit = { FROM = { primary_title = { tier = COUNT } } } ROOT = { piety = 20 prestige = 100 } } if = { limit = { FROM = { primary_title = { tier = DUKE } } } ROOT = { piety = 30 prestige = 150 } } if = { limit = { FROM = { primary_title = { tier = KING } } } ROOT = { piety = 50 prestige = 200 } } if = { limit = { FROM = { primary_title = { tier = EMPEROR } } } ROOT = { piety = 70 prestige = 400 } } }

FROM = { excommunicate = no prestige = -200 rightful_religious_head_scope = { opinion = { who = PREV modifier = opinion_repented_sins } } abdicate = yes } }

on_fail = { ROOT = { piety = -50 prestige = -100 } }

on_reverse_demand = { ROOT = { piety = -100 prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } } FROM = { prestige = 200 } }


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 } }

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 = { ROOT = { de_facto_liege = FROM }

FROM = { NOT = { any_war = { attacker = { character = FROM } OR = { using_cb = bid_for_independence 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 = { higher_tier_than = ROOT } }

on_success = { if = { limit = { FROM = { independent = no } } FROM = { liege = { ROOT = { set_defacto_liege = PREV } } } }

if = { limit = { FROM = { independent = yes } } ROOT = { set_defacto_liege = ROOT } }

hidden_tooltip = { ROOT = { prestige = 100 any_demesne_title = { 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 = { any_demesne_title = { # All titles limit = { OR = { tier = king tier = emperor }

  1. is_titular = no

NOT = { has_law = centralization_0 } } if = { limit = { has_law = centralization_1 } add_law = centralization_0 } if = { limit = { has_law = centralization_2 } add_law = centralization_1 } if = { limit = { has_law = centralization_3 } add_law = centralization_2 } if = { limit = { has_law = centralization_4 } add_law = centralization_3 } } } }

on_fail = { 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 = { 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 }

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 } }

depose_liege = { name = CB_NAME_DEPOSE_LIEGE war_name = WAR_NAME_DEPOSE_LIEGE sprite = 12 truce_days = 3650

is_permanent = yes can_call_vassals = yes

can_use = { ROOT = { de_facto_liege = FROM }

# cannot depose FROM = { in_revolt = no liege = { in_revolt = no liege = { in_revolt = no } } NOT = { any_war = { OR = { AND = { # Cannot depose liege when our liege is currently involved in such a war attacker = { character = FROM } OR = { using_cb = bid_for_independence using_cb = depose_liege } } AND = { # Cannot depose liege if someone else is already deposing liege defender = { character = FROM } 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 = { higher_tier_than = ROOT } }

on_success = { FROM = { prestige = -500 any_demesne_title = { # All titles limit = { OR = { tier = king tier = emperor }

  1. is_titular = no

NOT = { has_law = centralization_0 } } if = { limit = { has_law = centralization_1 } add_law = centralization_0 } if = { limit = { has_law = centralization_2 } add_law = centralization_1 } if = { limit = { has_law = centralization_3 } add_law = centralization_2 } if = { limit = { has_law = centralization_4 } add_law = centralization_3 } }

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 = { 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 = 150 }

defender_ai_victory_worth = { factor = -1 # always accept }

defender_ai_defeat_worth = { factor = 100 } }

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_use = { 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_success = { ROOT = { primary_title = { add_pressed_claim = FROM } } FROM = { prestige = -500 remove_opinion = { who = ROOT modifier = declared_war } any_demesne_title = { # All titles limit = { OR = { tier = king tier = emperor }

  1. is_titular = no

NOT = { has_law = centralization_0 } } if = { limit = { has_law = centralization_1 } add_law = centralization_0 } if = { limit = { has_law = centralization_2 } add_law = centralization_0 } if = { limit = { has_law = centralization_3 } add_law = centralization_1 } if = { limit = { has_law = centralization_4 } add_law = centralization_2 } } abdicate = yes } 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 } FROM = { remove_opinion = { who = ROOT modifier = declared_war } } }

on_reverse_demand = { 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 = 150 }

defender_ai_victory_worth = { factor = -1 # always accept }

defender_ai_defeat_worth = { factor = 100 } }

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 = { 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_success = { ROOT = { prestige = 200 primary_title = { add_pressed_claim = FROM } } FROM = { prestige = -500 remove_opinion = { who = ROOT modifier = declared_war } any_demesne_title = { # All titles limit = { OR = { tier = king tier = emperor }

  1. is_titular = no

NOT = { has_law = centralization_0 } } if = { limit = { has_law = centralization_1 } add_law = centralization_0 } if = { limit = { has_law = centralization_2 } add_law = centralization_0 } if = { limit = { has_law = centralization_3 } add_law = centralization_1 } if = { limit = { has_law = centralization_4 } add_law = centralization_2 } } abdicate = yes } }

on_fail = { ROOT = { prestige = -100 }

FROM = { prestige = -100 remove_opinion = { who = ROOT modifier = declared_war } } }

on_reverse_demand = { ROOT = { prestige = -200 prisoner = FROM } FROM = { prestige = 50 } }

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 } }


succession_on_liege = { name = CB_NAME_SUCCESSION war_name = WAR_NAME_SUCCESSION sprite = 13 truce_days = 3650 hostile_against_others = yes press_claim = yes can_call_vassals = yes

allow_whitepeace = no

is_valid_title = { FROM = { has_landed_title = PREV } } on_success = { FROM = { prestige = -100 any_demesne_title = { limit = { tier = FROM } usurp_title_plus_barony_if_unlanded = ROOT } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 200 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 200 } } }

on_success_title = { if = { limit = { OR = { tier = king tier = emperor }

  1. is_titular = no

NOT = { has_law = centralization_0 } } if = { limit = { has_law = centralization_1 } add_law = centralization_0 } if = { limit = { has_law = centralization_2 } add_law = centralization_1 } if = { limit = { has_law = centralization_3 } add_law = centralization_2 } if = { limit = { has_law = centralization_4 } add_law = centralization_3 } } }

on_fail = { ROOT = { prestige = -50 } FROM = { prestige = 50 } }

on_reverse_demand = { ROOT = { imprison = FROM } 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 = { ROOT = { remove_claim = PREV } }

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 = 150 }

defender_ai_victory_worth = { factor = -1 # always accept }

defender_ai_defeat_worth = { factor = 100 } }


other_succession = { name = CB_NAME_SUCCESSION war_name = WAR_NAME_OTHER_SUCCESSION sprite = 14 truce_days = 3650 hostile_against_others = yes press_claim = yes can_call_vassals = yes

allow_whitepeace = no

can_use_title = { OR = { ROOT = { is_female = no } NOT = { has_law = agnatic_succession } AND = { lower_tier_than = KING is_primary_holder_title = no } } }

is_valid_title = {

FROM = { has_landed_title = PREV } }

on_success = { ROOT = { opinion = { modifier = pressed_my_claim who = PREV } } prestige = 50 any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } } }

on_success_title = { usurp_title_plus_barony_if_unlanded = ROOT if = { limit = { OR = { tier = king tier = emperor }

  1. is_titular = no

NOT = { has_law = centralization_0 } } if = { limit = { has_law = centralization_1 } add_law = centralization_0 } if = { limit = { has_law = centralization_2 } add_law = centralization_1 } if = { limit = { has_law = centralization_3 } add_law = centralization_2 } if = { limit = { has_law = centralization_4 } add_law = centralization_3 } } }

on_success_posttitle = { hidden_tooltip = { if = { limit = { top_liege = { ROOT = { NOT = { top_liege = { character = PREVPREV } } } } }

ROOT = { set_defacto_liege = PREV } }

if = { limit = { top_liege = { ROOT = { NOT = { top_liege = { character = PREVPREV } } } } }

ROOT = { set_defacto_liege = ROOT } } } }

on_fail = { prestige = -50 FROM = { prestige = 50 } }

on_reverse_demand = { prestige = -200

ROOT = { imprison = FROM } 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 = { ROOT = { remove_claim = PREV } }

on_defender_leader_death = { hidden_tooltip = { any_attacker = { letter_event = { id = 251 } } }

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 } }


other_succession_on_liege = { name = CB_NAME_SUCCESSION war_name = WAR_NAME_OTHER_SUCCESSION sprite = 15 truce_days = 3650 hostile_against_others = yes press_claim = yes can_call_vassals = yes

allow_whitepeace = no

can_use_title = { OR = { ROOT = { is_female = no } NOT = { has_law = agnatic_succession } AND = { lower_tier_than = KING is_primary_holder_title = no } } }

is_valid_title = { FROM = { has_landed_title = PREV } }

on_success = { ROOT = { opinion = { modifier = pressed_my_claim who = PREV } }

# If the claimant has the wrong government type, take care of that first. if = { limit = { FROM = { primary_title = { higher_tier_than = ROOT } is_feudal = yes } ROOT = { is_ruler = yes OR = { is_theocracy = yes is_republic = yes } } } ROOT = { abdicate = yes } }

FROM = { any_demesne_title = { limit = { tier = FROM } usurp_title_plus_barony_if_unlanded = ROOT } }

any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } } }

on_success_title = { if = { limit = { OR = { tier = king tier = emperor }

  1. is_titular = no

NOT = { has_law = centralization_0 } } if = { limit = { has_law = centralization_1 } add_law = centralization_0 } if = { limit = { has_law = centralization_2 } add_law = centralization_1 } if = { limit = { has_law = centralization_3 } add_law = centralization_2 } if = { limit = { has_law = centralization_4 } add_law = centralization_3 } } }

on_success_posttitle = { hidden_tooltip = { if = { limit = { top_liege = { ROOT = { NOT = { top_liege = { character = PREVPREV } } } } }

ROOT = { set_defacto_liege = PREV } }

if = { limit = { top_liege = { ROOT = { NOT = { top_liege = { character = PREVPREV } } } } }

ROOT = { set_defacto_liege = ROOT } } } }

on_fail = { prestige = -50 FROM = { prestige = 50 } }

on_reverse_demand = { prestige = -200 imprison = 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 } } }

on_reverse_demand_title = { ROOT = { remove_claim = PREV } }

on_defender_leader_death = { hidden_tooltip = { any_attacker = { letter_event = { id = 251 } } } 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 } }

dejure_county_claim = { name = CB_NAME_DEJURECLAIM war_name = WAR_NAME_DEJURECLAIM sprite = 16 truce_days = 3650 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

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 } } } }

is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } }

on_success_title = { if = { limit = { holder_scope = { tier = count NOT = { num_of_count_titles = 2 } } }

holder_scope = { set_defacto_liege = ROOT } }

if = { limit = { holder_scope = { OR = { higher_tier_than = count num_of_count_titles = 2 } } }

usurp_title_plus_barony_if_unlanded = ROOT 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 = ROOT } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } } }

on_fail_title = { 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 = { 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 } } }

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 } }

dejure_barony_claim = { name = CB_NAME_DEJUREBARONYCLAIM war_name = WAR_NAME_DEJUREBARONYCLAIM sprite = 16 truce_days = 3650 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

can_use_title = { tier = baron dejure_liege_title = { AND = { has_holder = yes ROOT = { has_landed_title = PREV } } }

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 } }

NOT = { holder_scope = { liege = { ROOT = { liege = { character = PREVPREV } } } } } }

is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } }

on_success_title = { usurp_title_plus_barony_if_unlanded = ROOT any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 50 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 50 } } }

on_fail_title = { 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 = { 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 } } }

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 } }

other_dejure_barony_claim = { name = CB_NAME_DEJUREBARONYCLAIM war_name = WAR_NAME_OTHER_DEJUREBARONYCLAIM sprite = 16 truce_days = 3650 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

can_use = { NOT = { ROOT = { character = PREV } } }

can_use_title = { tier = baron

dejure_liege_title = { AND = { has_holder = yes ROOT = { has_landed_title = PREV } } }

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 } }

NOT = { holder_scope = { liege = { ROOT = { liege = { character = PREVPREV } } } } } }

is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } }

on_success = { ROOT = { opinion = { modifier = pressed_my_claim who = PREV } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 50 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 50 } } }

on_success_title = { usurp_title_plus_barony_if_unlanded = ROOT }

on_fail = { prestige = -50 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 = { prestige = -50 transfer_scaled_wealth = { to = FROM value = 4.0 } ROOT = { prestige = -50 } 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 }

defender_ai_victory_worth = { factor = -1 # always accept }

defender_ai_defeat_worth = { factor = 100 } }


other_dejure_county_claim = { name = CB_NAME_DEJURECLAIM war_name = WAR_NAME_OTHER_DEJURECLAIM sprite = 16 truce_days = 3650 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

can_use = { NOT = { ROOT = { character = PREV } } }

can_use_title = { tier = count dejure_liege_title = { AND = { has_holder = yes ROOT = { has_landed_title = PREV } } }

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 } } }

is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } }

on_success = { 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 = { if = { limit = { holder_scope = { tier = count NOT = { num_of_count_titles = 2 } } }

holder_scope = { set_defacto_liege = ROOT } }

if = { limit = { holder_scope = { OR = { higher_tier_than = count num_of_count_titles = 2 } } }

usurp_title_plus_barony_if_unlanded = ROOT 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 = ROOT } } }

on_fail = { 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 = { 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 } } }

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 } }


change_gavelkind_succession_law = { name = CB_NAME_GAVELKIND_SUCCESSION_LAW war_name = WAR_NAME_GAVELKIND_SUCCESSION_LAW sprite = 6 truce_days = 3650 can_call_allies = no can_ask_to_join_war = no major_revolt = yes

attacker_alliance_occ_warscore = yes # Occupying any holding of any attacker counts towards war score

can_use = { ROOT = { vassal_of = FROM } }

is_valid_title = { NOT = { has_law = succ_gavelkind } OR = { tier = emperor tier = king is_primary_holder_title = yes } }

on_success = { FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } any_demesne_title = { # All titles limit = { OR = { tier = king tier = emperor }

  1. is_titular = no

NOT = { has_law = centralization_0 } } if = { limit = { has_law = centralization_1 } add_law = centralization_0 } if = { limit = { has_law = centralization_2 } add_law = centralization_1 } if = { limit = { has_law = centralization_3 } add_law = centralization_2 } if = { limit = { has_law = centralization_4 } add_law = centralization_3 } } }

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 } } }

on_success_title = { succession_w_cooldown = gavelkind }

on_fail = { 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_succ_gavelkind_ultimatum_timer hidden = yes duration = 3650 } } } FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } } }

on_reverse_demand = { 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_succ_gavelkind_ultimatum_timer hidden = yes duration = 3650 } } }

FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } } }

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 } }

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

attacker_alliance_occ_warscore = yes # Occupying any holding of any attacker counts towards war score

can_use = { ROOT = { vassal_of = FROM } }

can_use_title = { holder_scope = { independent = yes } OR = { tier = king tier = emperor } OR = { has_law = centralization_1 has_law = centralization_2 has_law = centralization_3 has_law = centralization_4 } }

on_success = { ROOT = { opinion = { modifier = opinion_lowered_crown_authority 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 = centralization_1 } add_law_w_cooldown = centralization_0 } if = { limit = { has_law = centralization_2 } add_law_w_cooldown = centralization_1 } if = { limit = { has_law = centralization_3 } add_law_w_cooldown = centralization_2 } if = { limit = { has_law = centralization_4 } add_law_w_cooldown = centralization_3 } }

on_fail = { 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_lower_CA_ultimatum_timer hidden = yes duration = 3650 } } } FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } } }

on_reverse_demand = { 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_lower_CA_ultimatum_timer hidden = yes duration = 3650 } } } FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } } }

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 } }


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 = no

can_use = { ROOT = { is_republic = yes capital_scope = { port = yes } } }

can_use_title = { tier = COUNT location = { port = yes } }

is_valid = { ROOT = { is_republic = yes capital_scope = { port = yes } } }

is_valid_title = { tier = COUNT location = { port = yes } }

on_success_title = { any_de_jure_vassal_title = { limit = { holding_type = CITY } usurp_title = ROOT } usurp_title = ROOT any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } } }

on_fail = { 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 = { 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 } } }

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 } }


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 can_call_allies = no can_ask_to_join_war = no

can_use_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } }

is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } }

on_success = { any_attacker = { participation_scaled_prestige = 100 } FROM = { any_demesne_title = { # All titles limit = { OR = { tier = king tier = emperor }

  1. is_titular = no

NOT = { has_law = centralization_0 } } if = { limit = { has_law = centralization_1 } add_law = centralization_0 } if = { limit = { has_law = centralization_2 } add_law = centralization_1 } if = { limit = { has_law = centralization_3 } add_law = centralization_2 } if = { limit = { has_law = centralization_4 } add_law = centralization_3 } } } }

on_success_title = { FROM = { random_vassal = { limit = { tier = count any_demesne_title = { tier = count dejure_liege_title = { ROOT = { plot_target_title = { title = PREVPREV } } } } } grant_title = PREVPREV } } }

on_fail = { 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 = { ROOT = { prestige = -200 imprison = FROM } 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 }

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 } }

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

can_use = { ROOT = { NOT = { is_liege_or_above = FROM } } }

can_use_title = { tier = count OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM NOT = { same_realm = ROOT } } }

ROOT = { NOT = { religion_group = christian } piety = 50 }

NOT = { OR = { ROOT = { has_landed_title = PREV } holder_scope = { is_liege_or_above = ROOT } } }

location = { any_neighbor_province = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } } } }

is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } }

on_success_title = { if = { limit = { holder_scope = { tier = count NOT = { num_of_count_titles = 2 } lower_tier_than = ROOT } }

holder_scope = { set_defacto_liege = ROOT } }

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 = ROOT 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 = ROOT } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } } }

on_fail_title = { 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 = { 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_add = { ROOT = { piety = -50 } }

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 } }

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 = { ROOT = { has_character_flag = decadence_invader } }

on_success = { FROM = { any_demesne_title = { # All titles limit = { OR = { tier = king tier = emperor } NOT = { has_law = centralization_0 } } if = { add_law = centralization_0 } } }

ROOT = { prestige = 200 piety = 100 occupy_minors_of_occupied_settlements = FROM gain_all_occupied_titles = FROM give_nickname = nick_the_conqueror } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 200 participation_scaled_piety = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 200 participation_scaled_piety = 100 } }

FROM = { prestige = -200 primary_title = { holder_scope = { any_demesne_title = { limit = { tier = PREVPREV } usurp_title_plus_barony_if_unlanded = ROOT

if = { limit = { higher_tier_than = BARON NOT = { culture = ROOT } } hidden_tooltip = { conquest_culture = ROOT } } } } }

set_defacto_liege = ROOT imprison = ROOT }

hidden_tooltip = { ROOT = { disband_event_forces = decadence_revolters } } }

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 } } hidden_tooltip = { ROOT = { disband_event_forces = decadence_revolters } } }

on_reverse_demand = { ROOT = { set_defacto_liege = FROM } ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 8.0 } } FROM = { prestige = 200 } ROOT = { imprison = FROM disband_event_forces = decadence_revolters } }

on_reverse_demand_title = { ROOT = { remove_claim = PREV } }

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 } }

muslim_invasion = { name = CB_NAME_INVASION war_name = WAR_NAME_INVASION sprite = 8 truce_days = 3650 hostile_against_others = yes is_permanent = yes can_ask_to_join_war = 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

can_use = { ROOT = { religion_group = muslim piety = 600 NOT = { decadence = 30 } }

NOT = { # These use 'tribal_invasion' instead: ROOT = { OR = { 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 } } }

can_use_title = { # Muslims require the target to have at least 6 counties within the target kingdom FROM = { num_of_realm_counties = { value = 6 title = PREV } } }

is_valid_title = { FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV } } }

on_add = { ROOT = { piety = -500 } }

on_success = { ROOT = { prestige = 200 }

any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 200

if = { limit = { religion_group = muslim FROM = { NOT = { religion_group = muslim } } } participation_scaled_decadence = -20 } } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 200 if = { limit = { religion_group = muslim FROM = { NOT = { religion_group = muslim } } } participation_scaled_decadence = -20 } } } FROM = { prestige = -200 } }

on_success_title = { custom_tooltip = tribal_invasion_succ_tip hidden_tooltip = { ROOT = { vassalize_or_take_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 } } } }

on_fail = { 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 = { ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } 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 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 200 } } }

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 } }

cb_faction_independence = { name = CB_NAME_INDEPENDENCE war_name = WAR_NAME_FACTION_INDEPENDENCE sprite = 12 truce_days = 3650 major_revolt = yes

can_call_allies = no can_ask_to_join_war = yes

attacker_alliance_occ_warscore = yes # Occupying any holding of any attacker counts towards war score

can_use = { ROOT = { vassal_of = 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_success = { if = { limit = { FROM = { independent = yes } } any_attacker = { limit = { OR = { vassal_of = FROM liege_before_war = { character = FROM } } } set_defacto_liege = THIS hidden_tooltip = { prestige = 100 any_demesne_title = { add_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 }

any_demesne_title = { # All titles limit = { OR = { tier = king tier = emperor } NOT = { has_law = centralization_0 } } if = { limit = { has_law = centralization_1 } add_law = centralization_0 } if = { limit = { has_law = centralization_2 } add_law = centralization_1 } if = { limit = { has_law = centralization_3 } add_law = centralization_2 } if = { limit = { has_law = centralization_4 } add_law = centralization_3 } } } }

on_fail = { 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 } } }

on_reverse_demand = { 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 } } }

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 = 150 }

defender_ai_victory_worth = { factor = -1 # always accept }

defender_ai_defeat_worth = { factor = 100 } }

imperial_reconquest = { name = CB_NAME_IMPERIAL war_name = WAR_NAME_IMPERIAL sprite = 17 truce_days = 3650 is_permanent = 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 = { ROOT = { has_landed_title = e_roman_empire independent = yes religion_group = christian NOT = { same_realm = FROM } } FROM = { NOT = { religion_group = muslim } } }

can_use_title = { OR = { de_jure_liege_or_above = k_byzantium de_jure_liege_or_above = k_anatolia de_jure_liege_or_above = k_armenia de_jure_liege_or_above = k_bulgaria de_jure_liege_or_above = k_serbia de_jure_liege_or_above = k_croatia de_jure_liege_or_above = k_italy de_jure_liege_or_above = k_sicily de_jure_liege_or_above = k_bavaria de_jure_liege_or_above = k_burgundy de_jure_liege_or_above = k_france de_jure_liege_or_above = k_aquitaine de_jure_liege_or_above = k_brittany de_jure_liege_or_above = k_england de_jure_liege_or_above = k_wales de_jure_liege_or_above = k_frisia de_jure_liege_or_above = k_lotharingia de_jure_liege_or_above = k_aragon de_jure_liege_or_above = k_castille de_jure_liege_or_above = k_andalusia de_jure_liege_or_above = k_leon de_jure_liege_or_above = k_spanish_galicia de_jure_liege_or_above = k_portugal de_jure_liege_or_above = k_navarra de_jure_liege_or_above = k_syria de_jure_liege_or_above = k_jerusalem de_jure_liege_or_above = k_egypt de_jure_liege_or_above = k_africa de_jure_liege_or_above = k_mauretania de_jure_liege_or_above = k_papal_state de_jure_liege_or_above = k_venice } }

is_valid = { ROOT = { independent = yes religion_group = christian NOT = { same_realm = FROM } } }

on_success = { 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 = { usurp_title_plus_barony_if_unlanded = ROOT }

on_fail = { ROOT = { prestige = -150 } }

on_reverse_demand = { ROOT = { transfer_scaled_wealth = { to = FROM value = 4.0 } ROOT = { prestige = -200 } } any_defender = { limit = { character = FROM } participation_scaled_piety = 100 participation_scaled_prestige = 200 if = { limit = { religion_group = muslim } participation_scaled_decadence = -10 } } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_piety = 100 participation_scaled_prestige = 200 if = { limit = { religion_group = muslim } participation_scaled_decadence = -10 } } } }

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 } }