Scriptname _00E_NQ14_Functions extends Quest  

;=====================================================================================
;              							FUNCTIONS                  					 
;=====================================================================================

Function StartSC01()

	CompleteAllObjectives()
	_00E_EPHandler.GiveEP(230)
	NQ14_SC1_FightSC.ForceStart()
	_00E_NQ14_BunvarREF.StartCombat(_00E_NQ14_UlvarREF)
	
EndFunction

Function StartCombatFailsave()

	_00E_NQ14_BunvarREF.StartCombat(_00E_NQ14_UlvarREF)

EndFunction

Function UlvarStopCombat()

	_00E_NQ14_BunvarREF.StopCombat()
	_00E_NQ14_BunvarREF.StopCombatAlarm()
	_00E_NQ14_UlvarREF.StopCombat()
	_00E_NQ14_UlvarREF.StopCombatAlarm()

EndFunction

Function PlayJesparComment()

	RegisterForSingleUpdate(2.0)

EndFunction

Event OnUpdate()
	If _00E_MC_JesparREF.Is3DLoaded()
		if CompanionIsTalking.GetValueInt() == 0
			CompanionIsTalking.SetValueInt(1)
		EndIf
		_00E_MC_JesparREF.Say(NQ14_D00_Jespar_FlavourTopic)
	EndIf
Endevent

Function GiveEPForQuest()

	_00E_EPHandler.GiveEP(230)

EndFunction

Function TriggerPackageUpdate()

	RegisterForSingleUpdateGameTime(12.0)
	
EndFunction

Function SwitchBrothersToCampSandbox()

	_00E_NQ14_BunvarREF.AddToFaction(NQ14CampSandboxFaction)
	_00E_NQ14_UlvarREF.AddToFaction(NQ14CampSandboxFaction)
	
EndFunction

Event OnUpdateGameTime()

	SwitchBrothersToCampSandbox()
	
EndEvent

;=====================================================================================
;              							PROPERTIES                  					 
;=====================================================================================

Actor Property _00E_NQ14_BunvarREF Auto
Actor Property _00E_NQ14_UlvarREF Auto
Actor Property _00E_MC_JesparREF Auto

Topic Property NQ14_D00_Jespar_FlavourTopic Auto

GlobalVariable Property CompanionIsTalking Auto

Scene Property NQ14_SC1_FightSC Auto

Faction Property NQ14CampSandboxFaction Auto