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

Scripted effect

give_pilgrim_trait_or_xp_effect

give_pilgrim_trait_or_xp_effect = yes

game/common/scripted_effects/00_pilgrimage_effects.txt, line 216 (181 lines). No parameters.

give_pilgrim_trait_or_xp_effect is a scripted effect in Crusader Kings III, written at line 216 of its file. It takes no parameters: give_pilgrim_trait_or_xp_effect = yes. The game's script calls it in 26 places, among them Alexandria! (event pilgrimage.5031), All Roads Lead to Rome (event pilgrimage.5001) and Ayodhya (event pilgrimage.5311). Patch 1.20.1.2, from game/common/scripted_effects/00_pilgrimage_effects.txt.

The comment above it in the file

Grants you Pilgrimage trait as appropriate; if you already have the trait it either gives xp or piety. Also logs arrival in activity log for host

What it does

  • If

    Then

    • If

      a check the game hides

      Then

      • Their activity › Activity log entry › You:
        • If does not have the Trait: Pilgrim: Gains the Trait Pilgrim
        • Else, if (a hidden condition):
          • If

            • Your faith: Has “secured pilgrim routes” (a variable the game's script sets)
            • Pilgrim experience less than 100 — Prolific Pilgrim

            Then

            Otherwise

        • Else, if all of these hold:
          • Conditions:
            • has_lifestyle = learning_lifestyle
          • Then:
            • add_learning_lifestyle_xp = major_lifestyle_xp

      Otherwise

      • If does not have the Trait: Pilgrim: Gains the Trait Pilgrim
      • Else, if (a hidden condition):
        • If

          • Their faith: Has “secured pilgrim routes” (a variable the game's script sets)
          • Pilgrim experience less than 100 — Prolific Pilgrim

          Then

        • Else, if pilgrim experience less than 100 — Prolific Pilgrim: Pilgrim experience +10
        • Else, if all of these hold:
          • Conditions:
            • has_lifestyle = learning_lifestyle
          • Then:
            • add_learning_lifestyle_xp = major_lifestyle_xp

• 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)
give_pilgrim_trait_or_xp_effect = {
	if = {
		limit = { has_hajj_pilgrimage_type_trigger = no }
		if = { # Host
			limit = { this = involved_activity.activity_host }
			involved_activity = {
				add_activity_log_entry = {
					key = pilgrimage_arrived_log
					score = 50
					tags = { arrived }
					character = root
					show_in_conclusion = yes
					#Effects
					root = {
						if = {
							limit = {
								NOT = { has_trait = pilgrim }
							}
							add_trait = pilgrim
						}
						else_if = {
							if = {
								limit = {
									has_pam_dlc_trigger = yes
									faith = { has_variable = pam_secured_pilgrim_routes }
									has_trait_xp = { 
										trait = pilgrim 
										value < 100
									}
								}
								add_trait_xp = { 
									trait = pilgrim 
									value = 30
								}
							}
							else_if = {
								limit = {
									has_trait_xp = { 
										trait = pilgrim 
										value < 100
									}
								}
							}
							else = {
								add_trait_xp = { 
									trait = pilgrim 
									value = 20
								}
							}
						}
						else_if = {
							limit = { has_lifestyle = learning_lifestyle }
							add_learning_lifestyle_xp = major_lifestyle_xp
						}
						else = { add_character_flag = should_get_trait_piety }
					}
				}
			}
		}
		else = { # Non-Host
			if = {
				limit = {
					NOT = { has_trait = pilgrim }
				}
				add_trait = pilgrim
			}
			else_if = {
				if = {
					limit = {
						has_pam_dlc_trigger = yes
						faith = { has_variable = pam_secured_pilgrim_routes }
						has_trait_xp = { 
							trait = pilgrim 
							value < 100
						}
					}
					add_trait_xp = { 
						trait = pilgrim 
						value = 20
					}
				}
				else_if = {
					limit = {
						has_trait_xp = { 
							trait = pilgrim 
							value < 100 
						}
					}
					add_trait_xp = { 
						trait = pilgrim 
						value = 10
					}
				}
				else_if = {
					limit = { has_lifestyle = learning_lifestyle }
					add_learning_lifestyle_xp = major_lifestyle_xp
				}
				else = { add_character_flag = should_get_trait_piety }
			}
		}
	}
	#Add trait or xp for any people coming along as well
	if = {
		limit = {
			has_hajj_pilgrimage_type_trigger = yes
			this = involved_activity.activity_host
			current_travel_plan ?= {
				any_entourage_character = {
					religion = religion:islam_religion
					has_hajj_pilgrimage_type_trigger = yes
				}
			}
		}
		#To get the past tense loc for the Obligatory arrival
		custom_description_no_bullet = { 
			text = pilgrimage_entourage_gains_hajjaj_trait	
			hidden_effect = {
				current_travel_plan = {
					every_entourage_character = {
						if = {

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

The first 120 of its 181 lines; the rest is in game/common/scripted_effects/00_pilgrimage_effects.txt from line 216.

Where it is used

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

Events (26)

20 more

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