add_namespace = AL_zubayr

#Slave Raids

#Announce attack
country_event = {
	id = AL_zubayr.1
	title = AL_zubayr.1.t
	desc = AL_zubayr.1.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	immediate = {
		
	}
	
	option = {
		name = AL_zubayr.5.a
		ai_chance = { factor = 100 }
	}
	
}


country_event = {
	id = AL_zubayr.2
	title = AL_zubayr.2.t
	desc = AL_zubayr.2.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	immediate = {
		ROOT = {
			set_country_flag = ALZ_slave_raid_ended
			clr_country_flag = raiding_neighbour
		}
	}
	
	option = {
		name = AL_zubayr.2.a
		ai_chance = { factor = 100 }
		ROOT = { army_experience = 5 }
	}
	
}

country_event = {
	id = AL_zubayr.3
	title = AL_zubayr.3.t
	desc = AL_zubayr.3.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	immediate = {
		ROOT = {
			set_country_flag = ALZ_slave_raid_ended
			clr_country_flag = raiding_neighbour
		}
	}
	
	option = {
		name = AL_zubayr.3.a
		ai_chance = { factor = 100 }
		ROOT = { army_experience = 2 }
	}
	
}

country_event = {
	id = AL_zubayr.4
	title = AL_zubayr.4.t
	desc = AL_zubayr.4.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	immediate = {
		ROOT = {
			set_country_flag = ALZ_slave_raid_ended
			clr_country_flag = raiding_neighbour
		}
	}
	
	option = {
		name = AL_zubayr.4.a
		ai_chance = { factor = 100 }
		ROOT = { army_experience = 2 }
	}
	
}

#Announce Defensive 
country_event = {
	id = AL_zubayr.5
	title = AL_zubayr.5.t
	desc = AL_zubayr.5.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				ROOT = { owns_state = 834 }
			}
			FROM = {
				start_border_war = {
					change_state_after_war = no
					attacker = {
						state = 833
						num_provinces = 3
						on_win = AL_zubayr.2
						on_lose = AL_zubayr.3
						on_cancel = AL_zubayr.4
					}
				
					defender = {
						state = 834
						num_provinces = 1
						on_win = AL_zubayr.6
						on_lose = AL_zubayr.7
						on_cancel = AL_zubayr.8
					}
				}
				set_border_war_data = {
					attacker = 833
					defender = 834
					combat_width = 10
				}
			}
		}
		else_if = {
			limit = {
				ROOT = { owns_state = 832 }
			}
			FROM = {
				start_border_war = {
					change_state_after_war = no
					attacker = {
						state = 833
						num_provinces = 3
						on_win = AL_zubayr.2
						on_lose = AL_zubayr.3
						on_cancel = AL_zubayr.4
					}
				
					defender = {
						state = 832
						num_provinces = 4
						on_win = AL_zubayr.6
						on_lose = AL_zubayr.7
						on_cancel = AL_zubayr.8
					}
				}
				set_border_war_data = {
					attacker = 833
					defender = 832
					combat_width = 10
				}
			}
		}
		else_if = {
			limit = {
				ROOT = { owns_state = 845 }
			}
			FROM = {
				start_border_war = {
					change_state_after_war = no
					attacker = {
						state = 833
						num_provinces = 3
						on_win = AL_zubayr.2
						on_lose = AL_zubayr.3
						on_cancel = AL_zubayr.4
					}
				
					defender = {
						state = 845
						num_provinces = 3
						on_win = AL_zubayr.6
						on_lose = AL_zubayr.7
						on_cancel = AL_zubayr.8
					}
				}
				set_border_war_data = {
					attacker = 833
					defender = 845
					combat_width = 10
				}
			}
		}
		else_if = {
			limit = {
				ROOT = { owns_state = 820 }
			}
			FROM = {
				start_border_war = {
					change_state_after_war = no
					attacker = {
						state = 833
						num_provinces = 3
						on_win = AL_zubayr.2
						on_lose = AL_zubayr.3
						on_cancel = AL_zubayr.4
					}
				
					defender = {
						state = 820
						num_provinces = 3
						on_win = AL_zubayr.6
						on_lose = AL_zubayr.7
						on_cancel = AL_zubayr.8
					}
				}
				set_border_war_data = {
					attacker = 833
					defender = 820
					combat_width = 10
				}
			}
		}
		else_if = {
			limit = {
				ROOT = { owns_state = 839 }
			}
			FROM = {
				start_border_war = {
					change_state_after_war = no
					attacker = {
						state = 833
						num_provinces = 3
						on_win = AL_zubayr.2
						on_lose = AL_zubayr.3
						on_cancel = AL_zubayr.4
					}
				
					defender = {
						state = 839
						num_provinces = 4
						on_win = AL_zubayr.6
						on_lose = AL_zubayr.7
						on_cancel = AL_zubayr.8
					}
				}
				set_border_war_data = {
					attacker = 833
					defender = 839
					combat_width = 10
				}
			}
		}
		else_if = {
			limit = {
				ROOT = { owns_state = 295 }
			}
			FROM = {
				start_border_war = {
					change_state_after_war = no
					attacker = {
						state = 833
						num_provinces = 3
						on_win = AL_zubayr.2
						on_lose = AL_zubayr.3
						on_cancel = AL_zubayr.4
					}
				
					defender = {
						state = 295
						num_provinces = 13
						on_win = AL_zubayr.6
						on_lose = AL_zubayr.7
						on_cancel = AL_zubayr.8
					}
				}
				set_border_war_data = {
					attacker = 833
					defender = 295
					combat_width = 10
				}
			}
		}
	}
	
	option = {
		name = AL_zubayr.5.a
		ai_chance = { factor = 100 }
		
	}
	
}

