qol_market_md_vehicle = {

###########################	 
###### TANKS #######	 
###########################	 


		market_buy_light_tank_enable = {


		icon = generic_form_nation
			priority = 10
 
		allowed = {
				NOT = {
					 has_country_flag = light_tank_enable_buy_qol_flag
				}
				has_country_flag = buying_vehicles_qol
		}
		available = {
				NOT = {
					 has_country_flag = light_tank_enable_buy_qol_flag
				}
				has_country_flag = buying_vehicles_qol
		}
		visible = {
			 has_country_flag = buying_vehicles_qol
				NOT = {
					 has_country_flag = light_tank_enable_buy_qol_flag
				}	 
				
		}

		cost = 0
		days_re_enable = 0
		ai_will_do = {
			factor = 0
		}
		complete_effect = {
			set_country_flag = light_tank_enable_buy_qol_flag
		}			
		}


		market_buy_light_tank_disable = {


		icon = generic_form_nation
			priority = 10
 
		allowed = {
				 has_country_flag = light_tank_enable_buy_qol_flag	
				 has_country_flag = buying_vehicles_qol
		}
		available = {
				 has_country_flag = light_tank_enable_buy_qol_flag
				 has_country_flag = buying_vehicles_qol
		}
		visible = {
			 has_country_flag = buying_vehicles_qol
			 has_country_flag = light_tank_enable_buy_qol_flag			 
		}

		cost = 0
		days_re_enable = 0
		ai_will_do = {
			factor = 0
		}
		complete_effect = {
			clr_country_flag = light_tank_enable_buy_qol_flag
		}			
		}
		

market_buy_light_tank1 = {

		icon = generic_form_nation
			priority =9
		allowed = {
		}
		available = {
			 has_country_flag = light_tank_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					light_tank_equipment_1  > 84
				}
				has_opinion = {
					target = ROOT
					value > 51
				}				
			}			 
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = light_tank_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					light_tank_equipment_1  > 84
				}			
			}			 
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					light_tank_equipment_1  > 84
				}
				has_tech = light_tank_equipment_1  				
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = light_tank_chassis           
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = light_tank_equipment_1  
					amount = -84
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = light_tank_equipment_1  
					amount = 84
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}	

market_buy_light_tank2 = {

		icon = generic_form_nation
			priority = 9
 
		allowed = {
		}
		available = {
			has_country_flag = light_tank_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
				has_country_flag = qol_accept_tanks_orders_flag
				has_equipment = {
					light_tank_equipment_2 > 2000
				}
				has_opinion = {
					target = ROOT
					value > 51
				}						
			}			 
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = light_tank_enable_buy_qol_flag
			has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					light_tank_equipment_2 > 2000
				}
				has_tech = light_tank_equipment_2
			}		
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
			
				has_country_flag = qol_accept_tanks_orders_flag
				has_equipment = {
					light_tank_equipment_2 > 2000
				}
				has_tech = light_tank_equipment_2
				has_country_flag = qol_accept_tanks_orders_flag				
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = light_tank_chassis           
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = light_tank_equipment_2
					amount = -84
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = light_tank_equipment_2
					amount = 84
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}

market_buy_light_tank3 = {

		icon = generic_form_nation
			priority = 9
 
		allowed = {
		}
		available = {
			has_country_flag = light_tank_enable_buy_qol_flag
			has_country_flag = buying_vehicles_qol
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					light_tank_equipment_3 > 2000
				}			
				has_opinion = {
					target = ROOT
					value > 51
				}					
			}			
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = light_tank_enable_buy_qol_flag		
			has_country_flag = buying_vehicles_qol
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					light_tank_equipment_3 > 2000
				}			
			}			
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
				has_country_flag = qol_accept_tanks_orders_flag
				has_equipment = {
					light_tank_equipment_3 > 2000
				}
				has_tech = light_tank_equipment_3 
				has_country_flag = qol_accept_tanks_orders_flag
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = light_tank_chassis           
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = light_tank_equipment_3 
					amount = -84
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = light_tank_equipment_3 
					amount = 84
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}


	
	
		market_buy_medium_tank_enable = {


		icon = generic_form_nation
			priority = 10
 
		allowed = {
				NOT = {
					 has_country_flag = medium_tank_enable_buy_qol_flag
				}
				has_country_flag = buying_vehicles_qol
		}
		available = {
				NOT = {
					 has_country_flag = medium_tank_enable_buy_qol_flag
				}
				has_country_flag = buying_vehicles_qol
		}
		visible = {
			 has_country_flag = buying_vehicles_qol
				NOT = {
					 has_country_flag = medium_tank_enable_buy_qol_flag
				}	 
				
		}

		cost = 0
		days_re_enable = 0
		ai_will_do = {
			factor = 0
		}
		complete_effect = {
			set_country_flag = medium_tank_enable_buy_qol_flag
		}			
		}


		market_buy_medium_tank_disable = {


		icon = generic_form_nation
			priority = 10
 
		allowed = {
				 has_country_flag = medium_tank_enable_buy_qol_flag	
				 has_country_flag = buying_vehicles_qol
		}
		available = {
				 has_country_flag = medium_tank_enable_buy_qol_flag
				 has_country_flag = buying_vehicles_qol
		}
		visible = {
			 has_country_flag = buying_vehicles_qol
			 has_country_flag = medium_tank_enable_buy_qol_flag			 
		}

		cost = 0
		days_re_enable = 0
		ai_will_do = {
			factor = 0
		}
		complete_effect = {
			clr_country_flag = medium_tank_enable_buy_qol_flag
		}			
		}
		

