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

Scripted effect · The Royal Court files

get_artifact_quality_effect

get_artifact_quality_effect = yes

game/common/scripted_effects/00_ep1_artifact_creation_effects.txt, line 8 (523 lines). No parameters.

get_artifact_quality_effect is a scripted effect in Crusader Kings III, in the The Royal Court files, written at line 8 of its file. It takes no parameters: get_artifact_quality_effect = yes. The game's script calls it in 85 places, among them A Treasured Friend (event mpo_events_tova.0045), An Appeal to the Gods (event coronation_events.1039) and Armorer: Defensive Gifts (event ep2_locale_events.2011). Patch 1.20.1.2, from game/common/scripted_effects/00_ep1_artifact_creation_effects.txt.

What it does

  • If

    a check the game hides

    Then

    • If a check the game hides passes: the same again (5 lines)
      • 1 of 5 things will happen:
        • 20%: Nothing else happens
        • 20%: Nothing else happens
        • 20%: Nothing else happens
        • 20%: Nothing else happens
        • 20%: Nothing else happens
      Else if a check the game hides passes: the same again (5 lines)
      • 1 of 5 things will happen:
        • 20%: Nothing else happens
        • 20%: Nothing else happens
        • 20%: Nothing else happens
        • 20%: Nothing else happens
        • 20%: Nothing else happens

• 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)
get_artifact_quality_effect = {
	if = {
		limit = {
			NOT = { exists = scope:quality }
		}
		# Some random variance is added so artifact quality isn't completely deterministic
		if = {
			limit = {
				NOR = {
					exists = scope:inspiration_owner
					exists = scope:random_quality_bonus
				}
			}
			random_list = {
				20 = {
					save_scope_value_as = {
						name = random_quality_bonus
						value = 4
					}
				}
				20 = {
					save_scope_value_as = {
						name = random_quality_bonus
						value = 8
					}
				}
				20 = {
					save_scope_value_as = {
						name = random_quality_bonus
						value = 12
					}
				}
				20 = {
					save_scope_value_as = {
						name = random_quality_bonus
						value = 16
					}
				}
				20 = {
					save_scope_value_as = {
						name = random_quality_bonus
						value = 20
					}
				}
			}
		}
		else_if = {
			limit = {
				NOT = { exists = scope:random_inspired_skill_quality_bonus }
			}
			random_list = {
				20 = {
					save_scope_value_as = {
						name = random_inspired_skill_quality_bonus
						value = 0.5
					}
				}
				20 = {
					save_scope_value_as = {
						name = random_inspired_skill_quality_bonus
						value = 1
					}
				}
				20 = {
					save_scope_value_as = {
						name = random_inspired_skill_quality_bonus
						value = 2
					}
				}
				20 = {
					save_scope_value_as = {
						name = random_inspired_skill_quality_bonus
						value = 2.5
					}
				}
				20 = {
					save_scope_value_as = {
						name = random_inspired_skill_quality_bonus
						value = 3
					}
				}
			}
			save_scope_value_as = {
				name = random_quality_bonus
				value = 0
			}
		}

		# Calculate the final quality of the artifact
		save_scope_value_as = {
			name = quality
			value = {
				value = scope:random_quality_bonus
				
				# Cultural tradition for piety level boosting artifacts
				if = {
					limit = {
						court_owner.culture ?= {
							has_cultural_parameter = piety_level_affect_artifact_quality
						}
					}
					add = {
						value = court_owner.piety_level
						multiply = 5
					}
				}

				# Bonus Quality from the Court Owner's Amenities
				if = {
					limit = {
						court_owner ?= {
							has_royal_court = yes
							has_dlc_feature = royal_court
							amenity_level = { target = court_lodging_standards value > low_amenity_level }
						}
					}
					if = {
						limit = { court_owner = { amenity_level = { target = court_lodging_standards value >= max_amenity_level } } }
						add = 10
					}

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

The first 120 of its 523 lines; the rest is in game/common/scripted_effects/00_ep1_artifact_creation_effects.txt from line 8.

Where it is used

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

Events (12)

6 more

Scripted effects inside an event file (1)

  • tribute_mission_1000_set_artifact_reward_effect

Scripted effects (72)

66 more

Source: game/common/scripted_effects/00_ep1_artifact_creation_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?