Scripted effect
set_court_physician_effect
set_court_physician_effect = { EMPLOYER = … PHYSICIAN = … }game/common/scripted_effects/20_health_effects.txt, line 1437 (101 lines). Parameters: $EMPLOYER$, $PHYSICIAN$.
set_court_physician_effect is a scripted effect in Crusader Kings III, written at line 1437 of its file. A call passes 2 parameters: EMPLOYER and PHYSICIAN. The game's script calls it in 2 places, among them …: (event health.3001) and learning_medicine.2021 (event). Patch 1.20.1.2, from game/common/scripted_effects/20_health_effects.txt.
What it does
Every line of it is script with no tooltip text: the script is below.
The script as written (101 lines of game script)
set_court_physician_effect = {
$PHYSICIAN$ = {
hidden_effect = {
if = {
limit = {
NOT = { liege = $EMPLOYER$ }
}
$EMPLOYER$ = { add_courtier = $PHYSICIAN$ }
}
}
}
$EMPLOYER$ = {
#Replace existing court physician if one exists
if = {
limit = {
employs_court_position = court_physician_court_position
any_court_position_holder = {
type = court_physician_court_position
count > 0
}
}
every_court_position_holder = {
type = court_physician_court_position
save_temporary_scope_as = old_physician
$EMPLOYER$ = {
replace_court_position = {
recipient = $PHYSICIAN$
holder = scope:old_physician
court_position = court_physician_court_position
}
reverse_add_opinion = {
target = scope:old_physician
modifier = disappointed_opinion
opinion = -15
}
reverse_add_opinion = {
target = $PHYSICIAN$
modifier = hired_me_opinion
}
}
}
}
#Else just straight up appoint
else = {
appoint_court_position = {
recipient = $PHYSICIAN$
court_position = court_physician_court_position
}
reverse_add_opinion = {
target = $PHYSICIAN$
modifier = hired_me_opinion
}
}
#Trigger treatments if needed
hidden_effect = {
if = {
limit = {
has_treatable_disease_trigger = yes
has_recent_treatment_trigger = no
}
save_scope_as = sick_character
trigger_event = {
id = health.3101
days = { physician_treatment_delay_ruler_min physician_treatment_delay_ruler_max }
}
}
else_if = {
limit = {
has_recent_wound_treatment_trigger = no
has_wounds_trigger = yes
}
save_scope_as = sick_character
trigger_event = {
id = health.4001
days = { physician_treatment_delay_ruler_min physician_treatment_delay_ruler_max }
}
}
every_courtier_or_guest = {
if = {
limit = {
has_treatable_disease_trigger = yes
has_recent_treatment_trigger = no
}
set_worst_disease_effect = yes
save_scope_as = sick_character
decide_who_picks_disease_treatment_effect = yes #Sends health.3101 to them or 3102 to liege (you)
}
else_if = {
limit = {
has_recent_wound_treatment_trigger = no
has_wounds_trigger = yes
}
save_scope_as = sick_character
decide_who_picks_wound_treatment_effect = yes
}
}
}
}
}As written in game/common/scripted_effects/20_health_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls set_court_physician_effect.
Events (2)
- …:
health.3001 - learning_medicine.2021
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.