# Character scope
on_yearly_pulse = {
	effect = {
		decrease_visibility_effect = yes # Secret society visibility reduction
	}

	events = {
		MNM.9815 # Seal of Solomon artifact makes you immune to possession
	}

	random_events = {
		# AI secretly convert event
		35 = MNM.3948 # Convert to spouse/friend/province

		# Monks and Mystics events
		 30 = MNM.7823 # AI-only disciple recruitment
		100 = MNM.9000 # Artifact rumor
		100 = MNM.3910 # Commission painting


		# Artifact events
		500 = MNM.9816 # Blessed Mantle allows you to make Water of the Blessed Mantle (-> logic)
	}
}

# Character scope
on_five_year_pulse = {
	events = {
		MNM.10030 # Have AI characters join societies
	}
}

# ROOT is the owner of the winning unit
# FROM is the taken holding title
on_siege_over_winner = {
	events = {
		MNM.6222 # Assassins occupy holding
		MNM.7111 # Devil Worshipers desecrate holding
		MNM.9900 # Chance to steal artifact from capital holdings
	}
}

# Character scope
on_birth = {
	events = {
		MNM.1206  # A Child is born, Hermetic Scrying vision fulfilled
		MNM.7508  # DW Demon child
		MNM.20005 # Satanic orgy child born
	}
}

# Character scope
on_adulthood = {
	events = {
		MNM.1269 # Horoscoped child gets new modifiers
		MNM.4302 # Monastic Order education bonus purity effect
	}
}

on_adolescence = { # Checked on 12th birthday.
	events = {
		MNM.3429 # Educator/guardian/parent with secret religion get a chance to convince child to convert secretly
	}
}

# Childhood - pulse fires at ages 6 years plus six months, 8 years plus six months and 10 years plus six months
on_childhood_pulse = {
	events = {
		MNM.4300 # Monastic Order childhood education event
	}

	random_events = {
	}
}

# Triggers when someone gets imprisoned for any reason
# ROOT is prisoner
# FROM is imprisoner
on_become_imprisoned_any_reason = {
	events = {
		MNM.9033 # Imprisoned councillor cannot hunt for relics
	}
}

# Character scope, isn't dead yet
on_death = {
	events = {
		MNM.6844 # Removes mark of death block for Assassins GM
		MNM.6991 # Clears any quests targeting this character
		MNM.6012 # Transfers assassins debt to heir
		MNM.1415 # Announces hermetics apprentice death
		MNM.9030 # Notify of dead relic hunter
		MNM.1611 # Clears Apprentice minor titles
	}

	random_events = {
		100 = MNM.1207 # Hermetic Scrying vision fulfilled
	}
}

GRANT_LANDED_TITLE_INTERACTION_ACCEPT_EVENT = {
	events = {
		MNM.1217 # Hermetics Scrying: handle loss of titles
	}
}

GRANT_VICE_ROYALTY_INTERACTION_ACCEPT_EVENT = {
	events = {
		MNM.1217 # Hermetics Scrying: handle loss of titles
	}
}

# When the religion changes in a county
# ROOT is province
# FROM has the old religion
on_county_religion_change = {
	events = {
		MNM.6206 # Convert province assassin quest
	}
}

# ROOT is the character
# FROM is the title
# FROMFROM is the old holder
on_new_holder = {
	events = {
		MNM.6990 # Makes sure d_fedayeen owner is always shiite & member of the_assassins
		MNM.1215 # The Hermetics Scrying Power result (for new holder)
	}

	random_events = {
		scrying_result_lost_title = {
			delay = 1 # MNM.1217 must be allowed to fire first

			1 = MNM.1218 # The Hermetics Scrying Power result (for old holder)
		}
	}
}

# ROOT is the character
# FROM is the title
# FROMFROM is the old holder
on_new_holder_inheritance = {
	events = {
		MNM.6990 # Makes sure d_fedayeen owner is always shiite & member of the_assassins
		MNM.1215 # The Hermetics Scrying Power result (for new holder)
	}

	random_events = {
		scrying_result_lost_title = {
			delay = 1 # MNM.1217 must be allowed to fire first

			1 = MNM.1218 # The Hermetics Scrying Power result (for old holder)
		}
	}
}

# ROOT is the character
# FROM is the title
# FROMFROM is the old holder
on_new_holder_usurpation = {
	events = {
		MNM.6990 # Makes sure d_fedayeen owner is always shiite & member of the_assassins
		MNM.1215 # The Hermetics Scrying Power result (for new holder)
		# MNM.6230 # Clearing covert province quest if new owner
	}

	random_events = {
		scrying_result_lost_title = {
			delay = 1 # MNM.1217 must be allowed to fire first

			1 = MNM.1218 # The Hermetics Scrying Power result (for old holder)
		}

	}
}

