﻿#On actions about titles

# All on-actions in this file provide scope:transfer_type unless otherwise noted
# scope:transfer_type has the following permutations:
# flag:conquest
# flag:conquest_holy_war
# flag:conquest_claim
# flag:conquest_populist
# flag:inheritance
# flag:abdication
# flag:destroyed
# flag:created
# flag:usurped
# flag:granted
# flag:revoked
# flag:election
# flag:independency
# flag:returned
# flag:leased_out
# flag:lease_revoked
# flag:faction_demand
# flag:swear_fealty
# flag:stepped_down

# A title is destroyed
# root = the holder before destruction
# scope:landed_title = the title that is being destroyed
# Does *not* provide scope:transfer_type
on_title_destroyed = {
	on_actions = {
		regula_title_law_maint
	}
}

# A title is transferred to a new character
# root = the new holder
# scope:title = the title that changes hands
# scope:previous_holder = previous holder. Might be dead
on_title_gain = {
	on_actions = {
		regula_title_law_maint
	}
}

# A title is lost by a character
# root = the old holder
# scope:title = the title that changes hands
# scope:new_holder = new holder.
on_title_lost = {
	on_actions = {
		regula_title_law_maint
	}
}

# root - Character who changed government
# scope:old_government - Character's old government type
# Use this to fix the Magisters title law when government type changes
on_government_change = {
	on_actions = {
		regula_title_law_maint
	}
}

# Run our RM title law maint events
regula_title_law_maint = {
	events = {
		# Laws Maintenance
		regula_paelex_event.0001  # Sets inheritance laws for Magister
		regula_paelex_event.0002  # Sets inheritance laws for vassals of the Magister
		regula_paelex_event.0003  # Sets succession law for vassals of the Magister (Administrative Governments)
	}
}