It's purely random, I'd recommend saving right when you get the encounter if you want to try out multiple outcomes. Right now its a 17% of happening every night, but I'll add a starting class that will boost the chances of night events... once there are more night events :P