Scripted effect
loan_base_effect
loan_base_effect = { AMOUNT = … DEBTOR = … LENDER = … }game/common/scripted_effects/00_scripted_effects.txt, line 445 (72 lines). Parameters: $AMOUNT$, $DEBTOR$, $LENDER$.
loan_base_effect is a scripted effect in Crusader Kings III, written at line 445 of its file. A call passes 3 parameters: AMOUNT, DEBTOR and LENDER. The game's script calls it in 2 places, among them increase_existing_loan_effect (scripted effect) and set_up_new_loan_effect (scripted effect). Patch 1.21.0, from game/common/scripted_effects/00_scripted_effects.txt.
What it does
Every line of it is script with no tooltip text: the script is below.
The script as written (72 lines of game script)
loan_base_effect = {
$DEBTOR$ = { save_temporary_scope_as = debtor_temp }
save_temporary_scope_value_as = {
name = loan_debt_temp
value = scope:debtor_temp.gdp_loan_money_full_gold_value
}
$LENDER$ = {
save_temporary_scope_as = lender_temp
# Send the dosh
custom_description = {
text = gdp_loan_gold_tt
subject = scope:lender_temp
object = scope:debtor_temp
value = $AMOUNT$
pay_short_term_gold = {
target = scope:debtor_temp
gold = $AMOUNT$
}
}
# Hook: If you don't loan the full debt amount, you only get a weak hook.
if = {
limit = {
OR = {
exists = scope:open
exists = scope:disguised
exists = scope:free
}
scope:loan_debt_temp > $AMOUNT$
}
if = {
limit = {
NOT = {
has_hook_of_type = {
target = scope:debtor_temp
type = strong_loan_hook
}
}
can_add_hook = {
target = scope:debtor_temp
type = weak_loan_hook
}
}
add_hook = {
target = scope:debtor_temp
type = weak_loan_hook
}
}
}
else_if = {
limit = {
can_add_hook = {
target = scope:debtor_temp
type = strong_loan_hook
}
}
add_hook = {
target = scope:debtor_temp
type = strong_loan_hook
}
}
# Merchant XP
if = {
limit = { is_landless_merchant = yes }
add_trait_xp = {
trait = lifestyle_merchant
track = creditor
value = lifestyle_merchant_xp_gain_minor_value
}
merchant_creditor_capstone_prestige_effect = yes
}
}
}As written in game/common/scripted_effects/00_scripted_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls loan_base_effect.
Scripted effects (2)
Source: game/common/scripted_effects/00_scripted_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.21.0.