# ROOT is builder
# FROM is title
on_settlement_construction_completed = {
	events = {
		MNM.4026 # Monastic order society mission completed
	}
}

# Fires every two years for characters who are members of any society
on_society_bi_yearly_pulse = {
	events = {
		MNM.6198 # Assassins quest tombola
		MNM.7200 # Devil Worshipers quest tombola
		MNM.4000 # Monastic order quest tombola
		MNM.3000 # Secret religious society quest tombola - disabled in event trigger
		MNM.1000 # Hermetics quest tombola
		MNM.7000 # Devil Worshipers: soul corruption chance
	}

	random_events = {
		100 = MNM.20000 # Devil Worshippers: Orgy
		100 = MNM.20012 # Devil Worshippers: Night on the Town
		100 = MNM.20043 # Devil Worshippers: Impersonating Priests
		100 = MNM.20061 # Devil Worshippers: Infernal Choir (only with Rivals)
		100 = MNM.6900  # Assassins: friend or foe?
		100 = MNM.6910  # Assassins: assisting a murder plot
		100 = MNM.3260  # Monastic Orders: Advising a Poet
		100 = MNM.4200  # Monastic Orders: Learning about Roses
		100 = MNM.4210  # Monastic Orders: Fellow member drowsing off
		100 = MNM.4435  # Monastic Orders: Friendship & Love
		100 = MNM.4217  # Monastic Order: Burn heretical books
		100 = MNM.3920  # Secret Religious societies: Worried member
		100 = MNM.3930  # Secret Religious societies: Fellow society member goes for a round
		100 = MNM.3505  # Secret Religious societies: Get help from another member with problematic trait
		100 = MNM.3502  # Secret Religious societies: I am so stressed
		 75 = MNM.20032 # Devil Worshippers: Grand Summoning
		 75 = MNM.7855  # Devil Worshipers: Demon Hunters Attack
		 50 = MNM.10020 # Criminal societies: stressed
		 50 = MNM.6920  # Assassins: blackmailing superior
		 50 = MNM.4610  # Monastic Orders: Monastery has Artifact
		 50 = MNM.1620  # Hermetic Society: Divine Summoning
		 50 = MNM.1460  # Hermetic Society: Gathering of the Minds
		 50 = MNM.5110  # Hermetic Society: Warding off Evil
		 50 = MNM.10040 # Every society: Gain rival
		 50 = MNM.10043 # Every society: Gain friend (or possibly lover...?)
	}
}

# A character has switched their society interest
# ROOT is character
# FROM is society
on_character_switch_society_interest = {
	events = {
		MNM.10010 # Back-up event for showing interest
		MNM.10024 # Back-up for refounding societies
	}
}

# A character ranks up in their society, or becomes grandmaster
# ROOT is character
# FROM is society
on_character_society_rank_up = {
	events = {
		MNM.1750 # Grandmaster notification event
	}
}

# A character leaves or is forced to leave a society
# ROOT is character
# FROM is society
on_character_leave_society = {
	events = {
		MNM.10018 # Clears on-going event flags and effects
		MNM.1611  # Clears Apprentice minor titles
	}
}

# A character asks to join a society. Only works on player
# ROOT is character
# FROM is society
on_character_ask_to_join_society = {
	events = {
		MNM.100   # Join Hermetics
		MNM.4450  # Join Monastic Order
		MNM.10024 # Backup for refounding societies
	}
}

# A character is removed from society for failing the potential trigger
# ROOT is character
# FROM is society
on_character_kicked_from_society = {
	events = {
		MNM.10021 # Excluded from society due to breaking the limitations
	}
}

# A character stops showing interest in a society for failing the CanJoin trigger.
# ROOT is character
# FROM is society
on_character_stop_showing_interest = {
	events = {
		MNM.10019 # Handles the logic
	}
}

# A character succeeds in a quest. This happens just before the quest disappears, so you can access the quest itself. Only invoked when a quest is cleared via script. E.G., does not happen on death
# ROOT is character
on_quest_success = {
	events = {
		MNM.6666 # Add mission influence modifier to society
	}
}

# A character fails a quest. This happens just before the quest disappears, so you can access the quest itself. Only invoked when a quest is cleared via script. E.G., does not happen on death
# ROOT is character
on_quest_failure = {
	events = {
		MNM.6667 # Add mission influence modifier to society
	}
}