CK3 DatabaseCrusader Kings III · 1.20.1.2 “Crozier” · unofficial
Silk & Silverout Tue, Nov 17What's free, what needs the DLC, price →

Scripted effect

ransom_interaction_effect

ransom_interaction_effect = yes

game/common/scripted_effects/00_prison_effects.txt, line 2 (233 lines). No parameters.

ransom_interaction_effect is a scripted effect in Crusader Kings III, written at line 2 of its file. It takes no parameters: ransom_interaction_effect = yes. The game's script calls it in 5 places, among them Pay Ransom (interaction), Ransom (interaction) and Ransom Yourself (interaction). Patch 1.20.1.2, from game/common/scripted_effects/00_prison_effects.txt.

The comment above it in the file

the effect used in all ransom interactions

What it does

  • scope:prisoner:
    • If

      a check the game hides

      Then

      • If

        • scope:payer: Is played by a person
        • scope:prisoner: Is played by the AI

        Then

        • Opinion: Ransomed Recently for 1 year
        • If

          • Is played by the AI
          • Ai honor at least 25
          • Ai greed at most 0

          Then

          • scope:payer:
            • If

              • can_add_hook = { target = scope:prisoner type = favor_hook }

              Then

              • add_hook = { target = scope:prisoner type = indebted_hook }

          Otherwise

  • scope:payer:
    • Depending on always:
      • When always is scope:extortionate gold:
      • When always is scope:extortionate current gold:
      • When always is scope:gold:
      • When always is scope:current gold:
    • If

      • scope:favor = yes

      Then

      • If

        • scope:payer = scope:prisoner

        Then

        • Opinion: Demanded a Hook
      • scope:imprisoner:
        • add_hook = { target = scope:payer type = favor_hook }
    • If

      • scope:influence_send_option = yes

      Then

      • scope:payer:
        • change_influence = { … }
      • scope:imprisoner: Influence changes
    • If

      • scope:herd_send_option = yes

      Then

      • scope:payer:
        • pay_herd = { target = scope:imprisoner value = scope:prisoner.ransom_herd_value }

      Else if

      • scope:current_herd = yes

      Then

      • scope:payer:
        • pay_herd = { target = scope:imprisoner value = domicile.herd }
  • pam_philanthropia_ransom_payer_effect = yes
  • scope:prisoner:
    • release_from_prison = yes

• 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)
ransom_interaction_effect = {
	# For mass actions where an option is not selected manually
	if = {
		limit = {
			NOR = {
				scope:influence_send_option = yes
				scope:herd_send_option = yes
				scope:current_herd = yes
				scope:extortionate_current_gold = yes
				scope:extortionate_gold = yes
				scope:gold = yes
				scope:current_gold = yes
				scope:favor = yes
				scope:hook ?= yes
			}
			#This should not trigger if you're manually ransoming yourself
			exists = scope:payer
		}
		save_scope_value_as = {
			name = ransom_saved_gold_value
			value = scope:payer.current_gold_value
		}
		if = {
			limit = {
				scope:imprisoner.dynasty ?= { has_dynasty_perk = fp1_pillage_legacy_3 }
				scope:payer.gold >= scope:prisoner.increased_ransom_cost_value
			}
			save_scope_value_as = { name = extortionate_gold value = yes }
		}
		else_if = {
			limit = {
				scope:imprisoner.dynasty ?= { has_dynasty_perk = fp1_pillage_legacy_3 }
				scope:payer.gold < scope:prisoner.increased_ransom_cost_value
				scope:payer.gold >= 1
			}
			save_scope_value_as = { name = extortionate_current_gold value = yes }
		}
		else_if = {
			limit = { scope:payer.gold >= scope:prisoner.normal_ransom_cost_value }
			save_scope_value_as = { name = gold value = yes }
		}
		else_if = {
			limit = {
				scope:payer.gold < scope:prisoner.normal_ransom_cost_value
				scope:payer.gold >= 1
			}
			save_scope_value_as = { name = current_gold value = yes }
		}
		else = {
			save_scope_value_as = { name = favor value = yes }
		}
	}
	scope:prisoner = {
		add_character_flag = { #To make sure you don't get spammed about the release
			flag = block_for_prison_release_notification
			days = 1
		}
		if = { # no opinion if you ransomed yourself
			limit = { this != scope:payer }
			if = { #Only visible if a player is involved
				limit = {
					scope:payer = { is_ai = no }
					scope:prisoner = { is_ai = yes }
				}
				add_opinion = {
					modifier = ransomed_from_prison
					target = scope:payer
					years = 1
				}
				if = {
					limit = {
						is_ai = yes
						ai_honor >= 25
						ai_greed <= 0
					}
					scope:payer = {
						if = {
							limit = {
								can_add_hook = {
									target = scope:prisoner 
									type = favor_hook
								}
							}
							add_hook = {
								target = scope:prisoner 
								type = indebted_hook
							}
						}
					}
				}
				else = {
					scope:payer = {
						progress_towards_hook_effect = {
							CHARACTER = scope:prisoner
							HOOK_TYPE = indebted_hook
						}
					}
				}
			}
			else = {
				hidden_effect = {
					if = {
						limit = {
							is_ai = yes
							ai_honor >= 25
							ai_greed <= 0
						}
						scope:payer = {
							if = {
								limit = {
									can_add_hook = {
										target = scope:prisoner 
										type = favor_hook
									}
								}
								add_hook = {
									target = scope:prisoner 
									type = indebted_hook
								}
							}

As written in game/common/scripted_effects/00_prison_effects.txt.

The first 120 of its 233 lines; the rest is in game/common/scripted_effects/00_prison_effects.txt from line 2.

Where it is used

Every place in common/, events/ and history/ that calls ransom_interaction_effect.

Source: game/common/scripted_effects/00_prison_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.

Spotted a mistake on this page?