I am not experiencing this problem.
You're saying that if you hail one of your quest NPC's with #gm on, nothing happens, but if you do nothing else but enter "#gm off" and then hail them again, it works? And if you do "#gm on" again, you get nothing again?
If this is the case, would you mind posting the Perl code for a quest that's doing this for you?
|