Scripted effect
create_artifact_sword_goujian_effect
create_artifact_sword_goujian_effect = { OWNER = … }game/common/scripted_effects/01_exp1_historical_artifacts_creation_effect.txt, line 2538 (114 lines). Parameters: $OWNER$.
create_artifact_sword_goujian_effect is a scripted effect in Crusader Kings III, written at line 2538 of its file. A call passes 1 parameter: OWNER. The game's script calls it in 1 place, among them inspiration_adventure_create_artifact_effect (scripted effect). Patch 1.20.1.2, from game/common/scripted_effects/01_exp1_historical_artifacts_creation_effect.txt.
What it does
set_artifact_rarity_illustrious = yes- 1 of 3 things will happen:
- 33%: Nothing else happens
- 33%: Nothing else happens
- 33%: Nothing else happens
- “Sword of Gujian” Artifact is created
- scope:newly_created_artifact › 1 of 8 things will happen:
- 13%:
add_artifact_modifier = goujian_sword_1_modifier
- 13%:
add_artifact_modifier = goujian_sword_2_modifier
- 13%:
add_artifact_modifier = goujian_sword_3_modifier
- 13%:
add_artifact_modifier = goujian_sword_4_modifier
- 13%:
add_artifact_modifier = goujian_sword_5_modifier
- 13%:
add_artifact_modifier = goujian_sword_6_modifier
- 13%:
add_artifact_modifier = goujian_sword_7_modifier
- 13%:
add_artifact_modifier = goujian_sword_8_modifier
- 13%:
If
scope:goujian_sword_name = flag:refulgence
Then
scope:gujian_sword:set_artifact_description = artifact_sword_goujian_refulgence
If
scope:goujian_sword_name = flag:purity
Then
scope:gujian_sword:set_artifact_description = artifact_sword_goujian_purity
• 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 (114 lines of game script)
create_artifact_sword_goujian_effect = {
# Get the character the artifact is being made for.
$OWNER$ = { save_scope_as = owner }
# Not really used, but if we don't set the scopes we get errors in the feature selection
set_artifact_rarity_illustrious = yes
# Identify which sword it is
random_list = {
10 = {
trigger = {
NOT = {
any_artifact = {
has_variable = sword_goujian_purity
}
}
}
save_scope_value_as = {
name = goujian_sword_name
value = flag:purity
}
}
10 = {
trigger = {
NOT = {
any_artifact = {
has_variable = sword_goujian_refulgence
}
}
}
save_scope_value_as = {
name = goujian_sword_name
value = flag:refulgence
}
set_variable = sword_goujian_refulgence
}
10 = {
#Nothing
}
}
# Create the artifact
create_artifact = {
name = artifact_sword_goujian_name
description = artifact_sword_goujian
type = pedestal
visuals = tgp_sword_of_goujian
wealth = scope:wealth
quality = scope:quality
template = sword_goujian_template
history = {
type = created_before_history
}
modifier = goujian_sword_modifier
save_scope_as = newly_created_artifact
decaying = no
}
scope:newly_created_artifact = {
set_variable = { name = historical_unique_artifact value = yes }
set_variable = sword_of_goujian
save_scope_as = gujian_sword
random_list = {
pick = 2
unique = yes
10 = {
add_artifact_modifier = goujian_sword_1_modifier
}
10 = {
add_artifact_modifier = goujian_sword_2_modifier
}
10 = {
add_artifact_modifier = goujian_sword_3_modifier
}
10 = {
add_artifact_modifier = goujian_sword_4_modifier
}
10 = {
add_artifact_modifier = goujian_sword_5_modifier
}
10 = {
add_artifact_modifier = goujian_sword_6_modifier
}
10 = {
add_artifact_modifier = goujian_sword_7_modifier
}
10 = {
add_artifact_modifier = goujian_sword_8_modifier
}
}
}
if = {
limit = {
exists = scope:goujian_sword_name
scope:goujian_sword_name = flag:refulgence
}
scope:gujian_sword = {
set_artifact_description = artifact_sword_goujian_refulgence
set_variable = sword_goujian_refulgence
}
}
if = {
limit = {
exists = scope:goujian_sword_name
scope:goujian_sword_name = flag:purity
}
scope:gujian_sword = {
set_artifact_description = artifact_sword_goujian_purity
set_variable = sword_goujian_purity
}
}
scope:gujian_sword = {
save_scope_as = epic
}
}As written in game/common/scripted_effects/01_exp1_historical_artifacts_creation_effect.txt.
Where it is used
Every place in common/, events/ and history/ that calls create_artifact_sword_goujian_effect.
Scripted effects (1)
Source: game/common/scripted_effects/01_exp1_historical_artifacts_creation_effect.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.