#############################
# MANDALA REALM CONTRACTS
#############################
mandala_realm_contract_0001 = { # Visit a province in your realm
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
			#Generate the loc for title + desc
			random_list = {
				1 = { 
					set_variable = {
						name = loc_desc
						value = flag:mandala_provincial_ritual_desc_01
					}
				}
				1 = { 
					set_variable = {
						name = loc_desc
						value = flag:mandala_provincial_ritual_desc_02
					}
				}
			}
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.1000
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0002 = { # Barren Cattle
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.1100
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0003 = { # The First Seed
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.1200
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0004 = { # Sacred Heifer
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.1300
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0005 = { # Divine Witness
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.1400
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0006 = { # Midwives' Dream
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.1500
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0007 = { # Weeping Statue
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.1600
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0008 = { # Sprouting Flowers
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.1700
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0009 = { # River Ritual
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.1800
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0010 = { # Cursed Fields
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.1900
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0011 = { # Withered Grove
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.2000
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0012 = { # Pig Slaughter Oath
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.2100
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0013 = { # Ritual Wrath
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.2200
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0014 = { # Collective Punishment
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.2300
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0015 = { # Diseased Spirits
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.2400
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0016 = { # Dull Spears
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.2500
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0017 = { # Defiant Village
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.2600
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0018 = { # Blood Tax
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.2700
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0019 = { # Bamboo Rebels
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.2800
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0020 = { # Road Sacrifice
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.2900
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0021 = { # War God Festival
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.3000
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0022 = { # Quarreling Monks
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.3100
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0023 = { # Purify Battlefield
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.3200
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0024 = { # Bless the Weavers
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.3300
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0025 = { # Breaking of Spears
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.3400
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0026 = { # Guru's Peace
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.3500
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0027 = { # Reconciliation Edict
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.3600
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0028 = { # Eightfold Path
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.3700
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0029 = { # Grove Guardians
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.3800
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0030 = { # Vow of Stillness
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.3900
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0031 = { # Stone-laying
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.4000
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0032 = { # Laughing Ascetic
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.4100
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0033 = { # Spirit Decoy
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.4200
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0034 = { # Game of Wit
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.4300
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0035 = { # Divine Thief
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.4400
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0036 = { # Trickster's Trial
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.4500
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0037 = { # Festival of Reversal
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.4600
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0038 = { # Goat Oracle
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.4700
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0039 = { # Beasts in the Jungle
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.4800
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0040 = { # River Naga
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.4900
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}

mandala_realm_contract_0041 = { # Promised Land
	group = mandala_realm_group
	icon = "gfx/interface/icons/government_types/mandala_government.dds"
	use_diplomatic_range = no
	travel = no

	valid_to_create = { mandala_task_contract_valid_to_create_trigger = yes }

	valid_to_accept = {
		num_taken_task_contracts < 1
		government_has_flag = government_is_mandala
		is_available = yes
	}

	valid_to_continue = {
		save_temporary_scope_as = task_contract
		task_contract_taker = {
			mandala_task_contract_valid_to_continue_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				} 
			}
		}	
	}

	valid_to_keep = {
		save_temporary_scope_as = task_contract
		task_contract_taker = { 
			mandala_task_contract_valid_to_keep_trigger = yes
			trigger_if = {
				limit = { 
					any_character_active_contract = { this = scope:task_contract }
				}
				current_travel_plan ?= {
					OR = {
						any_future_path_location = { this = scope:task_contract.task_contract_location }
						any_visited_location = { this = scope:task_contract.task_contract_location }
					}
				}		 
			}
		}
	}

	on_create = {
		scope:contract = {
			mandala_set_ritual_variables_effect = yes
			choose_address_mandala_effect = yes
		}
	}

	on_accepted = {
		save_scope_as = task_contract
		task_contract_taker = {
			play_sound_effect = "event:/DLC/EP3/SFX/UI/Contracts/ep3_ui_contracts_accept_contract"
			mandala_travel_to_contract_location_effect = {
				DESTINATION = scope:task_contract.task_contract_location
				ARRIVAL_EVENT = tgp_east_asia_mandala_task_contract_events.5000
			}
		}
	}

	on_completed = {
		mandala_contract_clean_up_location_effect = yes
	}

	on_invalidated = {
		mandala_contract_clean_up_location_effect = yes
	}

	task_contract_reward = {
		common_mandala = {
			effect = {
				custom_tooltip = mandala_generic_reward_tt
			}
		}
		failure_standard = {
			visible = no
			effect = { 
				task_contract_taker = { mandala_contract_failure_standard_reward_effect = yes }
			}
		}
	}
}
