Scripted effect
laamp_contract_grab_suitable_rival_for_disposal_effect
laamp_contract_grab_suitable_rival_for_disposal_effect = yesgame/common/scripted_effects/00_laamp_effects.txt, line 1811 (118 lines). No parameters.
laamp_contract_grab_suitable_rival_for_disposal_effect is a scripted effect in Crusader Kings III, written at line 1811 of its file. It takes no parameters: laamp_contract_grab_suitable_rival_for_disposal_effect = yes. The game's script calls it in 3 places, among them laamp_base_3011 (contract), laamp_base_3021 (contract) and laamp_base_3031 (contract). Patch 1.20.1.2, from game/common/scripted_effects/00_laamp_effects.txt.
What it does
If
- Any pool character:
province = locationis_physically_able_ai_adult = yes
Then
- One random pool character:
- Where:
province = location
- Any pool character:
If
a check the game hides
Then
create_character = { … }
scope:employer_ref:set_random_rivalry_reason = { TARGET = scope:target RELATION = grudge }
• 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 (118 lines of game script)
laamp_contract_grab_suitable_rival_for_disposal_effect = {
# Used in valid_laamp_contract_foe_trigger.
save_scope_as = employer_ref
# First, try to grab suitable rivals.
ordered_relation = {
type = rival
limit = { valid_laamp_contract_foe_trigger = yes }
order_by = "opinion(scope:employer_ref)"
save_scope_as = target
}
# Then we try for potential rivals.
## Non-if-else_if chaining here is deliberate: we iterate over each list once then look to see whether we came up with anything. If we didn't, we move on to the next list.
### This saves us doubling up on checks for the same outcome.
if = {
limit = {
NOT = { exists = scope:target }
}
ordered_relation = {
type = potential_rival
order_by = "opinion(scope:employer_ref)"
limit = { valid_laamp_contract_foe_trigger = yes }
save_scope_as = target
}
}
# Then get peer vassals (if we're not independent).
if = {
limit = {
NOT = { exists = scope:target }
top_liege != this
}
liege = {
ordered_vassal = {
limit = { valid_laamp_contract_foe_trigger = yes }
order_by = "opinion(scope:employer_ref)"
save_scope_as = target
}
}
}
# Or neighbouring rulers otherwise.
if = {
limit = {
NOT = { exists = scope:target }
}
ordered_neighboring_and_across_water_top_liege_realm_owner = {
limit = {
valid_laamp_contract_foe_trigger = yes
# Make sure that we don't have barons putting out hits on emperors.
highest_held_title_tier <= {
value = scope:employer_ref.highest_held_title_tier
add = 2
}
}
order_by = "opinion(scope:employer_ref)"
save_scope_as = target
}
}
# For the AI we grab a pool character
if = {
limit = {
NOT = { exists = scope:target }
any_pool_character = {
province = location
is_physically_able_ai_adult = yes
}
}
save_scope_as = value_target
random_pool_character = {
province = location
limit = {
is_physically_able_ai_adult = yes
}
save_scope_as = target
}
}
# Then we just spawn someone.
if = {
limit = {
NOT = { exists = scope:target }
}
save_scope_as = value_target
create_character = {
template = bandit_character_generic
faith = scope:employer_ref.capital_county.faith
rite = scope:employer_ref.capital_county.rite
culture = scope:employer_ref.capital_county.culture
location = scope:employer_ref.capital_county.title_province
gender_female_chance = scope_value_target_soldier_female_chance
dynasty = none
save_scope_as = target
after_creation = {
add_opinion = {
target = scope:employer_ref
modifier = hate_opinion
opinion = -50
}
reverse_add_opinion = {
target = scope:employer_ref
modifier = hate_opinion
opinion = -50
}
}
}
}
# Plus, set up a grudge from our employer.
scope:employer_ref = {
set_random_rivalry_reason = {
TARGET = scope:target
RELATION = grudge
}
}
# Finally, log them to the contract.
scope:task_contract = {
set_variable = {
name = target
value = scope:target
}
}
}As written in game/common/scripted_effects/00_laamp_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls laamp_contract_grab_suitable_rival_for_disposal_effect.
Task contracts (3)
- laamp_base_3011
- laamp_base_3021
- laamp_base_3031
Source: game/common/scripted_effects/00_laamp_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.