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
can_contract_disease_trigger = { DISEASE = $DISEASE$ }
Then
If
One of these
scope:disease_type = flag:illor
scope:disease_type = flag:pneumonicor
scope:disease_type = flag:gout_riddenor
scope:disease_type = flag:leperor
scope:disease_type = flag:canceror
scope:disease_type = flag:ergotism
Then
If
One of these
scope:disease_type = flag:smallpoxor
scope:disease_type = flag:measlesor
scope:disease_type = flag:dysenteryor
scope:disease_type = flag:bubonic_plagueor
scope:disease_type = flag:typhusor
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
- Gains the modifier “Anointed with Holy Oil” for 2 years
- Disease Resistance (Health) +0.25
- Stress Loss +10%
- Spiritual fulfillment +5
- Stress and fulfillment impact: -15
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
One of these
scope:disease_type = flag:early_great_poxor
scope:disease_type = flag:great_pox
Then
- Event health.1109 (after 730–5475 days)
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)
Else if
One of these
scope:disease_type = flag:pneumonicor
scope:disease_type = flag:typhusor
scope:disease_type = flag:consumptionor
scope:disease_type = flag:measlesor
scope:disease_type = flag:dysenteryor
scope:disease_type = flag:smallpoxor
scope:disease_type = flag:bubonic_plague
Then
epilepsy_fever_risk_effect = { CHANCE = 5 }
- … (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)
- … A Journey's End?
health.1001 - … Rasping Cough
pilgrimage.2009 - … Sickness
pilgrimage.2008 - … Tears of …
pilgrimage.3001 - …: Murder Rival
tournament_events.6012 - …: The End of a Journey?
health.1002
68 more
- …: The End of a Journey?
health.1003 - …: The End of a Journey?
health.1004 - …: The End of a Journey?
health.1005 - …: The End of a Journey?
health.1006 - …: The End of a Journey?
health.1007 - …: The End of a Journey?
health.1008 - …: The End of a Journey?
health.1012 - …: The End of a Journey?
health.1013 - …: The End of a Journey?
health.1010 - …: The End of a Journey?
health.1011 - …: The End of a Journey?
health.1015 - …: The End of a Journey?
health.1016 - …: The End of a Journey?
health.1017 - A Flavorful Combination
host_dinner_events.3140 - A Little Tickle
epidemic_events.5907 - A Local Delicacy
host_dinner_events.3003 - A Lowly Delicacy
travel_events.4019 - A Missing Village
stewardship_domain_special.1425 - A Test of Loyalty
bp1_yearly.7010 - Adorcism
religious_decision.0002 - Alms
physician_epidemic_events.1040 - As Scavengers Gather
natural_disaster_flavor_events.0001 - At the Mercy of the Elements
ecumenical_council_summons_events.0030 - Bad Air
ep3_laamps_provisions.1060 - bookmark.0001
- Carrion Eaters
ep3_laamp_flavor.0001 - Caught Outside
travel_events_bp3.5 - Danger: Flawed Fare
travel_danger_events.6030 - Danger: Runaway or Lost?
travel_danger_events.1013 - Danger: Serpent!
travel_danger_events.7000 - Danger: The Rigors of Travel
travel_danger_events.4010 - Danger: Under the Weather
travel_danger_events.6040 - Dreams of Destruction
fp2_struggle.1050 - Foreign Fruits
ep3_laamps.8070 - Healing Hands
epidemic_events.5003 - Hollow
dungeon_ongoing.9002 - Ill Omens
ach_coronation.0026 - Inside
dungeon_ongoing.9001 - Inspiration: Fickle Fillip
fund_inspiration.2130 - Legitimate Stupors
ach_coronation.0028 - Mandala Ritual: Diseased Spirits
tgp_east_asia_mandala_task_contract_events.2400 - Mandala Ritual: Eightfold Path
tgp_east_asia_mandala_task_contract_events.3700 - Mandala Ritual: River Ritual
tgp_east_asia_mandala_task_contract_events.1800 - Mandala Ritual: Sacred Heifer
tgp_east_asia_mandala_task_contract_events.1300 - Mandala Ritual: Sprouting Flowers
tgp_east_asia_mandala_task_contract_events.1700 - Mandala Ritual: The First Seed
tgp_east_asia_mandala_task_contract_events.1200 - Murder:
intrigue_scheme_ongoing.3003 - Mystical Communion: Something Wrong
mystic_lifestyle.1007 - Nary a Drop
ep3_laamps.8060 - pam_holy_myron.0010
- Qanats of …
travel_events_fp3.0021 - Secrets of the Body
learning_medicine_special.1003 - Secrets of the Body
learning_medicine_special.1103 - Secrets of the Body
learning_medicine_special.1006 - Shelter from the Storm
bp1_yearly.0100 - Strayed in the Night
mpo_nomad_events.1070 - The "Love Potion"
seduce_ongoing.2006 - The "Love Potion"
seduce_ongoing.2007 - The Bounty of …
ep3_decisions_event.7000 - The Language of the People
bp2_adult_education.1010 - The Tunnel
intrigue_scheme_ongoing.5010 - Troublemaker: A Turbulent …
ep3_contract_event.0560 - Turned Away
ep3_camp_party.1021 - Under the Table
feast_default.6510 - Unhealthy Relations
relation_upgrade.2101 - Unhealthy Relations
relation_upgrade.2102 - Weakening Body
ep3_laamps_provisions.1040 - Weary
birth.3041
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.