[mr3278] Improve Random movement generator
Author Cyberium. (Code with some changes)