Scriptname PublicanGreyMareEmfrid
;CellName: ChorrolTheGreyMare
;Publican: Emfrid
;Room: First room upstairs on the left
;Door Ref: GreyMareRentDoor
short rent
short cleanup
short setup
short hourspassed
short ms45saidonce ;necessary for quest MS45
float renthour
float hourcheck
begin gamemode
if ( rent == 1 )
if ( setup == 0 )
set renthour to GameHour
set setup to 1
set hourspassed to 0
set hourcheck to GameHour
GreyMareRentDoor.unlock
GreyMareRentBed.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 ChorrolTheGreyMare == 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
set GreyMareTriggerRef.doonce to 0
GreyMareRentDoor.SetOpenState 0
GreyMareRentDoor.lock 30
GreyMareRentBed.SetOwnership Emfrid
endif
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
|