﻿###

re_raise_to_nobility_effect = {
	
	scope:recipient = {
		custom_tooltip = re_raise_to_nobility_tt

		create_dynasty = {
			
	    }
		add_opinion = {
			target = scope:actor
			opinion = 50
			modifier = grateful_opinion
		}
        add_trait = loyal
	}

	scope:actor = {
		if = {
			limit = {
				can_add_hook = {
					target = scope:recipient
					type = strong_obligation_hook
				}
				scope:recipient = {
					ai_honor >= 0
				}
			}
			add_hook = {
				type = strong_obligation_hook
				target = scope:recipient
			}
		}
		else_if = {
			limit = {
				can_add_hook = {
					target = scope:recipient
					type = obligation_hook
				}
				scope:recipient = {
					ai_honor < 0
				}
			}
			add_hook = {
				type = obligation_hook
				target = scope:recipient
			}
		}
	}
}

hc_cleanup_parents_effect = {
    if = {
        limit = { exists = scope:hc_random_mother }
        scope:hc_random_mother = { death = { death_reason = death_disappearance } }
    }
    if = {
        limit = { exists = scope:hc_random_father }
        scope:hc_random_father = { death = { death_reason = death_disappearance } }
    }
}

hc_sync_children_house_effect = {
	if = {
		limit = { any_child = { NOT = { house = root.house } } }
		every_child = {
			limit = { NOT = { house = root.house } }
			set_house = root.house
		}
	}
}