namespace = easteregg_event

##################################################
# #Vanity Events
# 0001 - 10002	Charna and Jakub duel
##################################################

#	Secret event to decide who should have the rock.
easteregg_event.0001 = {
	hidden = yes
	scope = none
	
	trigger = {
		game_start_date <= 1070.1.1
		exists = character:easteregg_jakub_potapczyk
		exists = character:easteregg_charna_frostwhisper
	}

	immediate = {
		character:easteregg_jakub_potapczyk = {
			configure_start_single_combat_effect = {
				SC_INITIATOR = character:easteregg_jakub_potapczyk
				SC_ATTACKER = character:easteregg_jakub_potapczyk
				SC_DEFENDER = character:easteregg_charna_frostwhisper
				FATALITY = no
				FIXED = no
				LOCALE = terrain_scope
				INVALIDATION_EVENT = single_combat.1006
				OUTPUT_EVENT = easteregg_event.0002
			}
		}
	}
}

easteregg_event.0002 = {
	hidden = yes

	immediate = {
		#	If Jakub wins, he takes back his beloved rock. Charna will not forget that.
		if = {
			limit = { scope:sc_victor = character:easteregg_jakub_potapczyk }
			scope:sc_victor = {
				add_character_modifier = prison_pet_stone_modifier
				set_relation_rival = {
					target = scope:sc_loser
					reason = rival_rock
				}
			}
			scope:sc_loser = {remove_character_modifier = prison_pet_stone_modifier}
		}
		#	Otherwise, Charna won, and Jakub will never, ever forgive her.
		else = {
			scope:sc_victor = {
				set_relation_rival = {
					target = scope:sc_loser
					reason = rival_rock
				}
			}
		}
	}
}
