Scripted effect · Legacy of Persia files
seljuk_war_target_evaluation_and_declaration_effect
seljuk_war_target_evaluation_and_declaration_effect = yesgame/common/scripted_effects/01_dlc_fp3_scripted_effects.txt, line 449 (299 lines). No parameters.
seljuk_war_target_evaluation_and_declaration_effect is a scripted effect in Crusader Kings III, in the Legacy of Persia files, written at line 449 of its file. It takes no parameters: seljuk_war_target_evaluation_and_declaration_effect = yes. The game's script calls it in 1 place, among them story_seljuk_invasion (story cycle). Patch 1.20.1.2, from game/common/scripted_effects/01_dlc_fp3_scripted_effects.txt.
The comment above it in the file
focus on forming a custom persian empire and freeing turkish people first
What it does
If
scope:lead_seljuk:- Is an Independent Ruler
- Their liege › Any vassal:
Then
If
- Their liege:
One of these
- Has the High Crown Authority Law
or
Has the Absolute Crown Authority Law
can_join_or_create_faction_against = { who = liege faction = liberty_faction }
Then
If
- Their liege › Any targeting faction:
faction_type = liberty_faction
Then
- Their liege › One random targeting faction:
faction_type = liberty_faction
scope:lead_seljuk:join_faction = scope:liberty_faction
Otherwise
create_faction = { type = liberty_faction target = liege }
- Their liege › Any targeting faction:
- Their liege:
If
a check the game hides
Then
start_war = { cb = fp3_seljuk_invasion_cb target = scope:next_invasion_target target_title = scope:next_invasion_title_target }
• the game's own tooltip text · ◦ our reading of the script line · code the script where neither exists
“They” is whatever it runs on (the scope it is called in). The scripted triggers and effects it calls link to their own pages; $PARAMETERS$ stay as written: each call fills them in.
The script as written (120 lines of game script)
seljuk_war_target_evaluation_and_declaration_effect = {
# Set the Seljuk leader as reference point
save_scope_as = lead_seljuk
#if the seljuk is a vassal he will try to fight other vassals first
if = {
limit = {
scope:lead_seljuk = {
top_liege != this
liege = {
any_vassal = {
highest_held_title_tier > tier_barony
NOR = {
is_allied_to = scope:lead_seljuk
has_usable_hook = scope:lead_seljuk
this = scope:lead_seljuk
}
}
}
}
}
#if you can't attack vassals, due to crown laws, then do a liberty faction instead
if = {
limit = {
liege = {
OR = {
has_realm_law = crown_authority_2
has_realm_law = crown_authority_3
}
}
can_join_or_create_faction_against = {
who = liege
faction = liberty_faction
}
}
#join one if it already exists
if = {
limit = {
liege = {
any_targeting_faction = {
faction_type = liberty_faction
}
}
}
liege = {
random_targeting_faction = {
faction_type = liberty_faction
save_temporary_scope_as = liberty_faction
}
}
scope:lead_seljuk = {
join_faction = scope:liberty_faction
}
#debug_log = "Seljuk joined liberty faction"
}
#otherwise create it
else = {
create_faction = {
type = liberty_faction
target = liege
}
#debug_log = "Seljuk created liberty faction"
}
}
#if you can attack, do it
else = {
scope:lead_seljuk = {
liege = {
random_vassal = {
limit = {
#don't try to attack barons
highest_held_title_tier > tier_barony
#don't try to attack anyone that you shouldn't want to
NOT = {
is_allied_to = scope:lead_seljuk
has_usable_hook = scope:lead_seljuk
this = scope:lead_seljuk
}
}
weight = {
base = 1
#attack the weaklings first
modifier = {
add = {
value = current_military_strength
multiply = -1
}
}
#focus on the closest to you
modifier = {
add = 1000
any_held_county = {
any_neighboring_county = {
holder = scope:lead_seljuk
}
}
}
#attack mainly those inside the persian empire
modifier = {
add = 1000
any_realm_province = {
geographical_region = world_persian_empire
}
}
}
save_temporary_scope_as = next_invasion_target
primary_title = {
duchy = {
save_temporary_scope_as = next_invasion_title_target
}
}
}
}
}
#debug_log = "Seljuk attacked a vassal"
}
}
# Select a new target
else_if = { # Check if a direct neighbor is a valid war target
limit = {As written in game/common/scripted_effects/01_dlc_fp3_scripted_effects.txt.
The first 120 of its 299 lines; the rest is in game/common/scripted_effects/01_dlc_fp3_scripted_effects.txt from line 449.
Where it is used
Every place in common/, events/ and history/ that calls seljuk_war_target_evaluation_and_declaration_effect.
Story cycles (1)
- story_seljuk_invasion
Source: game/common/scripted_effects/01_dlc_fp3_scripted_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.