SCTX |
ScriptName ND03QuestScript
;handles all quest variables and scripting for ND03
Ref ActiveBearRef
short BearActive
short Clear
short TalkedtoAvita ;flag set in dialogue so she doesn't repeat herself
short DayFinished
short TestFailed ;set when player fails the test or walks away
short TestActive ;set when test becomes active, even after failing
short Stage20Reset ;set for journal update if player fails and restarts
short TestHour ;set to game hour when test starts; used for failure state in case of waiting
Begin GameMode
;Update quest stage the first time the player arrives at the grove (so he knows he's in the right place and he needs to stay put)
if ( GetStage ND03 == 20 )
if ( Player.GetDistance ND03GroveMarker < 400 )
SetStage ND03 21
return
endif
endif
;When player arrives at grove, enable bear
;Treat each occurence as if the player has already been there, to account for both scenarios
if ( GetStage ND03 >= 21 )
if ( TestActive == 1 )
if ( BearActive == 1 )
if ( Player.GetDistance ND03GroveMarker < 900 )
;Resurrect Bear to reset his health
ND03BearRef.Resurrect
;Move Bear to marker in case he was disabled elsewhere
ND03BearRef.moveto ND03BearMarker
;Enable and update
ND03BearRef.Enable
set TestHour to GameHour
set BearActive to 2
ND03BearMarker.PlaySound AMBBearDistant2D
endif
elseif ( BearActive == 2 )
endif
endif
endif
if ( TestHour < 23 )
if ( TestHour + 1 < GameHour )
if ( GetStage ND05 < 50 )
if ( BearActive >= 2 )
if ( ND03BearRef.IsInCombat == 0 )
ND03BearRef.StartCombat Player
endif
endif
endif
endif
else
if ( GameHour < 23 )
if ( GetStage ND05 < 50 )
if ( BearActive >= 2 )
if ( ND03BearRef.IsInCombat == 0 )
ND03BearRef.StartCombat Player
endif
endif
endif
endif
endif
;Check for player's location once stage hits 20
;If player has wandered away from test area, remove CreatureFaction from him
if ( TestActive == 1 )
if ( GetStage ND03 >= 20 )
if ( GetStage ND03 < 50 )
if ( Player.GetFactionRank CreatureFaction == 0 )
if ( Player.GetDistance ND03FactionCheckMarker > 10000 )
Player.SetFactionRank CreatureFaction -1
SetStage ND03 31
endif
endif
endif
endif
endif
End |