market_buy_medium_tank1 = {

		icon = generic_form_nation
			priority =9
		allowed = {
		}
		available = {
			 has_country_flag = medium_tank_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					medium_tank_equipment_1  > 84
				}
				has_opinion = {
					target = ROOT
					value > 51
				}				
			}			 
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = medium_tank_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					medium_tank_equipment_1  > 84
				}			
			}			 
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					medium_tank_equipment_1  > 84
				}
				has_tech = medium_tank_equipment_1  				
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = medium_tank_chassis       
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = medium_tank_equipment_1  
					amount = -84
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = medium_tank_equipment_1  
					amount = 84
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}	

market_buy_medium_tank2 = {

		icon = generic_form_nation
			priority = 9
 
		allowed = {
		}
		available = {
			has_country_flag = medium_tank_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
				has_country_flag = qol_accept_tanks_orders_flag
				has_equipment = {
					medium_tank_equipment_2 > 2000
				}
				has_opinion = {
					target = ROOT
					value > 51
				}						
			}			 
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = medium_tank_enable_buy_qol_flag
			has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					medium_tank_equipment_2 > 2000
				}
				has_tech = medium_tank_equipment_2
			}		
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
			
				has_country_flag = qol_accept_tanks_orders_flag
				has_equipment = {
					medium_tank_equipment_2 > 2000
				}
				has_tech = medium_tank_equipment_2
				has_country_flag = qol_accept_tanks_orders_flag				
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = medium_tank_chassis         
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = medium_tank_equipment_2
					amount = -84
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = medium_tank_equipment_2
					amount = 84
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}

market_buy_medium_tank3 = {

		icon = generic_form_nation
			priority = 9
 
		allowed = {
		}
		available = {
			has_country_flag = medium_tank_enable_buy_qol_flag
			has_country_flag = buying_vehicles_qol
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					medium_tank_equipment_3 > 2000
				}			
				has_opinion = {
					target = ROOT
					value > 51
				}					
			}			
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = medium_tank_enable_buy_qol_flag		
			has_country_flag = buying_vehicles_qol
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					medium_tank_equipment_3 > 2000
				}			
			}			
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
				has_country_flag = qol_accept_tanks_orders_flag
				has_equipment = {
					medium_tank_equipment_3 > 2000
				}
				has_tech = medium_tank_equipment_3 
				has_country_flag = qol_accept_tanks_orders_flag
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = medium_tank_chassis           
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = medium_tank_equipment_3 
					amount = -84
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = medium_tank_equipment_3 
					amount = 84
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}


		market_buy_heavy_tank_enable = {


		icon = generic_form_nation
			priority = 10
 
		allowed = {
				NOT = {
					 has_country_flag = heavy_tank_enable_buy_qol_flag
				}
				has_country_flag = buying_vehicles_qol
		}
		available = {
				NOT = {
					 has_country_flag = heavy_tank_enable_buy_qol_flag
				}
				has_country_flag = buying_vehicles_qol
		}
		visible = {
			 has_country_flag = buying_vehicles_qol
				NOT = {
					 has_country_flag = heavy_tank_enable_buy_qol_flag
				}	 
				
		}

		cost = 0
		days_re_enable = 0
		ai_will_do = {
			factor = 0
		}
		complete_effect = {
			set_country_flag = heavy_tank_enable_buy_qol_flag
		}			
		}


		market_buy_heavy_tank_disable = {


		icon = generic_form_nation
			priority = 10
 
		allowed = {
				 has_country_flag = heavy_tank_enable_buy_qol_flag	
				 has_country_flag = buying_vehicles_qol
		}
		available = {
				 has_country_flag = heavy_tank_enable_buy_qol_flag
				 has_country_flag = buying_vehicles_qol
		}
		visible = {
			 has_country_flag = buying_vehicles_qol
			 has_country_flag = heavy_tank_enable_buy_qol_flag			 
		}

		cost = 0
		days_re_enable = 0
		ai_will_do = {
			factor = 0
		}
		complete_effect = {
			clr_country_flag = heavy_tank_enable_buy_qol_flag
		}			
		}
		

