[CODE] do_gut ::maniacal laughter::

From: blah (merren@MINDCRYME.COM)
Date: 04/26/98


Well, I figured I'd share my "gut" skill. Yes, it could be written better,
but hey, it's free :)

I assume if you use this you'll know how to add another skill to your mud.
I'll just post my do_gut function and if anyone REALLY has any questions,
just email merren@mindcryme.com personally.

Basically it takes the killers level times 2 and if that's more then
the victims hitpoints, you do that much damage plus end up with a nice
steaming pile of guts ::chuckle:: Ok, so I'm sick :/ (once again see the
admission above that this could be written better).

--

ACMD(do_gut)
{
  struct char_data *vict;
  int percent, prob;
  struct obj_data *guts;
  char name[256];

  if (ROOM_FLAGGED(ch->in_room, ROOM_PEACEFUL)) {
    send_to_char("This room has a peaceful feeling.\r\n", ch);
    return;
    }

  one_argument(argument, arg);

  if (GET_SKILL(ch, SKILL_GUT) == 0) {
    send_to_char("Huh?!\r\n", ch);
    return;
  }
  if (!(vict = get_char_room_vis(ch, arg))) {
    if (FIGHTING(ch)) {
      vict = FIGHTING(ch);
    } else {
      send_to_char("Gut who?\r\n", ch);
      return;
    }
  }
  if (vict == ch) {
    send_to_char("Erm, that'd hurt!\r\n", ch);
    return;
  }
  if (!GET_EQ(ch, WEAR_WIELD)) {
    send_to_char("You need to wield a weapon to make it a success.\r\n",ch);
    return;
  }
  percent = number(1, 101);     /* 101% is a complete failure */
  prob = GET_SKILL(ch, SKILL_GUT);

/*
 * Just in case you want mobs that aren't guttable :)
  if (MOB_FLAGGED(vict, MOB_NOGUT))
    percent = 101;
*/

  if ((GET_LEVEL(ch) * 2) < GET_HIT(vict)) {
    send_to_char("You fail to gut them!\r\n", ch);
    damage(ch, vict, 0, TYPE_UNDEFINED);
  } else {
        guts = create_obj();
        guts->item_number = NOTHING;
        guts->in_room = NOWHERE;
        guts->name = str_dup("guts");
        strcpy(name, "the steaming guts ");
      if (IS_NPC(vict))
        sprintf(name, "%sof %s", name, vict->player.short_descr);
      else
        sprintf(name, "%sof %s", name, vict->player.name);
        guts->description = str_dup(name);
        strcpy(name, "the steaming guts ");
      if (IS_NPC(vict))
        sprintf(name, "%sof %s", name, vict->player.short_descr);
      else
        sprintf(name, "%sof %s", name, vict->player.name);
        guts->short_description = str_dup(name);
        GET_OBJ_TYPE(guts) = ITEM_FOOD;
        GET_OBJ_WEAR(guts) = ITEM_WEAR_TAKE;
        GET_OBJ_EXTRA(guts) = 0;
        GET_OBJ_VAL(guts, 0) = 8;
        GET_OBJ_VAL(guts, 3) = 1;
        GET_OBJ_WEIGHT(guts) = 1;
        GET_OBJ_TIMER(guts) = 0;
        GET_OBJ_TIMER(guts) -= 5;
        obj_to_room(guts, ch->in_room);
        act("$n suddenly lunges forward and guts $N!", FALSE, ch, 0, vict,TO_ROOM);
        act("You suddenly lunge forward and gut $N!", FALSE, ch, 0, vict,TO_CHAR);
        damage(ch, vict, GET_LEVEL(ch) * 2, TYPE_UNDEFINED);
        WAIT_STATE(vict, PULSE_VIOLENCE);
  }
  WAIT_STATE(ch, PULSE_VIOLENCE * 2);
}





Melen
Allanthya..org 4000


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