#Win
country_event = {
	id = AL_zubayr.6
	title = AL_zubayr.6.t
	desc = AL_zubayr.6.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	immediate = {
		ROOT = {
			delete_unit_template_and_units = {
				division_template = "Elite Tribal Infantry"
			}
		}
	}
	
	option = {
		name = AL_zubayr.6.a
		ai_chance = { factor = 100 }
	}
	
}
#Lose
country_event = {
	id = AL_zubayr.7
	title = AL_zubayr.7.t
	desc = AL_zubayr.7.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	immediate = {
		ROOT = {
			delete_unit_template_and_units = {
				division_template = "Elite Tribal Infantry"
			}
		}
	}
	
	option = {
		name = AL_zubayr.7.a
		ai_chance = { factor = 100 }
	}
	
}
#Stalemate
country_event = {
	id = AL_zubayr.8
	title = AL_zubayr.8.t
	desc = AL_zubayr.8.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	immediate = {
		ROOT = {
			delete_unit_template_and_units = {
				division_template = "Elite Tribal Infantry"
			}
		}
	}
	
	option = {
		name = AL_zubayr.8.a
		ai_chance = { factor = 100 }
	}
	
}
# Anti Inustriali Raid
country_event = {
	id = AL_zubayr.9
	title = AL_zubayr.9.t
	desc = AL_zubayr.9.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = anti_industrialisation_raid.1.a
		ai_chance = { factor = 100 }
		if = {
			limit = {
				tag = SHK
			}
			SHK = {
				start_border_war = {
					change_state_after_war = no
					attacker = {
						state = 834
						num_provinces = 1
						on_win = AL_zubayr.10
						on_lose = AL_zubayr.11
						on_cancel = AL_zubayr.12
					}
				
					defender = {
						state = 833
						num_provinces = 4
						on_win = AL_zubayr.14
						on_lose = AL_zubayr.15
						on_cancel = AL_zubayr.16
					}
				}
				set_border_war_data = {
					attacker = 834
					defender = 833
					combat_width = 10
				}
			}
		}

		else_if = {
			limit = {
				tag = DFR
			}
			DFR = {
				start_border_war = {
					change_state_after_war = no
					attacker = {
						state = 832
						num_provinces = 2
						on_win = AL_zubayr.10
						on_lose = AL_zubayr.11
						on_cancel = AL_zubayr.12
					}
				
					defender = {
						state = 833
						num_provinces = 2
						on_win = AL_zubayr.14
						on_lose = AL_zubayr.15
						on_cancel = AL_zubayr.16
					}
				}
				set_border_war_data = {
					attacker = 832
					defender = 833
					combat_width = 10
				}
			}
		}
	}
	
}

country_event = {
	id = AL_zubayr.10
	title = AL_zubayr.10.t
	desc = AL_zubayr.10.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = anti_industrialisation_raid.2.a
		ai_chance = { factor = 100 }
		if = {
			limit = {
				tag = SHK
			}
			SHK = {
				hidden_effect = {
					delete_unit_template_and_units = {
						division_template = "Elite Tribal Infantry"
					}
					remove_ideas = ETH_generals_inspire
					set_country_flag = ETH_border_war_ended
				}
				#custom_effect_tooltip= EDC_remove_500_to_tribal_army
				#add_to_variable = {Tribal_army_num = -500}
			}
		}
		if = {
			limit = {
				tag = BKW
			}
			BKW = {
				hidden_effect = {
					delete_unit_template_and_units = {
						division_template = "Elite Tribal Infantry"
					}
					remove_ideas = ETH_generals_inspire
					set_country_flag = ETH_border_war_ended
				}
				#custom_effect_tooltip= EDC_remove_500_to_tribal_army
				#add_to_variable = {Tribal_army_num = -500}
			}
		}
		if = {
			limit = {
				tag = DFR
			}
			DFR = {
				hidden_effect = {
					delete_unit_template_and_units = {
						division_template = "Elite Tribal Infantry"
					}
					remove_ideas = ETH_generals_inspire
					set_country_flag = ETH_border_war_ended
				}
				#custom_effect_tooltip= EDC_remove_500_to_tribal_army
				#add_to_variable = {Tribal_army_num = -500}
			}
		}
	}
	
}

