This is a section of a special I'm writing for a mob, and at this point only
works because of "ch == vch", which I have tested by trying "ch != vch".
The problem is that the act line fires and then nothing happens... obiously
the vch is an invalid target. and if ch == vch, then it's trying to kill
itself. Not the best way to go about it.
How can I prevent vch from being assigned to the mob?
/* see if PC in room, then give 1 in 2.5 chance of waking */
for (vch = ch->in_room->people; vch != NULL; vch = vch->next_in_room)
{
if (!IS_NPC(vch) || ch == vch)
{
switch (number_range(1,5))
{
default: message = NULL; break;
case 1: case 3:
message = "$n roars in pain as it is accidently stepped upon
and ATTACKS!.";
break;
}
}
else
{
return FALSE;
}
}
if (message != NULL)
act(message,ch,NULL,vch,TO_ALL);
multi_hit( ch, vch, TYPE_UNDEFINED );
return TRUE;
if (message == NULL)
return FALSE;
}
~Tandon