decisions = {
	# Create Aztec Warrior Lodge - Doesn't exist until reformation.
	create_warrior_lodge_aztec = {
		only_playable = yes
		is_high_prio = yes
		ai_check_interval = 120 #check only once every 120 months.
		
		potential = {
			NOT = {
				has_global_flag = flag_reformed_shorn_ones_lodge
			}
			NOT = {
				has_alternate_start_parameter = { key = religion_names value = random }
			}
			has_dlc = "Holy Fury"
			age = 16
			NOT = { has_religion_feature = religion_peaceful }
			religion = aztec_reformed
			NOT = { 
				warrior_lodge_aztec = {
					society_has_members = yes								
				}
			}
		}
		
		allow = {
			is_in_society = no
			NOT = { trait = incapable }
			has_education_martial_trigger = yes
			higher_tier_than = DUKE
			martial = 15
			is_inaccessible_trigger = no
			scaled_wealth = 0.75
			prestige = 1500
		}
		
		effect = {
			scaled_wealth = -0.75
			prestige = -1500
			custom_tooltip = { text = create_warrior_lodge_aztec_tooltip }
			hidden_tooltip = {
				set_global_flag = flag_reformed_shorn_ones_lodge 
				join_society = warrior_lodge_aztec
				set_society_grandmaster = yes # Set character as Grand Master
				add_society_currency_massive_effect = yes
					spawn_good_commander_effect = yes
					new_character = { join_society = warrior_lodge_aztec }
					spawn_good_commander_effect = yes
					new_character = { join_society = warrior_lodge_aztec }
					spawn_good_commander_effect = yes
					new_character = { join_society = warrior_lodge_aztec }
					spawn_good_commander_effect = yes
					new_character = { join_society = warrior_lodge_aztec }
					spawn_good_commander_effect = yes
					new_character = { join_society = warrior_lodge_aztec }
					spawn_good_commander_effect = yes
					new_character = { join_society = warrior_lodge_aztec }
				any_vassal = {
					limit = {
						ai = yes
						can_join_society = warrior_lodge_aztec
					}
					random = { chance = 75 join_society = warrior_lodge_aztec }
				}
				any_neighbor_independent_ruler = {
					limit = {
						ai = yes
						can_join_society = warrior_lodge_aztec
					}
					random = { chance = 35 join_society = warrior_lodge_aztec }
				}
				any_player = {
					limit = {
						OR = {
							religion = aztec_reformed
							is_within_diplo_range = ROOT
						}
					}
					narrative_event = { id = AZC.25026 }
				}
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 1
		}
	}
}

society_decisions = {
	warrior_lodge_aztec_battle_trance = {
		is_in_society = yes
		ai_check_interval = 12 #check only once every 12 months.
		potential = {
			has_dlc = "Holy Fury"
			is_playable = yes
			is_adult = yes
			society_member_of = warrior_lodge_aztec
			society_rank >= 2
			religion = aztec_reformed
		}
		allow = {
			has_society_currency_minor_trigger = yes
			is_inaccessible_trigger = no
			NOT = { trait = incapable }
			custom_tooltip = { 
				text = tooltip_aztec_battle_trance_cooldown
				hidden_tooltip = { 
					NOR = { 
						has_character_modifier = lodge_aztec_battle_trance_1
						has_character_modifier = lodge_aztec_battle_trance_2
						has_character_modifier = lodge_aztec_battle_trance_3
						has_character_flag = flag_picking_battle_trance
					} 
				} 
			}
		}
		effect = {
			detract_society_currency_minor_effect = yes
			custom_tooltip = { text = tooltip_aztec_battle_trance }
			set_character_flag = flag_picking_battle_trance
			hidden_tooltip = { 
				character_event = { id = AZC.25006 }
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0.1
			modifier = {
				factor = 0.5
				trait = stubborn
			}
			modifier = {
				factor = 0
				trait = craven
			}
			modifier = {
				factor = 0
				is_ill = yes
			}
			modifier = { #I am losing the war, help!
				factor = 10
				any_war = {
					defender = { character = ROOT }
					attacker = {
						war_score = -50
					}
				}
			}
			modifier = { #I am winning the war, no need!
				factor = 0
				any_war = {
					defender = { character = ROOT }
					attacker = {
						war_score = 50
					}
				}
			}
			modifier = {
				factor = 0
				war = no
			}
			modifier = {
				factor = 2
				trait = zealous
			}
			modifier = {
				factor = 3
				trait = brave
			}
		}
	}
}