Moved mound digging to a quest
This commit is contained in:
parent
300b559ba3
commit
0c25f928dc
BIN
DigControl.esp
Normal file
BIN
DigControl.esp
Normal file
Binary file not shown.
BIN
scripts/_00E_DigControl.pex
Normal file
BIN
scripts/_00E_DigControl.pex
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
79
source/scripts/_00E_DigControl.psc
Normal file
79
source/scripts/_00E_DigControl.psc
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
Scriptname _00E_DigControl extends Quest Hidden
|
||||||
|
|
||||||
|
import Utility
|
||||||
|
|
||||||
|
bool function Dig()
|
||||||
|
|
||||||
|
; Play the mauling animation in werewolf form
|
||||||
|
if PlayerREF.GetRace() == _00E_Theriantrophist_PlayerWerewolfRace
|
||||||
|
if PlayerREF.IsInCombat()
|
||||||
|
_00E_TreasureMarkerScript_sCannotDigInCombat.Show()
|
||||||
|
return false
|
||||||
|
endif
|
||||||
|
Game.DisablePlayerControls(true, true, true, true, true, true, true, true)
|
||||||
|
Debug.SendAnimationEvent(PlayerREF, "pa_KillWerewolfPairedMaulingWithHuman")
|
||||||
|
Wait(4.8)
|
||||||
|
Game.EnablePlayerControls()
|
||||||
|
return true
|
||||||
|
endif
|
||||||
|
|
||||||
|
if PlayerREF.GetItemCount(ShovelKeyword) == 0
|
||||||
|
_00E_TreasureMarkerScript_sShovelNeeded.Show()
|
||||||
|
return false
|
||||||
|
endif
|
||||||
|
|
||||||
|
if PlayerREF.IsInCombat()
|
||||||
|
_00E_TreasureMarkerScript_sCannotDigInCombat.Show()
|
||||||
|
return false
|
||||||
|
endif
|
||||||
|
|
||||||
|
Game.DisablePlayerControls(true, true, true, true, true, true, true, true)
|
||||||
|
Game.SetPlayerAIDriven()
|
||||||
|
|
||||||
|
bool isFirstPerson = PlayerREF.GetAnimationVariableBool("IsFirstPerson")
|
||||||
|
|
||||||
|
; Start digging
|
||||||
|
Game.ForceThirdPerson()
|
||||||
|
|
||||||
|
Form[] equippedTorches = New Form[2]
|
||||||
|
Bool torchesUnequipping = (PlayerREF as _00E_PlayerFunctions).UnequipTorches(equippedTorches)
|
||||||
|
|
||||||
|
If PlayerREF.IsWeaponDrawn() ; Sheathe the weapon
|
||||||
|
PlayerREF.PlayIdle(DefaultSheathe)
|
||||||
|
Wait(2)
|
||||||
|
ElseIf isFirstPerson ; Give some time for the camera to settle on switch to 3p
|
||||||
|
Wait(0.5)
|
||||||
|
ElseIf torchesUnequipping ; Give some time for torch unequip animations to settle
|
||||||
|
Wait(0.25)
|
||||||
|
EndIf
|
||||||
|
|
||||||
|
Debug.SendAnimationEvent(PlayerREF, "IdleSmelterEnter")
|
||||||
|
Wait(5.0)
|
||||||
|
|
||||||
|
; Stop digging
|
||||||
|
Debug.SendAnimationEvent(PlayerREF, "IdleForceDefaultState")
|
||||||
|
|
||||||
|
(PlayerREF as _00E_PlayerFunctions).ReequipTorches(equippedTorches)
|
||||||
|
Wait(1)
|
||||||
|
|
||||||
|
Game.SetPlayerAIDriven(false)
|
||||||
|
Game.EnablePlayerControls()
|
||||||
|
|
||||||
|
If isFirstPerson
|
||||||
|
Game.ForceFirstPerson()
|
||||||
|
EndIf
|
||||||
|
|
||||||
|
return true
|
||||||
|
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
Actor Property PlayerRef Auto
|
||||||
|
|
||||||
|
Message Property _00E_TreasureMarkerScript_sCannotDigInCombat Auto
|
||||||
|
Message Property _00E_TreasureMarkerScript_sShovelNeeded Auto
|
||||||
|
|
||||||
|
Keyword Property ShovelKeyword Auto
|
||||||
|
|
||||||
|
Idle Property DefaultSheathe Auto
|
||||||
|
|
||||||
|
Race Property _00E_Theriantrophist_PlayerWerewolfRace Auto
|
@ -19,3 +19,5 @@ _00E_SoundControl Property SoundControl Auto
|
|||||||
_00E_SympathyControl Property SympathyControl Auto
|
_00E_SympathyControl Property SympathyControl Auto
|
||||||
|
|
||||||
_00E_MiningControl Property MiningControl Auto
|
_00E_MiningControl Property MiningControl Auto
|
||||||
|
|
||||||
|
_00E_DigControl Property DigControl Auto
|
||||||
|
@ -63,6 +63,10 @@ _00E_MiningControl function GetMiningControl() Global
|
|||||||
return (Game.GetForm(0x14) as _00E_PlayerFunctions).ControlRepository.MiningControl
|
return (Game.GetForm(0x14) as _00E_PlayerFunctions).ControlRepository.MiningControl
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
_00E_DigControl function GetDigControl() Global
|
||||||
|
return (Game.GetForm(0x14) as _00E_PlayerFunctions).ControlRepository.DigControl
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
;=====================================================================================
|
;=====================================================================================
|
||||||
; Stop/restart random headtracking
|
; Stop/restart random headtracking
|
||||||
|
@ -1,125 +1,39 @@
|
|||||||
Scriptname _00E_TreasureMarkerScript extends ObjectReference
|
Scriptname _00E_TreasureMarkerScript extends ObjectReference
|
||||||
|
|
||||||
Import Utility
|
|
||||||
|
|
||||||
;=====================================================================================
|
|
||||||
; EVENTS
|
|
||||||
;=====================================================================================
|
|
||||||
|
|
||||||
Event OnInit()
|
Event OnInit()
|
||||||
Self.BlockActivation()
|
BlockActivation()
|
||||||
endEvent
|
endEvent
|
||||||
|
|
||||||
Auto State Waiting
|
Auto State Waiting
|
||||||
|
|
||||||
Event OnActivate (ObjectReference akActionRef)
|
Event OnActivate (ObjectReference akActionRef)
|
||||||
|
|
||||||
; Play the mauling animation in werewolf form
|
if akActionRef != Game.GetForm(0x14)
|
||||||
if akActionRef == PlayerREF && PlayerREF.GetRace() == Game.GetFormFromFile(0x2EE47, "Enderal - Forgotten Stories.esm") as Race
|
|
||||||
Game.DisablePlayerControls(true, true, true, true, true, true, true, true)
|
|
||||||
Debug.SendAnimationEvent(PlayerREF, "pa_KillWerewolfPairedMaulingWithHuman")
|
|
||||||
Utility.Wait(4.8)
|
|
||||||
Self.BlockActivation(False)
|
|
||||||
Game.EnablePlayerControls()
|
|
||||||
Self.Activate(PlayerREF)
|
|
||||||
GoToState("Alldone")
|
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
If akActionRef.GetItemCount(ShovelKeyword) > 0
|
GotoState("PlayerDigging")
|
||||||
TreasureDigger = akActionRef as Actor
|
|
||||||
if TreasureDigger.IsInCombat()
|
|
||||||
_00E_TreasureMarkerScript_sCannotDigInCombat.Show()
|
|
||||||
Else
|
|
||||||
GoToState("CurrentlyDigging")
|
|
||||||
EndIf
|
|
||||||
Else
|
|
||||||
_00E_TreasureMarkerScript_sShovelNeeded.Show()
|
|
||||||
EndIf
|
|
||||||
|
|
||||||
EndEvent
|
EndEvent
|
||||||
|
|
||||||
EndState
|
EndState
|
||||||
|
|
||||||
State CurrentlyDigging
|
State PlayerDigging
|
||||||
|
|
||||||
Event OnBeginState()
|
Event OnBeginState()
|
||||||
|
|
||||||
Form[] equippedTorches = New Form[2]
|
if _00E_PlayerFunctions.GetDigControl().Dig()
|
||||||
Bool isFirstPerson = False
|
BlockActivation(false)
|
||||||
|
GoToState("DoNothing")
|
||||||
; Start digging
|
Activate(Game.GetForm(0x14) as Actor)
|
||||||
If TreasureDigger == PlayerREF
|
else
|
||||||
Game.SetPlayerAIDriven()
|
GoToState("Waiting")
|
||||||
Game.DisablePlayerControls(true, true, true, true, true, true, true, true)
|
endif
|
||||||
isFirstPerson = PlayerREF.GetAnimationVariableBool("IsFirstPerson")
|
|
||||||
Game.ForceThirdPerson()
|
|
||||||
EndIf
|
|
||||||
|
|
||||||
; TreasureDigger.PathToReference(Self, 1.0)
|
|
||||||
|
|
||||||
If TreasureDigger == PlayerREF
|
|
||||||
Bool torchesUnequipping = (PlayerREF as _00E_PlayerFunctions).UnequipTorches(equippedTorches)
|
|
||||||
|
|
||||||
If TreasureDigger.IsWeaponDrawn() ; Sheathe the weapon
|
|
||||||
TreasureDigger.PlayIdle(DefaultSheathe)
|
|
||||||
Wait(2)
|
|
||||||
ElseIf isFirstPerson ; Give some time for the camera to settle on switch to 3p
|
|
||||||
Wait(0.5)
|
|
||||||
ElseIf torchesUnequipping ; Give some time for torch unequip animations to settle
|
|
||||||
Wait(0.25)
|
|
||||||
EndIf
|
|
||||||
EndIf
|
|
||||||
|
|
||||||
Debug.SendAnimationEvent(TreasureDigger, "IdleSmelterEnter")
|
|
||||||
Wait(5.0)
|
|
||||||
|
|
||||||
; Stop digging
|
|
||||||
Debug.SendAnimationEvent(TreasureDigger, "IdleForceDefaultState")
|
|
||||||
If TreasureDigger == PlayerREF
|
|
||||||
Game.SetPlayerAIDriven(false)
|
|
||||||
Game.EnablePlayerControls()
|
|
||||||
(PlayerREF as _00E_PlayerFunctions).ReequipTorches(equippedTorches)
|
|
||||||
Else
|
|
||||||
(TreasureDigger as Actor).EvaluatePackage()
|
|
||||||
EndIf
|
|
||||||
|
|
||||||
Wait(1)
|
|
||||||
|
|
||||||
If TreasureDigger == PlayerREF && isFirstPerson == True
|
|
||||||
Game.ForceFirstPerson()
|
|
||||||
EndIf
|
|
||||||
|
|
||||||
Self.BlockActivation(False)
|
|
||||||
Self.Activate(TreasureDigger)
|
|
||||||
GoToState("Alldone")
|
|
||||||
|
|
||||||
EndEvent
|
EndEvent
|
||||||
|
|
||||||
EndState
|
EndState
|
||||||
|
|
||||||
State AllDone
|
State DoNothing
|
||||||
|
; Nothing to do here
|
||||||
Event OnBeginState()
|
|
||||||
|
|
||||||
;Nothing to do here
|
|
||||||
|
|
||||||
EndEvent
|
|
||||||
|
|
||||||
;Nothing to do here
|
|
||||||
|
|
||||||
EndState
|
EndState
|
||||||
|
|
||||||
|
|
||||||
;=====================================================================================
|
|
||||||
; PROPERTIES
|
|
||||||
;=====================================================================================
|
|
||||||
|
|
||||||
Actor TreasureDigger
|
|
||||||
|
|
||||||
Message Property _00E_TreasureMarkerScript_sCannotDigInCombat Auto
|
|
||||||
Message Property _00E_TreasureMarkerScript_sShovelNeeded Auto
|
|
||||||
|
|
||||||
Keyword Property ShovelKeyword Auto
|
|
||||||
Actor Property PlayerREF Auto
|
|
||||||
Idle Property DefaultSheathe Auto
|
|
||||||
|
Loading…
Reference in New Issue
Block a user