Scripted effect · Roads to Power files
ep3_adventurer_ai_war_declare_effect
ep3_adventurer_ai_war_declare_effect = { ADVENTURER = … WAR_TARGET = … }game/common/scripted_effects/07_dlc_ep3_story_cycle_adventurer_ai_scripted_effects.txt, line 1560 (123 lines). Parameters: $ADVENTURER$, $WAR_TARGET$.
ep3_adventurer_ai_war_declare_effect is a scripted effect in Crusader Kings III, in the Roads to Power files, written at line 1560 of its file. A call passes 2 parameters: ADVENTURER and WAR_TARGET. The game's script calls it in 1 place, among them on_adventurer_ai_war_target_arrival (on action). Patch 1.20.1.2, from game/common/scripted_effects/07_dlc_ep3_story_cycle_adventurer_ai_scripted_effects.txt.
The comment above it in the file
Adventurer declares war on target, if possible ADVENTURER = character WAR_TARGET = character
What it does
Every line of it is script with no tooltip text: the script is below.
The script as written (120 lines of game script)
ep3_adventurer_ai_war_declare_effect = {
$ADVENTURER$ = {
if = {
limit = { has_realm_law = camp_purpose_legitimists }
if = {
limit = {
$WAR_TARGET$ = {
ep3_adventurer_ai_valid_legitimist_target_trigger = { ADVENTURER = $ADVENTURER$ }
}
}
ordered_claim = {
limit = {
tier >= tier_kingdom
holder = $WAR_TARGET$
}
order_by = tier
save_scope_as = claim
}
start_war = {
target = $WAR_TARGET$
casus_belli = claim_cb
claimant = $ADVENTURER$
target_title = scope:claim
}
}
}
else_if = {
limit = {
has_cb_on = {
target = $WAR_TARGET$
casus_belli = ep3_laamp_adventurer_empire_invasion
}
}
start_war = {
target = $WAR_TARGET$
casus_belli = ep3_laamp_adventurer_empire_invasion
}
}
else_if = {
limit = {
has_cb_on = {
target = $WAR_TARGET$
casus_belli = ep3_laamp_adventurer_kingdom_invasion
}
}
start_war = {
target = $WAR_TARGET$
casus_belli = ep3_laamp_adventurer_kingdom_invasion
}
}
else_if = {
limit = {
has_cb_on = {
target = $WAR_TARGET$
casus_belli = ep3_laamp_adventurer_duchy_invasion
}
}
$WAR_TARGET$ = { # Grab an appropriate Duchy
random_sub_realm_duchy = {
limit = {
any_in_de_jure_hierarchy = { # At least 2 counties
continue = { tier > tier_county }
count >= 2
tier = tier_county
holder ?= {
OR = {
this = $WAR_TARGET$
is_vassal_or_below_of = $WAR_TARGET$
}
}
}
any_in_de_jure_hierarchy = { # And either coastal or bordering another realm (otherwise it'll look u g l y)
continue = { tier > tier_county }
tier = tier_county
holder ?= {
OR = {
this = $WAR_TARGET$
is_vassal_or_below_of = $WAR_TARGET$
}
}
OR = {
is_coastal_county = yes
any_neighboring_county = {
NOT = {
holder.top_liege = $WAR_TARGET$.top_liege
}
}
}
}
}
save_scope_as = target_title
}
}
start_war = {
target = $WAR_TARGET$
casus_belli = ep3_laamp_adventurer_duchy_invasion
target_title = scope:target_title
}
}
else = {
$WAR_TARGET$ = { # Grab an appropriate Duchy
random_sub_realm_county = {
limit = {
OR = {
is_coastal_county = yes
any_neighboring_county = {
NOT = {
holder.top_liege = $WAR_TARGET$.top_liege
}
}
}
}
save_scope_as = target_title
}
}
start_war = {
target = $WAR_TARGET$
casus_belli = ep3_laamp_adventurer_county_invasion
target_title = scope:target_title
}As written in game/common/scripted_effects/07_dlc_ep3_story_cycle_adventurer_ai_scripted_effects.txt.
The first 120 of its 123 lines; the rest is in game/common/scripted_effects/07_dlc_ep3_story_cycle_adventurer_ai_scripted_effects.txt from line 1560.
Where it is used
Every place in common/, events/ and history/ that calls ep3_adventurer_ai_war_declare_effect.
On actions (the game's own hooks) (1)
- on_adventurer_ai_war_target_arrival
Source: game/common/scripted_effects/07_dlc_ep3_story_cycle_adventurer_ai_scripted_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.