I recently ran into this too. If you are doing the npcrace, npcgender inside EVENT_SPAWN there's a queue delay in the actual popping of the npc into the zone and the execution of EVENT_SPAWN.
The source does send the spawn packets to the queue first and then run the EVENT_SPAWN but the queue must be running behind the execution of EVENT_SPAWN. This is a little ugly, but see if it works for you this way:
Code:
sub EVENT_SPAWN {
quest::settimer(1,0);
}
sub EVENT_TIMER {
if($timer == 1) {
quest::npcgender(1);
quest::npcrace(126);
quest::stoptimer(1);
}
}