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

Scripted effect

ai_conqueror_yearly_effect

ai_conqueror_yearly_effect = yes

game/common/scripted_effects/00_ai_conqueror_effects.txt, line 1 (866 lines). No parameters.

ai_conqueror_yearly_effect is a scripted effect in Crusader Kings III, written at line 1 of its file. It takes no parameters: ai_conqueror_yearly_effect = yes. The game's script calls it in 1 place, among them Conqueror (story cycle). Patch 1.20.1.2, from game/common/scripted_effects/00_ai_conqueror_effects.txt.

What it does

  • If

    Then

    • If

      a check the game hides

      Then

      • move_budget_gold = { gold = long_term_gold from = budget_long_term to = budget_short_term }
      • move_budget_gold = { gold = war_chest_gold from = budget_war_chest to = budget_short_term }
      • If has Treasury:
        • move_budget_treasury = { treasury = long_term_treasury from = budget_long_term to = budget_short_term }
        • move_budget_treasury = { treasury = war_chest_treasury from = budget_war_chest to = budget_short_term }

      Otherwise

      • move_budget_gold = { gold = long_term_gold from = budget_long_term to = budget_war_chest }
      • move_budget_gold = { gold = short_term_gold from = budget_short_term to = budget_war_chest }
      • move_budget_gold = { gold = long_term_gold from = budget_long_term to = budget_short_term }
      • If has Treasury:
        • move_budget_treasury = { treasury = long_term_treasury from = budget_long_term to = budget_war_chest }
        • move_budget_treasury = { treasury = short_term_treasury from = budget_short_term to = budget_war_chest }
        • move_budget_treasury = { treasury = long_term_treasury from = budget_long_term to = budget_short_term }
    • If

      • can_execute_decision = mpo_become_greatest_of_khans_decision

      Then

      • execute_decision = mpo_become_greatest_of_khans_decision
    • If

      • can_execute_decision = nomad_higher_tier_title_decision

      Then

      • execute_decision = nomad_higher_tier_title_decision
    • If

      a check the game hides

      Then

      • If

        • Is at not War
        • war_chest_gold < war_chest_gold_maximum
        • NOT = { has_focus = stewardship_wealth_focus }

        Then

        • set_focus = stewardship_wealth_focus

        Else if

        • Is at not War
        • One of these

        • NOT = { has_focus = diplomacy_majesty_focus }
        • Does not have the Trait: August

        Then

        • set_focus = diplomacy_majesty_focus

        Else if

        • Is at not War
        • intrigue >= martial
        • Intrigue at least 12
        • NOT = { has_focus = intrigue_skulduggery_focus }
        • Does not have the Trait: Schemer

        Then

        • set_focus = intrigue_skulduggery_focus

        Else if

        • is_commanding_army = yes
        • NOT = { has_focus = martial_chivalry_focus }

        Then

        • set_focus = martial_chivalry_focus

        Else if

        • NOT = { has_focus = martial_authority_focus }
        • Any held title:

        Then

        • set_focus = martial_authority_focus

        Else if

        • NOT = { has_focus = martial_strategy_focus }

        Then

        • set_focus = martial_strategy_focus
    • If

      • Any scheme:
        • is_scheme_exposed = yes

      Then

      • Every scheme:
        • Where:
          • is_scheme_exposed = yes
        • end_scheme = yes
    • If

      • Ai honor less than 50
      • One of these

        • None of these

          • Any scheme:
            • One of these

              • scheme_type = murder
              • or

                scheme_type = abduct
              • or

                scheme_type = claim_throne
              • or

                scheme_type = fabricate_hook
        • or

          All of these

          • Has the Twice Schemed Perk
          • Scheme (less than 2):
            • One of these

              • scheme_type = murder
              • or

                scheme_type = abduct
              • or

                scheme_type = claim_throne
              • or

                scheme_type = fabricate_hook

      Then

      • Every targeting faction:
        • Where › scope:root_scope:
          • can_start_scheme = { type = murder target_character = scope:faction_in_question.special_character }
        • faction_type = claimant_faction
      • If

        a check the game hides

        Then

        • start_scheme = { type = murder target_character = scope:murder_target }
    • If

      • Any scheme:
        • is_scheme_exposed = yes

      Then

      • Every scheme:
        • Where:
          • is_scheme_exposed = yes
        • end_scheme = yes
    • If

      • Has the Truth is Relative Perk
      • One of these

        • None of these

          • Any scheme:
            • One of these

              • scheme_type = murder
              • or

                scheme_type = abduct
              • or

                scheme_type = claim_throne
              • or

                scheme_type = fabricate_hook
        • or

          All of these

          • Has the Twice Schemed Perk
          • Scheme (less than 2):
            • One of these

              • scheme_type = murder
              • or

                scheme_type = abduct
              • or

                scheme_type = claim_throne
              • or

                … (more in the script below)
    • … (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)
