Logins and gain levels gecho`ed

From: Pete Johnson (ukrawbones@AOL.COM)
Date: 05/04/02


I wanted to make an adition to the circlemud30 bpl 20 code to give an
automated GECHO, to show all players in the game, people logging in,
logging out and also to show when a player achieves the next level via the
GECHO system.

Ive sorted the logout routine by adapting the ACMD (do_quit) routine in
act.other.c by adding some code from the gecho routine. Has anyone got any
ideas how i can impliment logon and level gain gecho`s

heres my modification to

act.other.c

ACMD(do_quit)
{
  struct descriptor_data *pt;

  if (IS_NPC(ch) || !ch->desc)
    return;

    /*check to see if word entered fully*/

  if (subcmd != SCMD_QUIT && GET_LEVEL(ch) < LVL_IMMORT)
    send_to_char("You have to type quit--no less, to quit!\r\n", ch);

    /*check to see if fighting*/

  else if (GET_POS(ch) == POS_FIGHTING)
    send_to_char("No way!  You're fighting for your life!\r\n", ch);

    /*check if player stunned to stop cheating*/

  else if (GET_POS(ch) < POS_STUNNED) {
    send_to_char("You die before your time...\r\n", ch);
    die(ch);
  } else {
   /* gecho player leaving the lands */

    sprintf(buf, "Events :&b&W&1%s has left the lands.&0\r\n", GET_NAME
(ch));
    for (pt = descriptor_list; pt; pt = pt->next)
      if (STATE(pt) == CON_PLAYING && pt->character && pt->character != ch)
 send_to_char(buf, pt->character);
    if (PRF_FLAGGED(ch, PRF_NOREPEAT))
      send_to_char(OK, ch);
    else
      send_to_char(buf, ch);
    sprintf(buf, "%s has quit the game.", GET_NAME(ch));
    mudlog(buf, NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE);
    send_to_char("Goodbye, friend.. Come back soon!\r\n", ch);

    if (free_rent)
      Crash_rentsave(ch, 0);

    /* If someone is quitting in their house, let them load back here. */

    if (!PLR_FLAGGED(ch, PLR_LOADROOM) && ROOM_FLAGGED(IN_ROOM(ch),
ROOM_HOUSE))
      GET_LOADROOM(ch) = IN_ROOM(ch);

    extract_char(ch);  /* Char is saved before extracting. */

  }
}



ACMD(do_save)
{
  if (IS_NPC(ch) || !ch->desc)
    return;

  /* Only tell the char we're saving if they actually typed "save" */
  if (cmd) {
    /*
     * This prevents item duplication by two PC's using coordinated saves
     * (or one PC with a house) and system crashes. Note that houses are
     * still automatically saved without this enabled. This code assumes
     * that guest immortals aren't trustworthy. If you've disabled guest
     * immortal advances from mortality, you may want < instead of <=.
     */
    if (auto_save && GET_LEVEL(ch) <= LVL_IMMORT) {
      send_to_char("Saving aliases.\r\n", ch);
      write_aliases(ch);
      return;
    }
    sprintf(buf, "Saving %s and aliases.\r\n", GET_NAME(ch));
    send_to_char(buf, ch);
  }

  write_aliases(ch);
  save_char(ch);
  Crash_crashsave(ch);
  if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_HOUSE_CRASH))
    House_crashsave(GET_ROOM_VNUM(IN_ROOM(ch)));
}


/* generic function for commands which are normally overridden by
   special procedures - i.e., shop commands, mail commands, etc. */
ACMD(do_not_here)
{
  send_to_char("Sorry, but you cannot do that here!\r\n", ch);
}

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT