Re: NEWBIE: Mayor special

From: George (
Date: 06/07/96

On Fri, 7 Jun 1996, Eduardo Gutierrez de Oliveira wrote:

> Ok, this (I think) is not mentioned in the docs anywhere.
> The mayor has a special procedure assigned to it, that makes it wander on 
> the town and say dumb things...
> The thing is that he never wakes up, he is always asleep in his chair, 
> but if I wake him up he'll make his round as normal and fo back to his 
> chair and sleep again... and never wake up again unless I force him to do.

He must be tired :)

> Besides the obviuous opinions about the efficiency of our mayor... How 
> can I make him to do his thing by himself. I tried changing some 
> boooleans in his spec_proc, but the mud would core dump as soon as he 
> made his first move...

But seriously, you have to change this line in the mobact.c file:

void mobile_activity(void)

  for (ch = character_list; ch; ch = next_ch) {
    next_ch = ch->next;

    if (!IS_MOB(ch) || FIGHTING(ch) || !AWAKE(ch))
      continue;                        ^^^^^^^^^^---Spec_proc not called
                                                    if he's asleep so he
                                                    never wakes up.

> Also, how is the movement of the mayor defined? I saw a sequence of 
> characters but my head started aching, maybe it is ways too simple but I 
> need someone to explain it to me.

  static char open_path[] =

  static char close_path[] =


  switch (path[index]) {
  case '0':\
  case '1': \ If the current character is a 0-3, go either north, east, west,
  case '2': / or south, determined by the order in the array of dirs
  case '3':/
    perform_move(ch, path[index] - '0', 1);

  case 'W':  <---- If it's "W", wake up and groan.
    act("$n awakens and groans loudly.", FALSE, ch, 0, 0, TO_ROOM);

  case 'S':  <---- If it's "S" now, go sleepy
    act("$n lies down and instantly falls asleep.", FALSE, ch, 0, 0, TO_ROOM);

  case 'a':  <---- if "a" is the character, say hi honey.
    act("$n says 'Hello Honey!'", FALSE, ch, 0, 0, TO_ROOM);
    act("$n smirks.", FALSE, ch, 0, 0, TO_ROOM);

  case 'b':  <---- if "b", then say what a view
    act("$n says 'What a view!  I must get something done about that dump!'",
	FALSE, ch, 0, 0, TO_ROOM);

  [blah blah blah]

  case 'O': <-- open doors
    do_gen_door(ch, "gate", 0, SCMD_UNLOCK);
    do_gen_door(ch, "gate", 0, SCMD_OPEN);

  case 'C': <-- close gates
    do_gen_door(ch, "gate", 0, SCMD_CLOSE);
    do_gen_door(ch, "gate", 0, SCMD_LOCK);

If you want to add your own, just add a CASE and put the letter in the
path strings

> BTW, flame me if you will, but I warned about it being a NEWBIE thing..:) 
> if you do, please do it to my account, if you answer me do it to the 
> list..:) there may be other newbies wondering the same thing and you are 
> saving yourself repeated postings..:)
> Greets
> Mythago
> ---------------------------------------------------------------------------
> Eduardo Gutierrez de Oliveira        
> Administrador de Internet                            Internet Administrator
> Proveedor de Servicio Internet                    Internet Service Provider
>                                 CIATEQ, A.C.
>  Centro de Investigacion y Asistencia Tecnica del Estado de Queretaro, A.C.
> ---------------------------------------------------------------------------

This archive was generated by hypermail 2b30 : 12/18/00 PST