han_invasion = {
	name = CB_NAME_TAOFA
	war_name = WAR_NAME_TAOFA
	sprite = 17
	truce_days = 3650
	is_permanent = yes
	check_de_jure_tier = KING # this scans all dejure duchies for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes

	allowed_to_target_tributaries = no
	allowed_to_target_suzerains = no
	
	can_use_gui = {
		ROOT = {
			prestige = 1000
		}
	}
	
	can_use = {
		ROOT = {
			culture = han
			NOT = { same_realm = FROM }
			mercenary = no
		}
		FROM = {
		culture = han
		}
	}

	is_valid = {
		ROOT = {
			independent = yes
			culture = han
			NOT = { same_realm = FROM }
		}
	}
	on_add = {
		ROOT = { 
		prestige = 100
		}
	}
	on_success = {
		any_attacker = {
			limit = { character = ROOT }
			participation_scaled_prestige = 100
		}
		any_attacker = {
			limit = { NOT = { character = ROOT } }
			hidden_tooltip = { 
				participation_scaled_prestige = 100
			}
		}
		
		FROM = { prestige = -100 }
	}

	on_success_title = {
		custom_tooltip = { 
			text = other_invasion_succ_tip
			hidden_tooltip = {
				ROOT = {
					vassalize_or_take_under_title = {
						title = PREV
						enemy = FROM
						type = invasion
					}
				}
			}
		}
		if = {
			limit = {
				holder_scope = { character = FROM }
			}
			usurp_title_only = { target = ROOT type = invasion }
		}
	}

	on_fail = {
		ROOT = { prestige = -100 }
	}

	on_reverse_demand = {
		ROOT = {
			transfer_scaled_wealth = {
				to = FROM
				value = 4.0
			}
			ROOT = { prestige = -200 }
		}
		any_defender = {
			limit = { character = FROM }
			participation_scaled_piety = 100
			participation_scaled_prestige = 200
			if = {
				limit = {
					uses_decadence = yes
				}
				participation_scaled_decadence = -10
			}
		}
		any_defender = {
			limit = { NOT = { character = FROM } }
			hidden_tooltip = { 
				participation_scaled_piety = 100
				participation_scaled_prestige = 200
				if = {
					limit = {
						uses_decadence = yes
					}
					participation_scaled_decadence = -10
				}
			}
		}
	}

	attacker_ai_victory_worth = {
		factor = -1 # always accept
	}
	
	attacker_ai_defeat_worth = {
		factor = 100
	}

	defender_ai_victory_worth = {
		factor = -1 # always accept
	}
	
	defender_ai_defeat_worth = {
		factor = 100
	}
}
han_zhentao = {
	name = CB_NAME_ZHENTAO
	war_name = WAR_NAME_ZHENTAO
	sprite = 9
	truce_days = 365
	is_permanent = yes
	check_de_jure_tier = DUKE # this scans all dejure duchies for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes

	allowed_to_target_tributaries = no
	allowed_to_target_suzerains = no
	
	can_use_gui = {
		ROOT = {
			prestige = 500
		}
	}
	
	can_use = {
		ROOT = {
			culture = han
			NOT = { same_realm = FROM }
		}
		FROM = {
		NOT = { culture = han }
		}
	}

	is_valid = {
		ROOT = {
			independent = yes
			culture = han
			NOT = { same_realm = FROM }
		}
	}

	on_success = {
		any_attacker = {
			limit = { character = ROOT }
			participation_scaled_piety = 100
			participation_scaled_prestige = 50
			if = {
				limit = {
					uses_decadence = yes
				}
				participation_scaled_decadence = -10
			}
		}
		any_attacker = {
			limit = { NOT = { character = ROOT } }
			hidden_tooltip = { 
				participation_scaled_piety = 100
				participation_scaled_prestige = 50
				if = {
					limit = {
						uses_decadence = yes
					}
					participation_scaled_decadence = -10
				}
			}
		}
		
		FROM = { piety = -100 }
		FROM = { prestige = -100 }
	}

	on_success_title = {
		custom_tooltip = {
			text = religious_cb_succ_tip
			hidden_tooltip = {
				ROOT = {
					vassalize_or_take_under_title = {
						title = PREV
						enemy = FROM
						same_religion = yes # Only vassalize rulers of my religion
						is_religious = yes
						type = invasion
					}
				}
			}
		}
	}

	on_fail = {
		ROOT = { 
			piety = -50 
			prestige = -100
		}
	}

	on_reverse_demand = {
		ROOT = {
			transfer_scaled_wealth = {
				to = FROM
				value = 4.0
			}
			piety = -75
			prestige = -150
		}
		any_defender = {
			limit = { character = FROM }
			participation_scaled_piety = 200
			participation_scaled_prestige = 100
			if = {
				limit = {
					uses_decadence = yes
				}
				participation_scaled_decadence = -10
			}
		}
		any_defender = {
			limit = { NOT = { character = FROM } }
			hidden_tooltip = { 
				participation_scaled_piety = 200
				participation_scaled_prestige = 100
				if = {
					limit = {
						uses_decadence = yes
					}
					participation_scaled_decadence = -10
				}
			}
		}
	}

	attacker_ai_victory_worth = {
		factor = -1 # always accept
	}
	
	attacker_ai_defeat_worth = {
		factor = 100
	}

	defender_ai_victory_worth = {
		factor = -1 # always accept
	}
	
	defender_ai_defeat_worth = {
		factor = 100
	}
}