Hi, I tried to recreate the Bad Dreams ability in Emerald (the version doesn't really matter). I have a freeze when a pokémon is effectively asleep and there's a Bad Dream in battle.
I explained why I did this or that instruction, what I'm trying to do, being to most accurate possible, if anyone would like to take a look into that.
The place where I hooked is where the check for poisonning damages is done (which seemed to be appropriate to me, the effect being the same = -1/8 life).
I don't post directly here because the routine is pretty long, so it would be easier here :
http://hastebin.com/xexiwavuwi.hs If anything seems wrong, if you have any clue, don't hesitate please :)
EDIT : Nevermind, there was stupid error and I found another way to do that anyway.