|
|
@ -12,70 +12,83 @@ Event OnEffectStart(Actor akTarget, Actor akCaster) |
|
|
|
; Debug.Trace(self + ": OnEffectStart, " + akTarget) |
|
|
|
; Debug.Trace(self + ": OnEffectStart, " + akTarget) |
|
|
|
|
|
|
|
|
|
|
|
Target = akTarget |
|
|
|
Target = akTarget |
|
|
|
AnimationStage = 0 |
|
|
|
GotoState("Smoking") |
|
|
|
RegisterForSingleUpdate(1.5) |
|
|
|
|
|
|
|
RegisterForSleep() |
|
|
|
|
|
|
|
EndEvent |
|
|
|
EndEvent |
|
|
|
|
|
|
|
|
|
|
|
Event OnUpdate() |
|
|
|
state Smoking |
|
|
|
_LockAnimationUpdates() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If AnimationStage == 0 && Target.GetSitState() != 3 |
|
|
|
event OnBeginState() |
|
|
|
; Debug.Trace(self + ": OnUpdate, " + Target + ", stage " + AnimationStage + ", waiting...") |
|
|
|
; Debug.Trace(self + ": Registering for updates, " + Target) |
|
|
|
RegisterForSingleUpdate(1.0) |
|
|
|
AnimationStage = 0 |
|
|
|
ElseIf bIsFinished == False |
|
|
|
RegisterForSingleUpdate(1.5) |
|
|
|
AnimationStage += 1 |
|
|
|
RegisterForSleep() |
|
|
|
|
|
|
|
endevent |
|
|
|
; Debug.Trace(self + ": OnUpdate, " + Target + ", stage " + AnimationStage) |
|
|
|
|
|
|
|
|
|
|
|
Event OnUpdate() |
|
|
|
If AnimationStage == 1 |
|
|
|
_LockAnimationUpdates() |
|
|
|
Target.SetHeadtracking(False) |
|
|
|
|
|
|
|
Target.SetDontMove(True) |
|
|
|
If AnimationStage == 0 && Target.GetSitState() != 3 |
|
|
|
Debug.SendAnimationEvent(Target, "pipesmokingcrossleggedstartblaze") |
|
|
|
; Debug.Trace(self + ": OnUpdate, " + Target + ", stage " + AnimationStage + ", waiting...") |
|
|
|
Debug.SendAnimationEvent(Target, "pipesmokingcrossleggedblazed") |
|
|
|
RegisterForSingleUpdate(1.0) |
|
|
|
RegisterForSingleUpdate(2.5) |
|
|
|
ElseIf bIsFinished == False |
|
|
|
ElseIf AnimationStage == 2 |
|
|
|
AnimationStage += 1 |
|
|
|
Debug.SendAnimationEvent(Target, "pipesmokingcrosslegged") |
|
|
|
|
|
|
|
_00E_Smoking_PipeSmokingSmokeExhaleEffect.Play(Target, -1 as Float, none) |
|
|
|
; Debug.Trace(self + ": OnUpdate, " + Target + ", stage " + AnimationStage) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If AnimationStage == 1 |
|
|
|
|
|
|
|
Target.SetHeadtracking(False) |
|
|
|
|
|
|
|
Target.SetDontMove(True) |
|
|
|
|
|
|
|
Debug.SendAnimationEvent(Target, "pipesmokingcrossleggedstartblaze") |
|
|
|
|
|
|
|
Debug.SendAnimationEvent(Target, "pipesmokingcrossleggedblazed") |
|
|
|
|
|
|
|
RegisterForSingleUpdate(2.5) |
|
|
|
|
|
|
|
ElseIf AnimationStage == 2 |
|
|
|
|
|
|
|
Debug.SendAnimationEvent(Target, "pipesmokingcrosslegged") |
|
|
|
|
|
|
|
_00E_Smoking_PipeSmokingSmokeExhaleEffect.Play(Target, -1 as Float, none) |
|
|
|
|
|
|
|
EndIf |
|
|
|
EndIf |
|
|
|
EndIf |
|
|
|
EndIf |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_UnlockAnimationUpdates() |
|
|
|
_UnlockAnimationUpdates() |
|
|
|
EndEvent |
|
|
|
EndEvent |
|
|
|
|
|
|
|
|
|
|
|
Event OnPackageChange(Package akOldPackage) |
|
|
|
Event OnSleepStart(float afSleepStartTime, float afDesiredSleepEndTime) |
|
|
|
; Debug.Trace(self + ": OnPackageChange, " + Target + ", old package " + akOldPackage) |
|
|
|
; Debug.Trace(self + ": OnSleepStart, " + Target) |
|
|
|
|
|
|
|
|
|
|
|
; Failsafe auto-stop smoking on package change |
|
|
|
; Force reset of the animations to make the NPC re-enter the furniture (if it wishes). |
|
|
|
Target.RemoveSpell(_00E_Smoking_CrossLeggedMarkerSP) |
|
|
|
; Fixes NPCs creeping away from the furniture while the player is sleeping in the same location. |
|
|
|
EndEvent |
|
|
|
_LockAnimationUpdates() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If bIsFinished == False |
|
|
|
|
|
|
|
UnregisterForUpdate() |
|
|
|
|
|
|
|
StopAnimations(True) |
|
|
|
|
|
|
|
Target.RemoveSpell(_00E_Smoking_CrossLeggedMarkerSP) |
|
|
|
|
|
|
|
EndIf |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_UnlockAnimationUpdates() |
|
|
|
|
|
|
|
EndEvent |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Event OnCellDetach() |
|
|
|
|
|
|
|
GotoState("") |
|
|
|
|
|
|
|
endEvent |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
event OnEndState() |
|
|
|
|
|
|
|
; Debug.Trace(self + ": Unregistering for updates, " + Target) |
|
|
|
|
|
|
|
UnregisterForUpdate() |
|
|
|
|
|
|
|
UnregisterForSleep() |
|
|
|
|
|
|
|
endevent |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
endstate |
|
|
|
|
|
|
|
|
|
|
|
Event OnCellAttach() |
|
|
|
Event OnCellAttach() |
|
|
|
If ! bIsFinished |
|
|
|
If ! bIsFinished |
|
|
|
RegisterForSingleUpdate(1.0) |
|
|
|
GotoState("Smoking") |
|
|
|
RegisterForSleep() |
|
|
|
|
|
|
|
endif |
|
|
|
endif |
|
|
|
endEvent |
|
|
|
endEvent |
|
|
|
|
|
|
|
|
|
|
|
Event OnCellDetach() |
|
|
|
Event OnPackageChange(Package akOldPackage) |
|
|
|
UnregisterForUpdate() |
|
|
|
; Debug.Trace(self + ": OnPackageChange, " + Target + ", old package " + akOldPackage) |
|
|
|
UnregisterForSleep() |
|
|
|
|
|
|
|
endEvent |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Event OnSleepStart(float afSleepStartTime, float afDesiredSleepEndTime) |
|
|
|
|
|
|
|
; Debug.Trace(self + ": OnSleepStart, " + Target) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; Force reset of the animations to make the NPC re-enter the furniture (if it wishes). |
|
|
|
|
|
|
|
; Fixes NPCs creeping away from the furniture while the player is sleeping in the same location. |
|
|
|
|
|
|
|
_LockAnimationUpdates() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If bIsFinished == False |
|
|
|
|
|
|
|
UnregisterForUpdate() |
|
|
|
|
|
|
|
StopAnimations(True) |
|
|
|
|
|
|
|
Target.RemoveSpell(_00E_Smoking_CrossLeggedMarkerSP) |
|
|
|
|
|
|
|
EndIf |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_UnlockAnimationUpdates() |
|
|
|
; Failsafe auto-stop smoking on package change |
|
|
|
|
|
|
|
Target.RemoveSpell(_00E_Smoking_CrossLeggedMarkerSP) |
|
|
|
EndEvent |
|
|
|
EndEvent |
|
|
|
|
|
|
|
|
|
|
|
Event OnEffectFinish(Actor akTarget, Actor akCaster) |
|
|
|
Event OnEffectFinish(Actor akTarget, Actor akCaster) |
|
|
|