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

Scripted effect · Legends of the Dead files

change_legend_quality_effect

change_legend_quality_effect = { VALUE = … }

game/common/scripted_effects/06_dlc_ce1_legend_effects.txt, line 839 (167 lines). Parameters: $VALUE$.

change_legend_quality_effect is a scripted effect in Crusader Kings III, in the Legends of the Dead files, written at line 839 of its file. A call passes 1 parameter: VALUE. The game's script calls it in 52 places, among them A … Blessing (event legend_spread_events.5005), A Bloody Heirloom (event legend_spread_events.5015) and A Deathbed Confession (event legend_spread_events.8060). Its body carries 14 texts of the game's own for the player. Patch 1.20.1.2, from game/common/scripted_effects/06_dlc_ce1_legend_effects.txt.

The comment above it in the file

Has to be run on the legend itself

What it does

  • If a check the game hides passes: the same again (12 lines)
    • If

      • $VALUE$ <= major_legend_quality_decrease

      Then

      • The discount towards upgrading your Legend decreases greatly

      Else if

      • $VALUE$ <= medium_legend_quality_decrease

      Then

      • The discount towards upgrading your Legend decreases

      Else if

      • $VALUE$ < 0

      Then

      • The discount towards upgrading your Legend decreases slightly

      Else if

      • $VALUE$ >= major_legend_quality_increase

      Then

      • The discount towards upgrading your Legend increases greatly

      Else if

      • $VALUE$ >= medium_legend_quality_increase

      Then

      • The discount towards upgrading your Legend increases

      Else if

      • $VALUE$ > 0

      Then

      • The discount towards upgrading your Legend increases slightly

    Else if

    • 100 <= { value = var:legend_quality_progress add = $VALUE$ }

    Then

    • The discount towards upgrading your Legend increases to the maximum

    Else if

    • 0 >= { value = var:legend_quality_progress add = $VALUE$ }

    Then

    • The discount towards upgrading your Legend decreases to the minimum

    Otherwise

    • If

      • $VALUE$ <= major_legend_quality_decrease

      Then

      • The discount towards upgrading your Legend decreases greatly

      Else if

      • $VALUE$ <= medium_legend_quality_decrease

      Then

      • The discount towards upgrading your Legend decreases

      Else if

      • $VALUE$ < 0

      Then

      • The discount towards upgrading your Legend decreases slightly

      Else if

      • $VALUE$ >= major_legend_quality_increase

      Then

      • The discount towards upgrading your Legend increases greatly

      Else if

      • $VALUE$ >= medium_legend_quality_increase

      Then

      • The discount towards upgrading your Legend increases

      Else if

      • $VALUE$ > 0

      Then

      • The discount towards upgrading your Legend increases slightly

• 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)
change_legend_quality_effect = {
	# Firstly, do I exist and if not, set me
	if = {
		limit = {
			NOT = { exists = var:legend_quality_progress }
		}
		if = {
			limit = {
				$VALUE$ <= major_legend_quality_decrease
			}
			custom_tooltip = major_legend_quality_decrease_tt
			set_variable = {
				name = legend_quality_progress
				value = $VALUE$
			}
		}
		else_if = {
			limit = {
				$VALUE$ <= medium_legend_quality_decrease
			}
			custom_tooltip = medium_legend_quality_decrease_tt
			set_variable = {
				name = legend_quality_progress
				value = $VALUE$
			}
		}
		else_if = {
			limit = {
				$VALUE$ < 0
			}
			custom_tooltip = minor_legend_quality_decrease_tt
			set_variable = {
				name = legend_quality_progress
				value = $VALUE$
			}
		}
		else_if = {
			limit = {
				$VALUE$ >= major_legend_quality_increase
			}
			custom_tooltip = major_legend_quality_increase_tt
			set_variable = {
				name = legend_quality_progress
				value = $VALUE$
			}
		}
		else_if = {
			limit = {
				$VALUE$ >= medium_legend_quality_increase
			}
			custom_tooltip = medium_legend_quality_increase_tt
			set_variable = {
				name = legend_quality_progress
				value = $VALUE$
			}
		}
		else_if = {
			limit = {
				$VALUE$ > 0
			}
			custom_tooltip = minor_legend_quality_increase_tt
			set_variable = {
				name = legend_quality_progress
				value = $VALUE$
			}
		}
		else = {
			set_variable = {
				name = legend_quality_progress
				value = 0
			}
		}
	}
	# Otherwise, check if the progress is going to go over 100 and if so, cap at 100
	else_if = {
		limit = {
			exists = var:legend_quality_progress
			100 <= {
				value = var:legend_quality_progress
				add = $VALUE$
			}
		}
		custom_tooltip = maximum_legend_quality_discount_reach_tt
		set_variable = {
			name = legend_quality_progress
			value = 100
		}
	}
	# Otherwise, check if the progress is going to go below 0 and if so, cap at 0
	else_if = {
		limit = {
			exists = var:legend_quality_progress
			0 >= {
				value = var:legend_quality_progress
				add = $VALUE$
			}
		}
		custom_tooltip = minimum_legend_quality_discount_reach_tt
		set_variable = {
			name = legend_quality_progress
			value = 0
		}
	}
	# Otherwise, just apply the mathematics
	else = {
		if = {
			limit = {
				$VALUE$ <= major_legend_quality_decrease
			}
			custom_tooltip = major_legend_quality_decrease_tt
			change_variable = {
				name = legend_quality_progress
				add = $VALUE$
			}
		}
		else_if = {
			limit = {
				$VALUE$ <= medium_legend_quality_decrease
			}
			custom_tooltip = medium_legend_quality_decrease_tt

As written in game/common/scripted_effects/06_dlc_ce1_legend_effects.txt.

The first 120 of its 167 lines; the rest is in game/common/scripted_effects/06_dlc_ce1_legend_effects.txt from line 839.

Where it is used

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

Events (51)

45 more

Source: game/common/scripted_effects/06_dlc_ce1_legend_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?