market_buy_heavy_tank1 = {

		icon = generic_form_nation
			priority =9
		allowed = {
		}
		available = {
			 has_country_flag = heavy_tank_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					heavy_tank_equipment_1  > 84
				}
				has_opinion = {
					target = ROOT
					value > 51
				}				
			}			 
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = heavy_tank_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					heavy_tank_equipment_1  > 84
				}			
			}			 
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					heavy_tank_equipment_1  > 84
				}
				has_tech = heavy_tank_equipment_1  				
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = heavy_tank_chassis          
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = heavy_tank_equipment_1  
					amount = -84
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = heavy_tank_equipment_1  
					amount = 84
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}	

market_buy_heavy_tank2 = {

		icon = generic_form_nation
			priority = 9
 
		allowed = {
		}
		available = {
			has_country_flag = heavy_tank_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
				has_country_flag = qol_accept_tanks_orders_flag
				has_equipment = {
					heavy_tank_equipment_2 > 2000
				}
				has_opinion = {
					target = ROOT
					value > 51
				}						
			}			 
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = heavy_tank_enable_buy_qol_flag
			has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					heavy_tank_equipment_2 > 2000
				}
				has_tech = heavy_tank_equipment_2
			}		
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
			
				has_country_flag = qol_accept_tanks_orders_flag
				has_equipment = {
					heavy_tank_equipment_2 > 2000
				}
				has_tech = heavy_tank_equipment_2
				has_country_flag = qol_accept_tanks_orders_flag				
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = heavy_tank_chassis            
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = heavy_tank_equipment_2
					amount = -84
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = heavy_tank_equipment_2
					amount = 84
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}

market_buy_heavy_tank3 = {

		icon = generic_form_nation
			priority = 9
 
		allowed = {
		}
		available = {
			has_country_flag = heavy_tank_enable_buy_qol_flag
			has_country_flag = buying_vehicles_qol
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					heavy_tank_equipment_3 > 2000
				}			
				has_opinion = {
					target = ROOT
					value > 51
				}					
			}			
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = heavy_tank_enable_buy_qol_flag		
			has_country_flag = buying_vehicles_qol
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					heavy_tank_equipment_3 > 2000
				}			
			}			
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
				has_country_flag = qol_accept_tanks_orders_flag
				has_equipment = {
					heavy_tank_equipment_3 > 2000
				}
				has_tech = heavy_tank_equipment_3 
				has_country_flag = qol_accept_tanks_orders_flag
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = heavy_tank_chassis            
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = heavy_tank_equipment_3 
					amount = -84
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = heavy_tank_equipment_3 
					amount = 84
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}



		market_buy_modern_tank_enable = {


		icon = generic_form_nation
			priority = 10
 
		allowed = {
				NOT = {
					 has_country_flag = modern_tank_enable_buy_qol_flag
				}
				has_country_flag = buying_vehicles_qol
		}
		available = {
				NOT = {
					 has_country_flag = modern_tank_enable_buy_qol_flag
				}
				has_country_flag = buying_vehicles_qol
		}
		visible = {
			 has_country_flag = buying_vehicles_qol
				NOT = {
					 has_country_flag = modern_tank_enable_buy_qol_flag
				}	 
				
		}

		cost = 0
		days_re_enable = 0
		ai_will_do = {
			factor = 0
		}
		complete_effect = {
			set_country_flag = modern_tank_enable_buy_qol_flag
		}			
		}


		market_buy_modern_tank_disable = {


		icon = generic_form_nation
			priority = 10
 
		allowed = {
				 has_country_flag = modern_tank_enable_buy_qol_flag	
				 has_country_flag = buying_vehicles_qol
		}
		available = {
				 has_country_flag = modern_tank_enable_buy_qol_flag
				 has_country_flag = buying_vehicles_qol
		}
		visible = {
			 has_country_flag = buying_vehicles_qol
			 has_country_flag = modern_tank_enable_buy_qol_flag			 
		}

		cost = 0
		days_re_enable = 0
		ai_will_do = {
			factor = 0
		}
		complete_effect = {
			clr_country_flag = modern_tank_enable_buy_qol_flag
		}			
		}
		

