Hiya all,
I'm trying to make a wait command for mprogs. Below is the
mpwait command I've added to mobcmd.c, and below that a couple of testers
to see if it works. In the first case the mob just does nothing if the
door is opened from either side. The phrases for the act_progs are correct.
In the second one the following happens:
He says Hello.
He says About to wait.
<no pause>
He says Waited 5 seconds.
Any ideas?
Thanks in advance.
Homer
aka Fionn Colvin :)
ACMD(do_mpwait)
{
int mob_wait = 0;
if (!IS_NPC(ch) || IS_AFFECTED(ch, AFF_CHARM) || ch->desc) {
send_to_char("Huh?\n\r", ch);
return;
}
argument = one_argument(argument, arg);
if (arg[0] == '\0' || !is_number(arg))
mob_wait = 1;
else
mob_wait = atoi(arg);
GET_MOB_WAIT(ch) = (PULSE_VIOLENCE / 2) * mob_wait;
return;
}
##############
# First Test #
##############
>act_prog p opens the iron.~
mpwait 2
close door
~
>act_prog p from the other side~
mpwait 2
close door
~
|
###############
# Second Test #
###############
>speech_prog p wait~
say Hello.
say About to wait.
mpwait 5
say Waited 5 seconds.
~
|
+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://cspo.queensu.ca/~fletcher/Circle/list_faq.html |
+-----------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/18/00 PST