Code: Select all
short LastPos ;LastPos = 0 is normal, LastPos = 1 is vertical, LastPos = 2 is horizontal.
....
if ( OnPCDrop != 1 )
if ( TMax < 5 )
Set TMax to Random 50
Set TMax to ( TMax / 10 ) + 5
endif
if ( CellChanged == 1 )
Set Timer to TMax + 1
endif
if ( bZpos != ( GetPos, Z ) )
Set Timer to TMax + 1
endif
if ( LastPos > 0 )
set Timer to Timer + GetSecondsPassed
if ( Timer > 5 )
if ( LastPos >= 1 )
SetPos X, xDest
SetPos Y, yDest
SetPos Z, zDest
SetAngle Z, zAngle
SetAngle X, xAngle
SetAngle Y, yAngle
endif
set bZpos to ( GetPos, Z )
set Timer to 0
endif
endif
;BEGIN original Book Script:
;END original Book script.
return
endif
What's the point, does the book fall down if it's not reset often? Clearly not because setting a book on top of a object and then removing that object doesn't cause a fall, so why the performance loss of keeping this running whenever the book is not being player dropped?
Also btw, this part of the code should really run only on 'not in inventory'.