market_buy_modern_tank1 = {

		icon = generic_form_nation
			priority =9
		allowed = {
		}
		available = {
			 has_country_flag = modern_tank_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					modern_tank_equipment_1  > 84
				}
				has_opinion = {
					target = ROOT
					value > 51
				}				
			}			 
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = modern_tank_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					modern_tank_equipment_1  > 84
				}			
			}			 
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					modern_tank_equipment_1  > 84
				}
				has_tech = modern_tank_equipment_1  				
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = modern_tank_chassis            
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = modern_tank_equipment_1  
					amount = -84
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = modern_tank_equipment_1  
					amount = 84
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}	

market_buy_modern_tank2 = {

		icon = generic_form_nation
			priority = 9
 
		allowed = {
		}
		available = {
			has_country_flag = modern_tank_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
				has_country_flag = qol_accept_tanks_orders_flag
				has_equipment = {
					modern_tank_equipment_2 > 2000
				}
				has_opinion = {
					target = ROOT
					value > 51
				}						
			}			 
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = modern_tank_enable_buy_qol_flag
			has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					modern_tank_equipment_2 > 2000
				}
				has_tech = modern_tank_equipment_2
			}		
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
			
				has_country_flag = qol_accept_tanks_orders_flag
				has_equipment = {
					modern_tank_equipment_2 > 2000
				}
				has_tech = modern_tank_equipment_2
				has_country_flag = qol_accept_tanks_orders_flag				
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = modern_tank_chassis            
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = modern_tank_equipment_2
					amount = -84
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = modern_tank_equipment_2
					amount = 84
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}

market_buy_modern_tank3 = {

		icon = generic_form_nation
			priority = 9
 
		allowed = {
		}
		available = {
			has_country_flag = modern_tank_enable_buy_qol_flag
			has_country_flag = buying_vehicles_qol
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					modern_tank_equipment_3 > 2000
				}			
				has_opinion = {
					target = ROOT
					value > 51
				}					
			}			
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = modern_tank_enable_buy_qol_flag		
			has_country_flag = buying_vehicles_qol
			FROM = { has_country_flag = qol_accept_tanks_orders_flag}
			FROM = {
				has_equipment = {
					modern_tank_equipment_3 > 2000
				}			
			}			
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
				has_country_flag = qol_accept_tanks_orders_flag
				has_equipment = {
					modern_tank_equipment_3 > 2000
				}
				has_tech = modern_tank_equipment_3 
				has_country_flag = qol_accept_tanks_orders_flag
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = modern_tank_chassis          
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = modern_tank_equipment_3 
					amount = -84
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = modern_tank_equipment_3 
					amount = 84
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}



###################
###### mechanized  ######	
###################
	
	
		market_buy_mechanized_enable = {

			priority = 8
 
		icon = generic_form_nation

		allowed = {
				NOT = {
					 has_country_flag = mechanized_enable_buy_qol_flag
				}
				has_country_flag = buying_vehicles_qol
		}
		available = {
				NOT = {
					 has_country_flag = mechanized_enable_buy_qol_flag
				}
				has_country_flag = buying_vehicles_qol
		}
		visible = {
			 has_country_flag = buying_vehicles_qol
				NOT = {
					 has_country_flag = mechanized_enable_buy_qol_flag
				}	 
				
		}

		cost = 0
		days_re_enable = 0
		ai_will_do = {
			factor = 0
		}
		complete_effect = {
			set_country_flag = mechanized_enable_buy_qol_flag
		}			
		}


		market_buy_mechanized_disable = {


		icon = generic_form_nation
			priority = 8
 
			
		allowed = {
				 has_country_flag = mechanized_enable_buy_qol_flag	
				 has_country_flag = buying_vehicles_qol
		}
		available = {
				 has_country_flag = mechanized_enable_buy_qol_flag
				 has_country_flag = buying_vehicles_qol
		}
		visible = {
			 has_country_flag = buying_vehicles_qol
			 has_country_flag = mechanized_enable_buy_qol_flag			 
		}

		cost = 0
		days_re_enable = 0
		ai_will_do = {
			factor = 0
		}
		complete_effect = {
			clr_country_flag = mechanized_enable_buy_qol_flag
		}			
		}
		

