Scripted effect · Roads to Power files
laamp_as_mercenary_payout_effect
laamp_as_mercenary_payout_effect = yesgame/common/scripted_effects/07_dlc_ep3_scripted_effects.txt, line 11373 (59 lines). No parameters.
laamp_as_mercenary_payout_effect is a scripted effect in Crusader Kings III, in the Roads to Power files, written at line 11373 of its file. It takes no parameters: laamp_as_mercenary_payout_effect = yes. The game's script calls it in 4 places, among them on_war_invalidated (on action), on_war_white_peace (on action) and on_war_won_attacker (on action). Patch 1.20.1.2, from game/common/scripted_effects/07_dlc_ep3_scripted_effects.txt.
The comment above it in the file
If a landless adventurer was hired as a mercenary and contributed in a war they get paid, used in war_on_actions, relevant flag set by hire_laamp_mercenaries_interaction or ep3_interactions_events.0112
What it does
- scope:war › Every war participant:
- Where:
laamp_as_mercenary_payout_trigger = { WAR = scope:war }
If
laamp_as_mercenary_payout_last_war_trigger = { WAR = scope:war }
Then
- var:joined_as_mercenary: Event ep3_interactions_events.0121 (after 3–7 days)
- Where:
• 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 (59 lines of game script)
laamp_as_mercenary_payout_effect = {
scope:war = {
every_war_participant = {
limit = {
laamp_as_mercenary_payout_trigger = { WAR = scope:war }
}
if = {
limit = {
laamp_as_mercenary_payout_last_war_trigger = { WAR = scope:war }
}
save_scope_as = laamp_temp
add_to_list = laamp_mercenaries
var:joined_as_mercenary = {
save_scope_as = employer
trigger_event = {
id = ep3_interactions_events.0121
days = { 3 7 }
}
}
every_in_list = {
list = laamp_mercenaries
scope:employer = {
remove_list_variable = {
name = hired_mercenaries
target = scope:laamp_temp
}
}
}
remove_variable = joined_as_mercenary
}
else = {
save_scope_as = laamp_temp
save_scope_value_as = {
name = war_contribution_value
value = "scope:war.war_contribution(scope:laamp_temp)"
}
var:joined_as_mercenary = { save_scope_as = employer }
if = {
limit = { exists = var:aggregate_war_contribution_value }
change_variable = {
name = aggregate_war_contribution_value
add = scope:laamp_temp.ep3_hire_laamp_mercs_payment_value
}
# Average
change_variable = {
name = aggregate_war_contribution_value
divide = 2
}
}
else = {
set_variable = {
name = aggregate_war_contribution_value
value = scope:laamp_temp.ep3_hire_laamp_mercs_payment_value
}
}
}
}
}
}As written in game/common/scripted_effects/07_dlc_ep3_scripted_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls laamp_as_mercenary_payout_effect.
On actions (the game's own hooks) (4)
- on_war_invalidated
- on_war_white_peace
- on_war_won_attacker
- on_war_won_defender
Source: game/common/scripted_effects/07_dlc_ep3_scripted_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.