ai_conqueror_yearly_effect = {
	if = {
		limit = {
			has_variable = conqueror
			top_liege = this
		}
		save_scope_as = root_scope
		
		###### BUDGETING
		if = {
			limit = {
				is_at_war = no
				years_from_game_start >= 5
				NOT = {
					has_character_flag = conqueror_anti_pacing_flag
				}
				primary_title = { title_held_years >= 3 } # Do not go into buildup mode if there's a brother you need to destroy immediately!
				OR = {
					any_neighboring_and_across_water_top_liege_realm_owner = {
						count = all
						current_military_strength >= scope:root_scope.max_military_strength
						NOR = {
							is_allied_to = scope:root_scope
							has_relation_friend = scope:root_scope
							has_relation_lover = scope:root_scope
						}
					}
					any_neighboring_and_across_water_top_liege_realm_owner = {
						count >= 2
						current_military_strength >= scope:root_scope.max_military_strength
						NOR = {
							is_allied_to = scope:root_scope
							has_relation_friend = scope:root_scope
							has_relation_lover = scope:root_scope
						}
					}
					any_vassal = {
						joined_faction ?= {
							faction_power >= faction_power_halfway_threshold
						}
					}
					AND = {
						NOT = { ai_should_get_conqueror_bonuses = yes } # They have a 75% discount
						monthly_character_income_minus_expenses > half_monthly_character_income # Try to spend at least 50% of income on MaA!
					}
				}
			}
			add_character_flag = { # Conquerors should sometimes spend on MaA, if there are strong neighbours
				flag = conqueror_pacing_flag
				years = 3
			}
			add_character_flag = {
				flag = conqueror_anti_pacing_flag
				years = 10
			}
		}
		if = {
			limit = {
				has_character_flag = conqueror_pacing_flag
			}
			move_budget_gold = { gold = long_term_gold from = budget_long_term to = budget_short_term }
			move_budget_gold = { gold = war_chest_gold from = budget_war_chest to = budget_short_term }
			if = {
				limit = {
					has_treasury = yes
				}
				move_budget_treasury = { treasury = long_term_treasury from = budget_long_term to = budget_short_term }
				move_budget_treasury = { treasury = war_chest_treasury from = budget_war_chest to = budget_short_term }
			}
		}
		else = { # Conquerors are special; they don't care about states or eras - they just want to conquer, and put their resources towards just that.
			move_budget_gold = { gold = long_term_gold from = budget_long_term to = budget_war_chest }
			move_budget_gold = { gold = short_term_gold from = budget_short_term to = budget_war_chest }
			# Conquerors have no concern for the future; only here and now matters
			move_budget_gold = { gold = long_term_gold from = budget_long_term to = budget_short_term }
			if = {
				limit = {
					has_treasury = yes
				}
				move_budget_treasury = { treasury = long_term_treasury from = budget_long_term to = budget_war_chest }
				move_budget_treasury = { treasury = short_term_treasury from = budget_short_term to = budget_war_chest }
				# Conquerorstreasurye no treasuryern for the future; only here and now matters
				move_budget_treasury = { treasury = long_term_treasury from = budget_long_term to = budget_short_term }
			}
		}
		
		###### IMPORTANT DECISIONS
		if = {
			limit = {
				can_execute_decision = mpo_become_greatest_of_khans_decision
			}
			execute_decision = mpo_become_greatest_of_khans_decision
		}
		if = {
			limit = {
				can_execute_decision = nomad_higher_tier_title_decision
			}
			execute_decision = nomad_higher_tier_title_decision
		}
		
		###### LIFESTYLES
		if = { # Conquerors change lifestyle focus to suit their needs
			limit = {
				NOT = { has_character_flag = ai_focus_cd } # No cheating!
			}
			if = {
				limit = {
					is_at_war = no
					war_chest_gold < war_chest_gold_maximum
					NOT = { has_focus = stewardship_wealth_focus }
				}
				set_focus = stewardship_wealth_focus
				add_character_flag = {
					flag = ai_focus_cd
					years = 5
				}
			}
			else_if = { # Prestige is important for CB's
				limit = {
					is_at_war = no

As written in game/common/scripted_effects/00_ai_conqueror_effects.txt.

The first 120 of its 866 lines; the rest is in game/common/scripted_effects/00_ai_conqueror_effects.txt from line 1.

Where it is used

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

Story cycles (1)

  • Conqueror

Source: game/common/scripted_effects/00_ai_conqueror_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?