market_buy_mechanized1 = {

		icon = generic_form_nation
			priority = 7
 
		allowed = {
		}
		available = {
			 has_country_flag = mechanized_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_mechanized_orders_flag}
			FROM = {
				has_equipment = {
					mechanized_equipment_1  > 100
				}
				has_opinion = {
					target = ROOT
					value > 51
				}				
			}			 
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = mechanized_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_mechanized_orders_flag}
			FROM = {
				has_equipment = {
					mechanized_equipment_1  > 100
				}			
			}			 
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_mechanized_orders_flag}
			FROM = {
				has_equipment = {
					mechanized_equipment_1  > 100
				}
				has_tech = mechanised_infantry  	
				has_country_flag = qol_accept_mechanized_orders_flag				
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = mechanized_equipment            
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = mechanized_equipment_1  
					amount = -100
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = mechanized_equipment_1  
					amount = 100
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}	

market_buy_mechanized2 = {

		icon = generic_form_nation
			priority  = 7
 
	
		allowed = {
		}
		available = {
			has_country_flag = mechanized_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
				has_country_flag = qol_accept_mechanized_orders_flag
				has_equipment = {
					mechanized_equipment_2 > 100
				}
				has_opinion = {
					target = ROOT
					value > 51
				}						
			}			 
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = mechanized_enable_buy_qol_flag
			has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_mechanized_orders_flag}
			FROM = {
				has_equipment = {
					mechanized_equipment_2 > 100
				}
				has_tech = mechanised_infantry2
			}		
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
			
				has_country_flag = qol_accept_mechanized_orders_flag
				has_equipment = {
					mechanized_equipment_2 > 100
				}
				has_tech = mechanised_infantry2 
				has_country_flag = qol_accept_mechanized_orders_flag				
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = mechanized_equipment            
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = mechanized_equipment_2
					amount = -100
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = mechanized_equipment_2
					amount = 100
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}

market_buy_mechanized3 = {

		icon = generic_form_nation
			priority = 7
 
			
		allowed = {
		}
		available = {
			has_country_flag = mechanized_enable_buy_qol_flag
			has_country_flag = buying_vehicles_qol
			FROM = { has_country_flag = qol_accept_mechanized_orders_flag}
			FROM = {
				has_equipment = {
					mechanized_equipment_3 > 100
				}			
				has_opinion = {
					target = ROOT
					value > 51
				}					
			}			
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = mechanized_enable_buy_qol_flag		
			has_country_flag = buying_vehicles_qol
			FROM = { has_country_flag = qol_accept_mechanized_orders_flag}
			FROM = {
				has_equipment = {
					mechanized_equipment_3 > 100
				}			
			}			
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
				has_country_flag = qol_accept_mechanized_orders_flag
				has_equipment = {
					mechanized_equipment_3 > 100
				}
				has_tech = mechanised_infantry3 
				has_country_flag = qol_accept_mechanized_orders_flag
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = mechanized_equipment            
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = mechanized_equipment_3 
					amount = -100
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = mechanized_equipment_3 
					amount = 100
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}
	

###################
###### amtrac  ######	
###################
	
	
		market_buy_amtrac_enable = {

			priority = 6
 
			
		icon = generic_form_nation

		allowed = {
				NOT = {
					 has_country_flag = amtrac_enable_buy_qol_flag
				}
				has_country_flag = buying_vehicles_qol
		}
		available = {
				NOT = {
					 has_country_flag = amtrac_enable_buy_qol_flag
				}
				has_country_flag = buying_vehicles_qol
		}
		visible = {
			 has_country_flag = buying_vehicles_qol
				NOT = {
					 has_country_flag = amtrac_enable_buy_qol_flag
				}	 
				
		}

		cost = 0
		days_re_enable = 0
		ai_will_do = {
			factor = 0
		}
		complete_effect = {
			set_country_flag = amtrac_enable_buy_qol_flag
		}			
		}


		market_buy_amtrac_disable = {


		icon = generic_form_nation
			priority = 6
 
			
		allowed = {
				 has_country_flag = amtrac_enable_buy_qol_flag	
				 has_country_flag = buying_vehicles_qol
		}
		available = {
				 has_country_flag = amtrac_enable_buy_qol_flag
				 has_country_flag = buying_vehicles_qol
		}
		visible = {
			 has_country_flag = buying_vehicles_qol
			 has_country_flag = amtrac_enable_buy_qol_flag			 
		}

		cost = 0
		days_re_enable = 0
		ai_will_do = {
			factor = 0
		}
		complete_effect = {
			clr_country_flag = amtrac_enable_buy_qol_flag
		}			
		}
		

market_buy_amtrac1 = {

		icon = generic_form_nation
			priority = 5
 
			
		allowed = {
		}
		available = {
			 has_country_flag = amtrac_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_amtrac_orders_flag}
			FROM = {
				has_equipment = {
					amphibious_mechanized_equipment_1  > 100
				}
				has_opinion = {
					target = ROOT
					value > 51
				}				
			}			 
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = amtrac_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_amtrac_orders_flag}
			FROM = {
				has_equipment = {
					amphibious_mechanized_equipment_1  > 100
				}			
			}			 
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_amtrac_orders_flag}
			FROM = {
				has_equipment = {
					amphibious_mechanized_equipment_1  > 100
				}
				has_tech = amphibious_mechanized_infantry_1
				has_country_flag = qol_accept_amtrac_orders_flag  				
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = amphibious_mechanized_equipment            
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = amphibious_mechanized_equipment_1  
					amount = -100
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = amphibious_mechanized_equipment_1  
					amount = 100
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}	

