If you're talking about Darkrai Lv. X, it would never do 40 with Endless Darkness. Seeing as it takes 3 dark energies, Multi-wouldn't work, and DRE's or Scrambles wouldn't work, the LEAST Endless Darkness would do is 70. Just had to point that out.
After you use Endless Darkness, your turn is over. Your opponent then flips 2 coins or rolls 2 dice (whichever one you're playing with). If 1 of them is heads (or evens if you're using Dice), and the other is tails (odds) their Pokemon remains asleep for their turn, unless they can use a switch, warp point, poke-power, etc. They can't manually retreat however. Let's just say they don't use a switch, warp, etc. and they end their turn. They flip 2 coins/dice again. If only one of them is heads, they remain asleep. If both of them are heads, they're awake. If both of them are tails, their pokemon is awake.
Hope I helped.
-G2F