Re: [Newbie] Racial Death

From: ;P (siv@CYBERENET.NET)
Date: 06/06/98


>         Gosh, I know I am gonna get it for this one, where as this is really
> newbie. I have been going through the code, looking, trying things,
> failing, and starting the process over again. Maybe I am just missing this
> because it is 4 in the morning and I am still really sick. Okay, enough
> rambling. I was looking for a way to make a race be deleted when they die.
> I don't want them to see the menu, I want it to give them a nice little
> message like "You have lost your soul to your god." delete their character,
> then close their connection. I also don't want them to ever have corpses.
> All their equipment and gold should be junked. Eek, I'm rambling again... I
> am going to sleep, thanks for any help I get.

i guess you really liked the idea of cyberenet MUD's Shadowen race/class
(please credit us)..

it was really quite easy..

siv

void raw_kill(struct char_data *ch, struct char_data *killer)
{
.
.
  if (GET_CLASS(ch) == CLASS_SHADOW) {
    SET_BIT(PLR_FLAGS(ch), PLR_DELETED);
    delete_obj_file(GET_NAME(ch));
    delete_alias_file(GET_NAME(ch));
    for (o = ch->carrying; o; o = next_obj) {
      next_obj = o->next_content;
      extract_obj(o);
    }
    for (i = 0; i < NUM_WEARS; i++)
      if (GET_EQ(ch, i))
        extract_obj(GET_EQ(ch, i));
  }
  save_char(ch, NOWHERE);
.
.
  if (GET_CLASS(ch) != CLASS_SHADOW)
    make_corpse(ch, killer);
.
.
}

then in handler.c
void extract_char(struct char_data *ch)
{
.
.
  if (!freed && ch->desc != NULL) {
    if (GET_CLASS(ch) == CLASS_SHADOW) {
      STATE(ch->desc) = CON_CLOSE;
      SEND_TO_Q("You are forever dead.\r\n", ch->desc);
    } else {
      STATE(ch->desc) = CON_MENU;
      SEND_TO_Q(MENU, ch->desc);
    }
  } else {              /* if a player gets purged from within the game */
    if (!freed)
      free_char(ch);
  }
}


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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