market_buy_amtrac2 = {

		icon = generic_form_nation
			priority  = 5
 
			
		allowed = {
		}
		available = {
			has_country_flag = amtrac_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
				has_country_flag = qol_accept_amtrac_orders_flag
				has_equipment = {
					amphibious_mechanized_equipment_2 > 100
				}
				has_opinion = {
					target = ROOT
					value > 51
				}						
			}			 
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = amtrac_enable_buy_qol_flag
			has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_amtrac_orders_flag}
			FROM = {
				has_equipment = {
					amphibious_mechanized_equipment_2 > 100
				}
				has_tech = amphibious_mechanized_infantry_2
			}		
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
			
				has_country_flag = qol_accept_amtrac_orders_flag
				has_equipment = {
					amphibious_mechanized_equipment_2 > 100
				}
				has_tech = amphibious_mechanized_equipment_2 	
				has_country_flag = qol_accept_amtrac_orders_flag					
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = amphibious_mechanized_equipment            
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = amphibious_mechanized_equipment_2
					amount = -100
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = amphibious_mechanized_equipment_2
					amount = 100
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}

market_buy_amtrac3 = {

		icon = generic_form_nation
			priority = 5
 
			
		allowed = {
		}
		available = {
			has_country_flag = amtrac_enable_buy_qol_flag
			has_country_flag = buying_vehicles_qol
			FROM = { has_country_flag = qol_accept_amtrac_orders_flag}
			FROM = {
				has_equipment = {
					amphibious_mechanized_equipment_3 > 100
				}			
				has_opinion = {
					target = ROOT
					value > 51
				}					
			}			
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = amtrac_enable_buy_qol_flag		
			has_country_flag = buying_vehicles_qol
			FROM = { has_country_flag = qol_accept_amtrac_orders_flag}
			FROM = {
				has_equipment = {
					amphibious_mechanized_equipment_3 > 100
				}			
			}			
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
				has_country_flag = qol_accept_amtrac_orders_flag
				has_equipment = {
					amphibious_mechanized_equipment_3 > 100
				}
				has_tech = amphibious_mechanized_infantry_3 
				has_country_flag = qol_accept_amtrac_orders_flag	
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = amphibious_mechanized_equipment            
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = amphibious_mechanized_equipment_3 
					amount = -100
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = amphibious_mechanized_equipment_3 
					amount = 100
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}	

###################
###### trucks  ######	
###################
	
	
		market_buy_trucks_enable = {

			priority = 4
 
			
		icon = generic_form_nation

		allowed = {
				NOT = {
					 has_country_flag = trucks_enable_buy_qol_flag
				}
				has_country_flag = buying_vehicles_qol
		}
		available = {
				NOT = {
					 has_country_flag = trucks_enable_buy_qol_flag
				}
				has_country_flag = buying_vehicles_qol
		}
		visible = {
			 has_country_flag = buying_vehicles_qol
				NOT = {
					 has_country_flag = trucks_enable_buy_qol_flag
				}	 
				
		}

		cost = 0
		days_re_enable = 0
		ai_will_do = {
			factor = 0
		}
		complete_effect = {
			set_country_flag = trucks_enable_buy_qol_flag
		}			
		}


		market_buy_trucks_disable = {


		icon = generic_form_nation
			priority = 4
 
			
		allowed = {
				 has_country_flag = trucks_enable_buy_qol_flag	
				 has_country_flag = buying_vehicles_qol
		}
		available = {
				 has_country_flag = trucks_enable_buy_qol_flag
				 has_country_flag = buying_vehicles_qol
		}
		visible = {
			 has_country_flag = buying_vehicles_qol
			 has_country_flag = trucks_enable_buy_qol_flag			 
		}

		cost = 0
		days_re_enable = 0
		ai_will_do = {
			factor = 0
		}
		complete_effect = {
			clr_country_flag = trucks_enable_buy_qol_flag
		}			
		}
		

market_buy_trucks1 = {

		icon = generic_form_nation
			priority = 3
 
			
		allowed = {
		}
		available = {
			 has_country_flag = trucks_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_trucks_orders_flag}
			FROM = {
				has_equipment = {
					motorized_equipment  > 250
				}
				has_opinion = {
					target = ROOT
					value > 51
				}				
			}			 
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = trucks_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_trucks_orders_flag}
			FROM = {
				has_equipment = {
					motorized_equipment  > 250
				}			
			}			 
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_trucks_orders_flag	}
			FROM = {
				has_equipment = {
					motorized_equipment  > 250
				}
				has_tech = motorised_infantry   				
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = motorized_equipment             
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = motorized_equipment  
					amount = -250
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = motorized_equipment  
					amount = 250
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}	

