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

Scripted effect · Silk and Silver files

destroy_merchant_effect

destroy_merchant_effect = { MERCHANT = … }

game/common/scripted_effects/gdp_merchant_scripted_effects.txt, line 2564 (92 lines). Parameters: $MERCHANT$.

destroy_merchant_effect is a scripted effect in Crusader Kings III, in the Silk and Silver files, written at line 2564 of its file. A call passes 1 parameter: MERCHANT. The game's script calls it in 6 places, among them ep3_become_landed_ennobled_penalty_effect (scripted effect), gdp_hostile_takeover_effect (scripted effect) and gdp_merchant_handover_company_for_voluntary_laamp_effect (scripted effect). Its body carries 1 text of the game's own for the player. Patch 1.21.0, from game/common/scripted_effects/gdp_merchant_scripted_effects.txt.

What it does

Every line of it is script with no tooltip text: the script is below.

The script as written (92 lines of game script)
destroy_merchant_effect = {
	$MERCHANT$ = {
		save_scope_as = the_merchant
		hidden_effect = {
			every_courtier = {
				gdp_merchant_courtier_becomes_associate_effect = yes
			}
		}
		# Liquidate Company
		custom_tooltip = {
			text = destroy_merchant_effect.tt.domicile_liquidated
			gdp_merchant_liquidate_company_effect = yes
		}
		# Destroy your main title.
		every_held_title = {
			limit = { has_variable = merchant_creation_reason }
			save_scope_as = merchant_title
			scope:the_merchant = { destroy_title = scope:merchant_title }
		}
		# The reset picks the best government for them, but administrative rulers should stay administrative, so we skip it for them
		if = {
			limit = {
				NOR = {
					government_has_flag = government_is_administrative
					government_has_flag = government_is_nomadic
					government_has_flag = government_is_steppe_admin
					government_has_flag = government_is_wanua
					government_has_flag = government_is_mandala
					government_has_flag = government_is_celestial
					government_has_flag = government_is_meritocratic
					government_has_flag = government_is_japan_feudal
				}
			}
			admin_government_reset_effect = yes #this only contains Clan, Tribal, Nomadic and Feudal
		}
		# Now we reforge any domicile artifacts
		# Artifact feature triggers read scope:owner, so it must be the merchant during reforging
		scope:owner ?= { save_scope_as = destroy_merchant_previous_owner }
		save_scope_as = owner
		if = {
			limit = {
				any_character_artifact = { artifact_type = library_item }
			}
			every_character_artifact = {
				limit = { artifact_type = library_item }
				reforge_artifact = { type = book }
			}
		}
		if = {
			limit = {
				any_character_artifact = { artifact_type = curio }
			}
			every_character_artifact = {
				limit = { artifact_type = curio }
				reforge_artifact = { type = pedestal }
			}
		}
		if = {
			limit = {
				any_character_artifact = { artifact_type = creature }
			}
			every_character_artifact = {
				limit = { artifact_type = creature }
				set_variable = {
					name = og_owner
					value = artifact_owner
				}
				# Animal skull features read the animal type from scope:owner, as set by hunts
				scope:the_merchant = {
					set_variable = {
						name = animal_type
						value = flag:none
						days = 1
					}
				}
				if = {
					limit = { has_variable = animal_type }
					scope:the_merchant = {
						set_variable = {
							name = animal_type
							value = prev.var:animal_type
							days = 1
						}
					}
				}
				reforge_creature_artifact_effect = yes
			}
			remove_variable = animal_type
		}
		scope:destroy_merchant_previous_owner ?= { save_scope_as = owner }
	}
}

As written in game/common/scripted_effects/gdp_merchant_scripted_effects.txt.

Where it is used

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

Source: game/common/scripted_effects/gdp_merchant_scripted_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.21.0.

Spotted a mistake on this page, or have an idea for the site?