Good ending :
>Complete the dungeon until the end. Get the Prince sex scene.
Bad ending :
> Put the code in the chest.
> Get the immediate loose against the slime => CG Scene 1
> Keep going until you meet the minotaur => Cg Scene 2
> Go to the dungeon master route => CG scene 3 Bad ending.