market_buy_trucks2 = {

		icon = generic_form_nation
			priority  = 3
 
			
		allowed = {
		}
		available = {
			has_country_flag = trucks_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
				has_country_flag = qol_accept_trucks_orders_flag
				has_equipment = {
					motorized_equipment > 250
				}
				has_opinion = {
					target = ROOT
					value > 51
				}						
			}			 
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = trucks_enable_buy_qol_flag
			has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_trucks_orders_flag}
			FROM = {
				has_equipment = {
					motorized_equipment > 250
				}
				has_tech = motorised_infantry1
			}		
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
			
				has_country_flag = qol_accept_trucks_orders_flag
				has_equipment = {
					motorized_equipment > 250
				}
				has_tech = motorised_infantry1 	
				has_country_flag = qol_accept_trucks_orders_flag				
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = motorized_equipment             
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = motorized_equipment
					amount = -250
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = motorized_equipment
					amount = 250
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}

market_buy_trucks3 = {

		icon = generic_form_nation
			priority = 3
 
			
		allowed = {
		}
		available = {
			has_country_flag = trucks_enable_buy_qol_flag
			has_country_flag = buying_vehicles_qol
			FROM = { has_country_flag = qol_accept_trucks_orders_flag}
			FROM = {
				has_equipment = {
					motorized_equipment > 250
				}			
				has_opinion = {
					target = ROOT
					value > 51
				}					
			}			
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = trucks_enable_buy_qol_flag		
			has_country_flag = buying_vehicles_qol
			FROM = { has_country_flag = qol_accept_trucks_orders_flag}
			FROM = {
				has_equipment = {
					motorized_equipment > 250
				}			
			}			
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
				has_country_flag = qol_accept_trucks_orders_flag
				has_equipment = {
					motorized_equipment > 250
				}
				has_tech = motorised_infantry2 
				has_country_flag = qol_accept_trucks_orders_flag	
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = motorized_equipment             
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = motorized_equipment 
					amount = -250
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = motorized_equipment 
					amount = 250
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}
	



##########################	
###### Armored Cars ######	
##########################	
	
	
		market_buy_armored_cars_enable = {

			priority = 4
 
			
		icon = generic_form_nation

		allowed = {
				NOT = {
					 has_country_flag = armored_cars_enable_buy_qol_flag
				}
				has_country_flag = buying_vehicles_qol
		}
		available = {
				NOT = {
					 has_country_flag = armored_cars_enable_buy_qol_flag
				}
				has_country_flag = buying_vehicles_qol
		}
		visible = {
			 has_country_flag = buying_vehicles_qol
				NOT = {
					 has_country_flag = armored_cars_enable_buy_qol_flag
				}	 
				
		}

		cost = 0
		days_re_enable = 0
		ai_will_do = {
			factor = 0
		}
		complete_effect = {
			set_country_flag = armored_cars_enable_buy_qol_flag
		}			
		}


		market_buy_armored_cars_disable = {


		icon = generic_form_nation
			priority = 4
 
			
		allowed = {
				 has_country_flag = armored_cars_enable_buy_qol_flag	
				 has_country_flag = buying_vehicles_qol
		}
		available = {
				 has_country_flag = armored_cars_enable_buy_qol_flag
				 has_country_flag = buying_vehicles_qol
		}
		visible = {
			 has_country_flag = buying_vehicles_qol
			 has_country_flag = armored_cars_enable_buy_qol_flag			 
		}

		cost = 0
		days_re_enable = 0
		ai_will_do = {
			factor = 0
		}
		complete_effect = {
			clr_country_flag = armored_cars_enable_buy_qol_flag
		}			
		}
		

market_buy_armored_cars1 = {

		icon = generic_form_nation
			priority = 3
 
			
		allowed = {
		}
		available = {
			 has_country_flag = armored_cars_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_armored_cars_orders_flag}
			FROM = {
				has_equipment = {
					armored_car_equipment_1  > 250
				}
				has_opinion = {
					target = ROOT
					value > 51
				}				
			}			 
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = armored_cars_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_armored_cars_orders_flag}
			FROM = {
				has_equipment = {
					armored_car_equipment_1  > 250
				}			
			}			 
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_armored_cars_orders_flag	}
			FROM = {
				has_equipment = {
					armored_car_equipment_1  > 250
				}
				has_tech = armored_car1  				
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = armored_car_equipment             
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = armored_car_equipment_1  
					amount = -250
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = armored_car_equipment_1  
					amount = 250
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}	