country_event = {
	id = AL_zubayr.11
	title = AL_zubayr.11.t
	desc = AL_zubayr.11.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = anti_industrialisation_raid.3.a
		ai_chance = { factor = 100 }
		if = {
			limit = {
				tag = SHK
			}
			SHK = {
				hidden_effect = {
					delete_unit_template_and_units = {
						division_template = "Elite Tribal Infantry"
					}
					remove_ideas = ETH_generals_inspire
				}
				#custom_effect_tooltip= EDC_remove_1500_to_tribal_army
				#add_to_variable = {Tribal_army_num = -1500}
			}
		}
		if = {
			limit = {
				tag = BKW
			}
			BKW = {
				hidden_effect = {
					delete_unit_template_and_units = {
						division_template = "Elite Tribal Infantry"
					}
					remove_ideas = ETH_generals_inspire
				}
				#custom_effect_tooltip= EDC_remove_1500_to_tribal_army
				#add_to_variable = {Tribal_army_num = -1500}
			}
		}
		if = {
			limit = {
				tag = DFR
			}
			DFR = {
				hidden_effect = {
					delete_unit_template_and_units = {
						division_template = "Elite Tribal Infantry"
					}
					remove_ideas = ETH_generals_inspire
				}
				#custom_effect_tooltip= EDC_remove_1500_to_tribal_army
				#add_to_variable = {Tribal_army_num = -1500}
			}
		}
	}
	
}

country_event = {
	id = AL_zubayr.12
	title = AL_zubayr.12.t
	desc = AL_zubayr.12.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = anti_industrialisation_raid.4.a
		ai_chance = { factor = 100 }
		if = {
			limit = {
				tag = SHK
			}
			SHK = {
				hidden_effect = {
					delete_unit_template_and_units = {
						division_template = "Elite Tribal Infantry"
					}
					remove_ideas = ETH_generals_inspire
				}
			}
		}
		if = {
			limit = {
				tag = BKW
			}
			BKW = {
				hidden_effect = {
					delete_unit_template_and_units = {
						division_template = "Elite Tribal Infantry"
					}
					remove_ideas = ETH_generals_inspire
				}
			}
		}
		if = {
			limit = {
				tag = DFR
			}
			DFR = {
				hidden_effect = {
					delete_unit_template_and_units = {
						division_template = "Elite Tribal Infantry"
					}
					remove_ideas = ETH_generals_inspire
				}
			}
		}
	}
	
}
# Anti instrialization defensive raid
country_event = {
	id = AL_zubayr.13
	title = AL_zubayr.13.t
	desc = AL_zubayr.13.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = AL_zubayr.13.a
		ai_chance = { factor = 100 }
		833 = {
			damage_building = {
				type = infrastructure
				damage = 0.10
			}
		}		
	}
	
}

country_event = {
	id = AL_zubayr.14
	title = AL_zubayr.14.t
	desc = AL_zubayr.14.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = AL_zubayr.14.a
		ai_chance = { factor = 100 }
		clr_country_flag = ALZ_anti_industrialisation_raid
	}
	
}
country_event = {
	id = AL_zubayr.15
	title = AL_zubayr.15.t
	desc = AL_zubayr.15.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = AL_zubayr.15.a
		ai_chance = { factor = 100 }
		833 = {
			damage_building = {
				type = infrastructure
				damage = 0.50
			}
		}
		clr_country_flag = ALZ_anti_industrialisation_raid
	}
	
}

country_event = {
	id = AL_zubayr.16
	title = AL_zubayr.16.t
	desc = AL_zubayr.16.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = AL_zubayr.16.a
		ai_chance = { factor = 100 }
		833 = {
			damage_building = {
				type = infrastructure
				damage = 0.50
			}
		}
		clr_country_flag = ALZ_anti_industrialisation_raid
		
	}
	
}
# Raid damage
country_event = {
	id = AL_zubayr.17
	title = AL_zubayr.17.t
	desc = AL_zubayr.17.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = AL_zubayr.17.a
		ai_chance = { factor = 100 }
		833 = {
			damage_building = {
				type = infrastructure
				damage = 0.10
			}
		}
		
	}
	
}

country_event = {
	id = AL_zubayr.18
	title = AL_zubayr.18.t
	desc = AL_zubayr.18.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = AL_zubayr.18.a
		ai_chance = { factor = 100 }
		833 = {
			damage_building = {
				type = infrastructure
				damage = 0.20
			}
		}
	}
	
}

country_event = {
	id = AL_zubayr.19
	title = AL_zubayr.19.t
	desc = AL_zubayr.19.d
	picture = GFX_report_event_soviet_finnish_pact
	
	is_triggered_only = yes
	
	option = {
		name = AL_zubayr.19.a
		ai_chance = { factor = 100 }
		833 = {
			damage_building = {
				type = infrastructure
				damage = 0.30
			}
		}
	}
	
}
