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

Scripted effect

contract_disease_effect

contract_disease_effect = { DISEASE = … TREATMENT_EVENT = … }

game/common/scripted_effects/20_health_effects.txt, line 127 (521 lines). Parameters: $DISEASE$, $TREATMENT_EVENT$.

contract_disease_effect is a scripted effect in Crusader Kings III, written at line 127 of its file. A call passes 2 parameters: DISEASE and TREATMENT_EVENT. The game's script calls it in 105 places, among them courtier_got_sick (activity pulse), … A Journey's End? (event health.1001) and … Rasping Cough (event pilgrimage.2009). Patch 1.20.1.2, from game/common/scripted_effects/20_health_effects.txt.

The comment above it in the file

Adds the disease in question and sends notifications to everyone who should know. Checks validity and sends treatment event. Needs the arguments DISEASE (trait name, only exception is early_great_pox - it should be added as great_pox and then the effect will figure out whether the character should have early_great_pox first) and TREATMENT_EVENT (yes/no). Does NOT send an event to the character who gets the disease.

What it does

  • If

    Then

    • If

      • One of these

        • scope:disease_type = flag:ill
        • or

          scope:disease_type = flag:pneumonic
        • or

          scope:disease_type = flag:gout_ridden
        • or

          scope:disease_type = flag:leper
        • or

          scope:disease_type = flag:cancer
        • or

          scope:disease_type = flag:ergotism

      Then

      • If

        • scope:disease_type = flag:pneumonic
        • Has the Trait: Ill

        Then

      • add_trait_force_tooltip = $DISEASE$
    • If

      • One of these

        • scope:disease_type = flag:smallpox
        • or

          scope:disease_type = flag:measles
        • or

          scope:disease_type = flag:dysentery
        • or

          scope:disease_type = flag:bubonic_plague
        • or

          scope:disease_type = flag:typhus
        • or

          scope:disease_type = flag:consumption

      Then

      • add_trait_force_tooltip = $DISEASE$

      Else if

      • scope:disease_type = flag:lovers_pox

      Then

      • add_trait_force_tooltip = lovers_pox

      Else if

      • scope:disease_type = flag:early_great_pox

      Then

      • add_trait_force_tooltip = early_great_pox

      Else if

      • scope:disease_type = flag:great_pox

      Then

      • add_trait_force_tooltip = great_pox
    • If

      • The Personal Tenets unlock tenet holy myron unction bonus
      • Does not have the Modifier: Anointed with Holy Oil
      • NOT = { scope:disease_type = flag:lovers_pox }
      • NOT = { scope:disease_type = flag:early_great_pox }

      Then

    • If

      • scope:disease_type = flag:ill

      Then

      • Event health.1101 (after ill_recovery_min–ill_recovery_max days)

      Else if

      • scope:disease_type = flag:pneumonic

      Then

      • Event health.1102 (after pneumonic_recovery_min–pneumonic_recovery_max days)

      Else if

      • scope:disease_type = flag:gout_ridden

      Then

      • 25% chance of: Event health.1103 (after gout_ridden_recovery_min–gout_ridden_recovery_max days)

      Else if

      • scope:disease_type = flag:typhus

      Then

      Else if

      • scope:disease_type = flag:consumption

      Then

      Else if

      • scope:disease_type = flag:cancer

      Then

      • 1% chance of: Event health.1107 (after 365–3650 days)

      Else if

      • One of these

        • scope:disease_type = flag:early_great_pox
        • or

          scope:disease_type = flag:great_pox

      Then

      Else if

      • scope:disease_type = flag:smallpox

      Then

      • Event health.1110 (after smallpox_min_recovery_time–smallpox_max_recovery_time days)

      Else if

      • scope:disease_type = flag:bubonic_plague

      Then

      • Event health.1111 (after bubonic_plague_min_recovery_time–bubonic_plague_max_recovery_time days)

      Else if

      • scope:disease_type = flag:measles

      Then

      • Event health.1112 (after measles_min_recovery_time–measles_max_recovery_time days)

      Else if

      • scope:disease_type = flag:dysentery

      Then

      • Event health.1113 (after dysentery_min_recovery_time–dysentery_max_recovery_time days)

      Else if

      • scope:disease_type = flag:ergotism

      Then

      • Event health.1114 (after ergotism_min_recovery_time–ergotism_max_recovery_time days)
    • If

      • scope:disease_type = flag:ill

      Then

      Else if

      • One of these

        • scope:disease_type = flag:pneumonic
        • or

          scope:disease_type = flag:typhus
        • or

          scope:disease_type = flag:consumption
        • or

          scope:disease_type = flag:measles
        • or

          scope:disease_type = flag:dysentery
        • or

          scope:disease_type = flag:smallpox
        • or

          scope:disease_type = flag:bubonic_plague

      Then

    • … (more in the script below)