market_buy_armored_cars2 = {

		icon = generic_form_nation
			priority  = 3
 
			
		allowed = {
		}
		available = {
			has_country_flag = armored_cars_enable_buy_qol_flag
			 has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
				has_country_flag = qol_accept_armored_cars_orders_flag
				has_equipment = {
					armored_car_equipment_2 > 250
				}
				has_opinion = {
					target = ROOT
					value > 51
				}						
			}			 
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = armored_cars_enable_buy_qol_flag
			has_country_flag = buying_vehicles_qol
			FROM = {
				num_of_military_factories > 20
			}
			FROM = { has_country_flag = qol_accept_armored_cars_orders_flag}
			FROM = {
				has_equipment = {
					armored_car_equipment_2 > 250
				}
				has_tech = armored_car_equipment_2
			}		
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
			
				has_country_flag = qol_accept_armored_cars_orders_flag
				has_equipment = {
					armored_car_equipment_2 > 250
				}
				has_tech = armored_car2
				has_country_flag = qol_accept_armored_cars_orders_flag				
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = armored_car_equipment             
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = armored_car_equipment_2
					amount = -250
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = armored_car_equipment_2
					amount = 250
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}

market_buy_armored_cars3 = {

		icon = generic_form_nation
			priority = 3
 
			
		allowed = {
		}
		available = {
			has_country_flag = armored_cars_enable_buy_qol_flag
			has_country_flag = buying_vehicles_qol
			FROM = { has_country_flag = qol_accept_armored_cars_orders_flag}
			FROM = {
				has_equipment = {
					armored_car_equipment_3 > 250
				}			
				has_opinion = {
					target = ROOT
					value > 51
				}					
			}			
		}
		visible = {
			has_country_flag = show_old_qol
			has_country_flag = armored_cars_enable_buy_qol_flag		
			has_country_flag = buying_vehicles_qol
			FROM = { has_country_flag = qol_accept_armored_cars_orders_flag}
			FROM = {
				has_equipment = {
					armored_car_equipment_3 > 250
				}			
			}			
		}
		custom_cost_trigger = {
			check_variable = { eoc_treasury > 0.1 }
		}
		target_trigger = {
			FROM = {
				num_of_military_factories > 20
				has_country_flag = qol_accept_armored_cars_orders_flag
				has_equipment = {
					armored_car_equipment_3 > 250
				}
				has_tech = armored_car3 
				has_country_flag = qol_accept_armored_cars_orders_flag	
			}
		}
		cost = 10
		days_remove = 30
		days_re_enable = 0
		ai_will_do = {
			base = 0
			modifier = {
				add = 200
				has_war = yes
				enemies_strength_ratio > 1 #strength
				#num_of_military_factories < 25 #factories 
			}
			modifier = {
				add = 100
				stockpile_ratio = {
					archetype = armored_car_equipment             
					ratio < 0.25
				} 
			}
		}
		complete_effect = {
			FROM = {
				add_equipment_to_stockpile = {
					type = armored_car_equipment_3 
					amount = -250
					producer = FROM
				}
				add_to_variable = {number_contracts_sell_var = 1 }
			}
			add_to_variable = {number_contracts_buy_var = 1 }
		}
		remove_effect = {
			ROOT = {
				add_equipment_to_stockpile = {
					type = armored_car_equipment_3 
					amount = 250
					producer = FROM
				}
			}
			hidden_effect = {
				subtract_from_variable = { eoc_treasury = 0.1 }
				FROM = { add_to_variable = { eoc_treasury = 0.1 } }
				FROM = { subtract_from_variable = { number_contracts_sell_var = 1 } }
				subtract_from_variable = { number_contracts_buy_var = 1 }
			}				
		}
		
	}
	
}