Orthodox bulgarian uprising plus buffs to bulgaria at start
This commit is contained in:
parent
1416a8fffb
commit
fec6e462e2
12 changed files with 755 additions and 4 deletions
|
|
@ -1798,3 +1798,268 @@ neow_great_schism_invite_catholics_effect = {
|
|||
trigger_event = NEOW_religious_decision.0292
|
||||
}
|
||||
}
|
||||
|
||||
# Called in the Bulgarian ruler's scope. Early intervention optionally supplies an emperor scope.
|
||||
neow_start_bulgarian_uprising_effect = {
|
||||
save_scope_as = neow_uprising_defender
|
||||
random_sub_realm_county = {
|
||||
limit = { neow_bulgarian_unhappy_orthodox_county_trigger = yes }
|
||||
save_scope_as = neow_uprising_county
|
||||
}
|
||||
if = {
|
||||
limit = {
|
||||
exists = scope:neow_uprising_county
|
||||
neow_bulgarian_uprising_eligible_trigger = yes
|
||||
}
|
||||
# The uprising always claims the Kingdom of Bulgaria, never the local lord's title.
|
||||
create_character = {
|
||||
location = scope:neow_uprising_county.title_province
|
||||
template = peasant_faction_leader_template
|
||||
dynasty = generate
|
||||
culture = culture:NEOW_bulgarian
|
||||
faith = scope:neow_uprising_county.faith
|
||||
rite = scope:neow_uprising_county.rite
|
||||
gender_female_chance = 0
|
||||
save_scope_as = neow_uprising_leader
|
||||
}
|
||||
scope:neow_uprising_leader = {
|
||||
set_character_rite = scope:neow_uprising_county.rite
|
||||
add_gold = 100
|
||||
# Use the native playable landless camp title, not an ordinary titular duchy.
|
||||
save_scope_as = new_landless_adventurer
|
||||
create_adventurer_title = {
|
||||
name = neow_bulgarian_uprising_title
|
||||
holder = scope:neow_uprising_leader
|
||||
save_scope_as = neow_uprising_temporary_title
|
||||
}
|
||||
set_landless_adventurer_government_type_effect = yes
|
||||
}
|
||||
scope:neow_uprising_temporary_title = {
|
||||
set_no_automatic_claims = yes
|
||||
set_can_be_named_after_dynasty = no
|
||||
}
|
||||
scope:neow_uprising_leader = {
|
||||
set_variable = { name = neow_uprising_temporary_title value = scope:neow_uprising_temporary_title }
|
||||
start_war = {
|
||||
casus_belli = neow_bulgarian_orthodox_uprising_cb
|
||||
target = scope:neow_uprising_defender
|
||||
target_title = title:k_bulgaria
|
||||
}
|
||||
random_character_war = {
|
||||
limit = {
|
||||
using_cb = neow_bulgarian_orthodox_uprising_cb
|
||||
primary_attacker = scope:neow_uprising_leader
|
||||
primary_defender = scope:neow_uprising_defender
|
||||
}
|
||||
save_scope_as = neow_uprising_war
|
||||
}
|
||||
}
|
||||
if = {
|
||||
limit = { exists = scope:neow_uprising_war }
|
||||
set_global_variable = { name = neow_bulgarian_uprising_active value = scope:neow_uprising_leader }
|
||||
# Permanent campaign lock, even if the war later ends inconclusively.
|
||||
set_global_variable = { name = neow_bulgarian_uprising_has_occurred value = yes }
|
||||
scope:neow_uprising_leader = {
|
||||
spawn_army = {
|
||||
name = neow_bulgarian_uprising_army
|
||||
levies = 333
|
||||
location = scope:neow_uprising_county.title_province
|
||||
war = scope:neow_uprising_war
|
||||
inheritable = no
|
||||
}
|
||||
}
|
||||
every_sub_realm_county = {
|
||||
limit = { neow_bulgarian_unhappy_orthodox_county_trigger = yes }
|
||||
save_temporary_scope_as = neow_uprising_recruitment_county
|
||||
scope:neow_uprising_leader = {
|
||||
spawn_army = {
|
||||
name = neow_bulgarian_uprising_army
|
||||
levies = { value = scope:neow_uprising_recruitment_county.county_levies_to_raise add = 500 }
|
||||
location = scope:neow_uprising_recruitment_county.title_province
|
||||
war = scope:neow_uprising_war
|
||||
inheritable = no
|
||||
}
|
||||
}
|
||||
}
|
||||
trigger_event = NEOW_yearly_flavor_events.0101
|
||||
if = {
|
||||
limit = { exists = scope:neow_uprising_emperor }
|
||||
scope:neow_uprising_war = { add_attacker = scope:neow_uprising_emperor }
|
||||
scope:neow_uprising_leader = { add_gold = 500 }
|
||||
scope:neow_uprising_emperor = { trigger_event = NEOW_yearly_flavor_events.0105 }
|
||||
}
|
||||
every_ruler = {
|
||||
limit = {
|
||||
is_landed = yes
|
||||
NEOW_is_broadly_orthodox_trigger = yes
|
||||
in_diplomatic_range = scope:neow_uprising_defender
|
||||
this != scope:neow_uprising_leader
|
||||
OR = {
|
||||
NOT = { exists = scope:neow_uprising_emperor }
|
||||
this != scope:neow_uprising_emperor
|
||||
}
|
||||
}
|
||||
trigger_event = NEOW_yearly_flavor_events.0102
|
||||
}
|
||||
}
|
||||
else = {
|
||||
# Do not leave a phantom uprising or a temporary title after failed declarations.
|
||||
scope:neow_uprising_leader = { neow_cleanup_bulgarian_uprising_title_effect = yes }
|
||||
if = {
|
||||
limit = { exists = scope:neow_uprising_emperor }
|
||||
scope:neow_uprising_emperor = { add_gold = 500 add_piety = 750 add_prestige = 750 }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
neow_cleanup_bulgarian_uprising_title_effect = {
|
||||
save_temporary_scope_as = neow_uprising_cleanup_holder
|
||||
if = {
|
||||
limit = { exists = var:neow_uprising_temporary_title }
|
||||
var:neow_uprising_temporary_title = { save_temporary_scope_as = neow_uprising_title_cleanup }
|
||||
remove_variable = neow_uprising_temporary_title
|
||||
if = {
|
||||
limit = { scope:neow_uprising_title_cleanup = { is_title_created = yes holder = scope:neow_uprising_cleanup_holder } }
|
||||
destroy_title = scope:neow_uprising_title_cleanup
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Broadcast after the war, with no expired war scope needed by the notifications.
|
||||
neow_bulgarian_uprising_victory_effect = {
|
||||
scope:attacker = { save_scope_as = neow_uprising_leader }
|
||||
scope:defender = { save_scope_as = neow_uprising_defender }
|
||||
# Remember the old capital and direct vassals before the old ruler loses their titles.
|
||||
scope:defender = {
|
||||
capital_county ?= { save_scope_as = neow_uprising_victory_capital }
|
||||
every_vassal = {
|
||||
limit = { highest_held_title_tier >= tier_county }
|
||||
add_to_list = neow_uprising_victory_vassals
|
||||
}
|
||||
}
|
||||
# First transfer actual land. A landless adventurer cannot receive vassals normally.
|
||||
create_title_and_vassal_change = {
|
||||
type = conquest
|
||||
save_scope_as = neow_uprising_victory_change
|
||||
add_claim_on_loss = yes
|
||||
}
|
||||
scope:defender = {
|
||||
every_held_title = {
|
||||
limit = { tier >= tier_county is_landless_type_title = no this != title:d_stratocratic_hof }
|
||||
change_title_holder = { holder = scope:attacker change = scope:neow_uprising_victory_change take_baronies = yes }
|
||||
}
|
||||
}
|
||||
resolve_title_and_vassal_change = scope:neow_uprising_victory_change
|
||||
# A ruler with only a titular higher title may have had no personal county.
|
||||
# Ensure the victor has a county before moving out of the camp government.
|
||||
if = {
|
||||
limit = {
|
||||
scope:attacker = { NOT = { any_held_title = { tier = tier_county } } }
|
||||
exists = scope:neow_uprising_victory_capital
|
||||
}
|
||||
create_title_and_vassal_change = {
|
||||
type = conquest
|
||||
save_scope_as = neow_uprising_capital_change
|
||||
add_claim_on_loss = yes
|
||||
}
|
||||
scope:neow_uprising_victory_capital = {
|
||||
change_title_holder = { holder = scope:attacker change = scope:neow_uprising_capital_change take_baronies = yes }
|
||||
}
|
||||
resolve_title_and_vassal_change = scope:neow_uprising_capital_change
|
||||
}
|
||||
scope:attacker = {
|
||||
if = {
|
||||
limit = { any_held_title = { tier = tier_county } }
|
||||
# Establish a normal landed government and a permanent primary title.
|
||||
if = {
|
||||
limit = { has_realm_law = landless_adventurer_succession_law }
|
||||
remove_realm_law = landless_adventurer_succession_law
|
||||
}
|
||||
assign_feudal_governments_effect = yes
|
||||
if = {
|
||||
limit = { has_title = title:k_bulgaria }
|
||||
set_primary_title_to = title:k_bulgaria
|
||||
}
|
||||
if = {
|
||||
limit = { scope:neow_uprising_victory_capital.holder ?= this }
|
||||
set_realm_capital = scope:neow_uprising_victory_capital
|
||||
}
|
||||
}
|
||||
}
|
||||
# Now transfer the former ruler's vassals to the landed victor.
|
||||
create_title_and_vassal_change = {
|
||||
type = conquest
|
||||
save_scope_as = neow_uprising_vassal_change
|
||||
add_claim_on_loss = yes
|
||||
}
|
||||
every_in_list = {
|
||||
list = neow_uprising_victory_vassals
|
||||
limit = {
|
||||
is_landed = yes
|
||||
this != scope:attacker
|
||||
highest_held_title_tier < scope:attacker.highest_held_title_tier
|
||||
NOT = { liege ?= scope:attacker }
|
||||
}
|
||||
change_liege = { liege = scope:attacker change = scope:neow_uprising_vassal_change }
|
||||
}
|
||||
resolve_title_and_vassal_change = scope:neow_uprising_vassal_change
|
||||
hidden_effect = {
|
||||
faith:stratocratic_faith = { remove_religious_head_title = yes }
|
||||
}
|
||||
if = {
|
||||
limit = { title:d_stratocratic_hof = { is_title_created = yes } }
|
||||
scope:attacker = { destroy_title = title:d_stratocratic_hof }
|
||||
}
|
||||
scope:attacker = {
|
||||
# Only remove the camp once the victor holds Bulgaria and a playable county.
|
||||
if = {
|
||||
limit = {
|
||||
has_title = title:k_bulgaria
|
||||
any_held_title = { tier = tier_county }
|
||||
}
|
||||
neow_cleanup_bulgarian_uprising_title_effect = yes
|
||||
}
|
||||
add_piety = 500
|
||||
add_prestige = 500
|
||||
trigger_event = NEOW_yearly_flavor_events.0103
|
||||
}
|
||||
every_ruler = {
|
||||
limit = {
|
||||
is_landed = yes
|
||||
NEOW_is_broadly_orthodox_trigger = yes
|
||||
in_diplomatic_range = scope:neow_uprising_leader
|
||||
this != scope:neow_uprising_leader
|
||||
}
|
||||
trigger_event = NEOW_yearly_flavor_events.0106
|
||||
}
|
||||
set_global_variable = { name = neow_bulgarian_uprising_has_occurred value = yes }
|
||||
remove_global_variable = neow_bulgarian_uprising_active
|
||||
}
|
||||
|
||||
neow_bulgarian_uprising_defeat_effect = {
|
||||
scope:attacker = { save_scope_as = neow_uprising_leader }
|
||||
scope:defender = {
|
||||
save_scope_as = neow_uprising_defender
|
||||
faith = { save_scope_as = neow_uprising_defender_faith }
|
||||
rite = { save_scope_as = neow_uprising_defender_rite }
|
||||
every_sub_realm_county = {
|
||||
limit = { neow_bulgarian_orthodox_county_trigger = yes }
|
||||
set_county_faith = scope:neow_uprising_defender_faith
|
||||
set_county_rite = scope:neow_uprising_defender_rite
|
||||
}
|
||||
trigger_event = NEOW_yearly_flavor_events.0107
|
||||
}
|
||||
every_ruler = {
|
||||
limit = {
|
||||
is_landed = yes
|
||||
NEOW_is_broadly_orthodox_trigger = yes
|
||||
in_diplomatic_range = scope:neow_uprising_defender
|
||||
this != scope:neow_uprising_leader
|
||||
}
|
||||
trigger_event = NEOW_yearly_flavor_events.0104
|
||||
}
|
||||
scope:attacker = { neow_cleanup_bulgarian_uprising_title_effect = yes }
|
||||
set_global_variable = { name = neow_bulgarian_uprising_has_occurred value = yes }
|
||||
remove_global_variable = neow_bulgarian_uprising_active
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue