SCTX |
scn SESicklyBerniceSCRIPT
short rent
short cleanup
short setup
short hourspassed
short curereset ;resets the cure post quest SE41
short oncure ;checks if player is on post quest SE41
short curecount ;counts the number of days until the cure resets (in this case, 4)
short currentday ;stores the current day for use with the post quest SE41 reset
float renthour
float hourcheck
begin OnDeath
SETombstoneSicklyBerniceREF.enable
end
Begin OnActivate
if SEHerdirRef.TargetRef == SESicklyBerniceRef
if IsActionRef Player == 1
return
endif
else
Activate
endif
End
;BED RENTAL SCRIPTING
;CellName: SENSSicklyBernicesTaphouse
;Publican: SESicklyBernice
;Room: First room upstairs on the left
;Door Ref: SESicklyBerniceRentDoor
begin gamemode
if ( rent == 1 )
if ( setup == 0 )
set renthour to GameHour
set setup to 1
set hourspassed to 0
set hourcheck to GameHour
SESicklyBerniceRentDoor.unlock
SESicklyBerniceRentBed.setownership
else
if ( HoursPassed >= 24 )
set cleanup to 1
else
set hourcheck to GameHour
if ( renthour >= 23 )
if ( GameHour < 1 )
set HoursPassed to ( HoursPassed + 1 )
set renthour to GameHour
endif
else
if ( ( renthour + 1 ) < GameHour )
set HoursPassed to ( HoursPassed + 1 )
set renthour to GameHour
endif
endif
endif
endif
if ( Player.GetInCell SENSSicklyBernicesTaphouse == 0 )
if ( Cleanup == 1 )
set Cleanup to 2
endif
endif
if ( Cleanup == 2 )
set rent to 0
set renthour to 0
set hourspassed to 0
set setup to 0
set cleanup to 0
SESicklyBerniceRentDoor.SetOpenState 0
SESicklyBerniceRentDoor.lock 75
SESicklyBerniceRentBed.SetOwnership SESicklyBernice
endif
endif
;This is the reset for Sickly Bernice to need the cure after SE41 is completed ( around every 4 days )
if ( GetStage SE41 >= 100 )
if ( CureReset == 0 )
if ( currentday == 0 )
set currentday to GameDaysPassed
else
if currentday != GameDaysPassed
set curecount to ( curecount + 1 )
set currentday to GameDaysPassed
endif
endif
endif
endif
if ( CureCount == 4 )
Set CureReset to 1
endif
End
Begin MenuMode
if ( rent == 1 )
if ( setup == 1 )
if ( HoursPassed >= 24 )
set cleanup to 1
else
if ( renthour >= 23 )
if ( Gamehour < 1 )
set HoursPassed to ( HoursPassed + 1 )
set renthour to GameHour
endif
else
if ( ( renthour + 1 ) < GameHour )
set HoursPassed to ( HoursPassed + 1 )
set renthour to GameHour
endif
endif
endif
endif
endif
End
|