• 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)
contract_disease_effect = {
	if = { #Is the disease valid?
		limit = { can_contract_disease_trigger = { DISEASE = $DISEASE$ } }

		hidden_effect = {
			#SET SCOPES
			save_scope_as = sick_character

			save_scope_value_as = {
				name = disease_type
				value = flag:$DISEASE$
			}

			save_temporary_scope_value_as = {
				name = treatment_event
				value = flag:$TREATMENT_EVENT$
			}

			if = {
				limit = { #Should I get early great pox instead of great pox?
					scope:disease_type = flag:great_pox
					NOR = {
						has_trait = lovers_pox
						has_trait = early_great_pox
					}
				}
				save_scope_value_as = {
					name = disease_type
					value = flag:early_great_pox
				}
			}

			#Data collection
			disease_data_save_contraction_effect = { DISEASE = $DISEASE$ }


			#TREATMENT EVENT
			if = {
				limit = {
					scope:treatment_event = flag:yes
				}

				trigger_event = {
					id = health.3100
					days = 5
				}
			}
			else_if = {
				limit = { scope:treatment_event = flag:no } #This is just here to stop errors
			}
			
			if = { # Disease gives xp to Infirm
				limit = {
					has_trait = infirm
					NOT = {
						scope:disease_type = flag:lovers_pox
					}
				}
				send_interface_message = {
					type = msg_health_change
					title = your_body_weakens_disease_feed_message_title
					left_icon = root
					add_trait_xp = { trait = infirm track = infirm value = 25 }
				}
			}
		}


		#NON-CONTAGIOUS DISEASES
		if = {
			limit = {
				OR = {
					scope:disease_type = flag:ill
					scope:disease_type = flag:pneumonic
					scope:disease_type = flag:gout_ridden
					scope:disease_type = flag:leper
					scope:disease_type = flag:cancer
					scope:disease_type = flag:ergotism
				}
			}

			if = { #Removes ill if progressing to pneumonia
				limit = {
					scope:disease_type = flag:pneumonic
					has_trait = ill
				}
				remove_trait = ill
			}

			add_trait_force_tooltip = $DISEASE$
		}
		
		#CONTAGIOUS DISEASES
		if = {
			limit = {
				OR = {
					scope:disease_type = flag:smallpox
					scope:disease_type = flag:measles
					scope:disease_type = flag:dysentery
					scope:disease_type = flag:bubonic_plague
					scope:disease_type = flag:typhus
					scope:disease_type = flag:consumption
				}
			}

			add_trait_force_tooltip = $DISEASE$
		}

		#STD DISEASES
		else_if = { #Lover's pox
			limit = { scope:disease_type = flag:lovers_pox }
			add_trait_force_tooltip = lovers_pox

			hidden_effect = {
				#Trigger regular contagion checks
				trigger_event = {
					id = health.1200
					days = { 60 1000 } #This first one can happen quite fast, the following checks are delayed 250-10000 days depending on traits
				}
			}

As written in game/common/scripted_effects/20_health_effects.txt.

The first 120 of its 521 lines; the rest is in game/common/scripted_effects/20_health_effects.txt from line 127.

Where it is used

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

Activity pulse actions (1)

  • courtier_got_sick

Events (74)

68 more

Scripted effects inside an event file (4)

  • contract_disease_from_wet_nurse_effect
  • court_ongoing_1110_poison_success_effect
  • haunted_mansion_healing_effect
  • pam_secular_faith_contract_disease_from_effect

History files (the start of the game) (23)

  • 102532 (characters)
  • 1359 (characters)
  • 1416 (characters)
  • 144 (characters)
  • 1783 (characters)
  • 20007 (characters)
17 more
  • 20489 (characters)
  • 20534 (characters)
  • 20626 (characters)
  • 20658 (characters)
  • 20711 (characters)
  • 20761 (characters)
  • 28019 (characters)
  • 28075 (characters)
  • 289 (characters)
  • 41568 (characters)
  • 42018 (characters)
  • 5686 (characters)
  • 6819 (characters)
  • 7060 (characters)
  • 7242 (characters)
  • 82061 (characters)
  • easteregg_olof_bjork (characters)

Source: game/common/scripted_effects/20_health_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?