﻿
# ep1_notifications.0001 -- Court Grandeur Changed
# ep1_notifications.0011 -- You have changed your Court Language
# ep1_notifications.0012 -- Someone has changed their Court Language away from ours
# ep1_notifications.0013 -- Someone has changed their Court Language to ours

namespace = ep1_notifications

#### Court Grandeur Changed
# Requires the following scopes: 
# root = character changing level
# scope:old_value = old level
# scope:new_value = new level
ep1_notifications.0001 = {
	type = character_event
	hidden = yes

	trigger = {
		is_ai = no
	}

	immediate = {
		save_scope_as = court_character
		if = { # Grandeur increased
			limit = {
				scope:new_value > scope:old_value
			}
			if = { # Ranked up to rank 4
				limit = {
					scope:old_value < court_grandeur_rank_4_min_level
					scope:new_value >= court_grandeur_rank_4_min_level
				}
				send_interface_toast = {
					type = msg_court_grandeur_good
					title = COURT_GRANDEUR_TOAST_GRANDEUR_RANK_INCREASED_TITLE
					custom_tooltip = COURT_GRANDEUR_TOAST_GRANDEUR_INCREASED_DESCRIPTION
					left_icon = root
				}
				play_sound_effect = "event:/DLC/EP1/SFX/UI/Notifications/court_grandeur_lvl_up_tier_3"
				play_sound_effect = "event:/DLC/EP1/SFX/UI/Notifications/court_grandeur_num_change"
			}
			else_if = { # Ranked up to rank 3
				limit = {
					scope:old_value < court_grandeur_rank_3_min_level
					scope:new_value >= court_grandeur_rank_3_min_level
				}
				send_interface_toast = {
					type = msg_court_grandeur_good
					title = COURT_GRANDEUR_TOAST_GRANDEUR_RANK_INCREASED_TITLE
					custom_tooltip = COURT_GRANDEUR_TOAST_GRANDEUR_INCREASED_DESCRIPTION
					left_icon = root
				}
				play_sound_effect = "event:/DLC/EP1/SFX/UI/Notifications/court_grandeur_lvl_up_tier_2"
				play_sound_effect = "event:/DLC/EP1/SFX/UI/Notifications/court_grandeur_num_change"
			}
			else_if = { # Ranked up to rank 2
				limit = {
					scope:old_value < court_grandeur_rank_2_min_level
					scope:new_value >= court_grandeur_rank_2_min_level
				}
				send_interface_toast = {
					type = msg_court_grandeur_good
					title = COURT_GRANDEUR_TOAST_GRANDEUR_RANK_INCREASED_TITLE
					custom_tooltip = COURT_GRANDEUR_TOAST_GRANDEUR_INCREASED_DESCRIPTION
					left_icon = root
				}
				play_sound_effect = "event:/DLC/EP1/SFX/UI/Notifications/court_grandeur_lvl_up_tier_1"
				play_sound_effect = "event:/DLC/EP1/SFX/UI/Notifications/court_grandeur_num_change"
			}
			else = { # Level up, but no rank up
				send_interface_toast = {
					type = msg_court_grandeur_good
					title = COURT_GRANDEUR_TOAST_GRANDEUR_INCREASED_TITLE
					custom_tooltip = COURT_GRANDEUR_TOAST_GRANDEUR_INCREASED_DESCRIPTION
					left_icon = root
				}
			}

			# Play level up sound			
			play_sound_effect = "event:/DLC/EP1/SFX/UI/Notifications/court_grandeur_toast_lvl_up"
			play_sound_effect = "event:/DLC/EP1/SFX/UI/Notifications/court_grandeur_num_change"
		}
		else = { # Grandeur decreased
			send_interface_toast = {
				type = msg_court_grandeur_bad
				title = COURT_GRANDEUR_TOAST_GRANDEUR_DECREASED_TITLE
				custom_tooltip = COURT_GRANDEUR_TOAST_GRANDEUR_DECREASED_DESCRIPTION
				left_icon = root
			}
			
			# Play level down sound
			play_sound_effect = "event:/DLC/EP1/SFX/UI/Notifications/court_grandeur_toast_lvl_down"
			play_sound_effect = "event:/DLC/EP1/SFX/UI/Notifications/court_grandeur_num_change"
		}
	}
}

#### Your Court Language Changed
# Only characters with the new or old language of the changing character will get this notification. 
# root = character observing the change
# scope:target_character = character changing language
ep1_notifications.0011 = {
	type = character_event
	hidden = yes

	trigger = {
		is_ai = no
		root = scope:target_character
	}

	immediate = {
		send_interface_message = {	
			type = msg_court_language
			title = ep1_notifications.0011.t
			custom_tooltip = ep1_notifications.0011.desc
			left_icon = scope:target_character
		}
	}
}

#### Someone has changed their Court Language away from ours
# Only characters with the new or old language of the changing character will get this notification. 
# root = character observing the change
# scope:target_character = character changing language
ep1_notifications.0012 = {
	type = character_event
	hidden = yes

	trigger = {
		is_ai = no
		NOT = {
			root = scope:target_character
			has_same_court_language = scope:target_character 
		}
	}

	immediate = {
		send_interface_message = {
			type = msg_court_language
			title = ep1_notifications.0012.t
			custom_tooltip = ep1_notifications.0012.desc
			left_icon = scope:target_character
		}
	}
}

#### Someone has changed their Court Language to ours
# Only characters with the new or old language of the changing character will get this notification. 
# root = character observing the change
# scope:target_character = character changing language
ep1_notifications.0013 = {
	type = character_event
	hidden = yes

	trigger = {
		is_ai = no
		root != scope:target_character
		has_same_court_language = scope:target_character 
	}

	immediate = {
		send_interface_message = {
			type = msg_court_language
			title = ep1_notifications.0013.t
			custom_tooltip = ep1_notifications.0013.desc
			left_icon = scope:target_character
		}
	}
}
