enderalse/source/scripts/_00e_nq06_functions.psc

178 lines
4.5 KiB
Plaintext

Scriptname _00E_NQ06_Functions extends Quest
;=====================================================================================
; FUNCTIONS
;=====================================================================================
Function SetHorseName()
_00E_HorseOwned.SetValueInt(1)
if ! SKSE.GetVersion()
return
endif
sHorseName = SetMountName()
ActorBase PlayerHorseBase = PlayerHorse.GetActorReference().GetActorBase()
If sHorseName != ""
PlayerHorseBase.SetName(sHorseName)
ElseIf PlayerHorseBase.GetName() == ""
sHorseName = _00E_HorseName.GetName()
PlayerHorseBase.SetName(sHorseName)
Else
sHorseName = PlayerHorseBase.GetName()
EndIf
EndFunction
Function SetMuleName()
_00E_MuleOwned.SetValueInt(1)
if ! SKSE.GetVersion()
return
endif
sMuleName = SetMountName()
ActorBase PlayerMuleBase = Bonni.GetActorReference().GetActorBase()
If sMuleName != ""
PlayerMuleBase.SetName(sMuleName)
ElseIf PlayerMuleBase.GetName() == ""
sMuleName = _00E_MuleName.GetName()
PlayerMuleBase.SetName(sMuleName)
Else
sMuleName = PlayerMuleBase.GetName()
EndIf
EndFunction
Function SetFatherShadowName()
_00E_FathersShadowOwned.SetValueInt(1)
if ! SKSE.GetVersion()
return
endif
sFathersShadowName = SetMountName()
ActorBase PlayerFathersShadowBase = FS_NQR05_FatherShadow.GetActorReference().GetActorBase()
If sFathersShadowName != ""
PlayerFathersShadowBase.SetName(sFathersShadowName)
ElseIf PlayerFathersShadowBase.GetName() == ""
sFathersShadowName = _00E_FathersShadowName.GetName()
PlayerFathersShadowBase.SetName(sFathersShadowName)
Else
sFathersShadowName = PlayerFathersShadowBase.GetName()
EndIf
EndFunction
String Function SetMountName()
return (((Self as QUEST) as FORM) as UILIB_1).ShowTextInput("$How would you like to call your mount?")
EndFunction
Function RenameMount(bool _bReturnToSelection)
if SKSE.GetVersion()
int iRenameSelection = _00E_NQ06_RenameMountSelection.Show()
If iRenameSelection == 0
SetMuleName()
ElseIf iRenameSelection == 1
SetHorseName()
ElseIf iRenameSelection == 2
SetFatherShadowName()
EndIf
ReturnToSelection(_bReturnToSelection)
else
Debug.Notification("Renaming requires SKSE")
endif
EndFunction
Function ReturnToSelection(bool _bReturnToSelection)
If _bReturnToSelection
((Self as Quest).GetAliasByName("HorseFlute") as _00E_HorseFlute_SC).PrepareTeleport()
EndIf
EndFunction
Function AddHorseFlute()
If !bHasFlute
NQ06_Freda_Chest.RemoveItem(_00E_HorseFlute_New, 1, false, PlayerREF)
_00E_NQ06_HorsefluteAdded.Show()
bHasFlute = true
EndIf
_00E_MountGlobal.SetValueInt(_00E_MountGlobal.GetValueInt()+1)
EndFunction
Function EnableGnarldalf()
; SetAlly to the player, so that friendly fire doesn't cause a
; bounty on the player.
NQ06_GnarldalfREF.Enable()
Utility.Wait(0.5)
ArkYrintoMerchantFaction.SetAlly(PlayerFaction)
NPCTrollCombatIdleRoar.Play(NQ06_GnarldalfREF)
NQ06_GnarldalfREF.StartCombat(PlayerREF)
EndFunction
Function RemoveAlly()
; Revert the SetAlly.
ArkYrintoMerchantFaction.SetEnemy(PlayerFaction, true, true)
EndFunction
Function NQ06SceneFailsave()
If !NQ06_SC1.IsPlaying()
NQ06_SC1.ForceStart()
EndIf
EndFunction
;=====================================================================================
; PROPERTIES
;=====================================================================================
bool bHasFlute = false
Actor Property NQ06_GnarldalfREF Auto
Actor Property PlayerREF Auto
ObjectReference Property NQ06_Freda_Chest Auto
GlobalVariable Property _00E_MountGlobal Auto
GlobalVariable Property _00E_HorseOwned Auto
GlobalVariable Property _00E_MuleOwned Auto
GlobalVariable Property _00E_FathersShadowOwned Auto
String Property sHorseName Auto Hidden
String Property sMuleName Auto Hidden
String Property sFathersShadowName Auto Hidden
Sound Property NPCTrollCombatIdleRoar Auto
Scene Property NQ06_SC1 Auto
Message Property _00E_NQ06_HorsefluteAdded Auto
Message Property _00E_NQ06_RenameMountSelection Auto
ReferenceAlias Property PlayerHorse Auto
ReferenceAlias Property Bonni Auto
ReferenceAlias Property FS_NQR05_FatherShadow Auto
Armor Property _00E_HorseFlute_New Auto
Faction Property PlayerFaction Auto
Faction Property ArkYrintoMerchantFaction Auto
Message Property _00E_HorseName Auto
Message Property _00E_MuleName Auto
Message Property _00E_FathersShadowName Auto