Scriptname MS13Script
short FarwilSlain
short BremmanSlain
short Found
short GuardSet
short FollowPlayer
short BremmanGone
short FarwilGone
short GateDone
short ToldAboutFarwil
short Arrived
short NearGate
short AmminusDies
short CountSaid
short Home
short BremmanSleep
short StoneGo
short GaveMedallion
float fQuestDelayTime
begin gamemode
;sets up guards if gates are enabled
if ( GetStage MQ11 >= 0 ) && ( GuardSet == 0 )
AmminusGregoriRef.Enable
AmminusGregoriRef.MoveTo MS13GuardPatrolMarker
AmminusGregoriRef.Evp
MS13CGuardRef.Enable
JharedStrongbladeRef.Disable
set GuardSet to 1
endif
;Trigger stage 13 when nearing the gate
if ( GetStage MQ11 >= 0 )
if ( Player.GetDistance MS13GuardPatrolMarker <= 1400 ) && ( NearGate == 0 )
setstage MS13 13
set NearGate to 1
endif
endif
;sets stage when entering Oblivion
if ( GetStage MQ11 >= 0 ) && ( ToldAboutFarwil == 1 ) && ( Player.GetDistance MS13ArrivalMarker <= 500 ) && ( Arrived == 0 )
setstage MS13 45
set Arrived to 1
elseif ( GetStage MQ11 >= 0 ) && ( Player.GetDistance MS13ArrivalMarker <= 500 ) && ( Arrived == 0 )
setstage MS13 15
set Arrived to 1
endif
endif
;sets stage when finding Farwil and Bremman
if ( GetStage MS13 >= 15 )
if ( Player.GetDistance FarwilRef <= 800 ) && ( Found == 0 )
setstage MS13 50
set Found to 1
endif
endif
;disables bodies in case of death if Oblivion Gate closed
if ( GetStage MS13 >= 80 )
if ( FarwilSlain == 1 ) && ( GateDone == 1 ) && ( FarwilGone == 0 )
FarwilRef.Disable
set FarwilGone to 1
endif
endif
if ( GetStage MS13 >= 80 )
if ( BremmanSlain == 1 ) && ( GateDone == 1 ) && ( BremmanGone == 0 )
BremmanRef.Disable
set BremmanGone to 1
set fQuestDelayTime to 0
endif
endif
if ( StoneGo == 1 ) && ( Player.GetDistance MS13GuardPatrolMarker < 4000 ) && ( Home == 0 )
setstage MS13 80
set Home to 1
endif
end |