Re: NEWBIE: Mayor special

From: George (gagreer@dragon.ham.muohio.edu)
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)
{
  [blah]

  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.
  [blah]

> 
> 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.
> 


SPECIAL(mayor)
{
  static char open_path[] =
  "W3a3003b33000c111d0d111Oe333333Oe22c222112212111a1S.";

  static char close_path[] =
  "W3a3003b33000c111d0d111CE333333CE22c222112212111a1S.";

  [snip]

  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);
    break;

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

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

  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);
    break;

  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);
    break;

  [blah blah blah]

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

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

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                  eduo@sparc.ciateq.conacyt.mx
> 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.
>                      http://sparc.ciateq.conacyt.mx/
> ---------------------------------------------------------------------------
> 



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