[CODE] A First Aid Snippit

From: Thomas Smith (ibedemigod@HOTMAIL.COM)
Date: 04/07/98


Hello,

I retract my first statement of this taking a few days, in all actuallty
it took a few hours. I would like to thank everyone that replied to my
help on the stupid errors that i made.  Without your help id probably
still be pulling my hair out over those problems.  With out futher
pause, here is my do_aid snippit. I removed the only warriors flag and
made it for all classes. Oh ya hehe dont forget to add the skill to
spells.h, spell_parser.c, interpreter.c, and give it to what ever
classes you choose in class.c.  Improvements on this code always
welcome. (=

--snip--
ACMD(do_aid)
{
  struct char_data *vict;
  int percent, prob, dam;

  one_argument(argument, arg);

    if (!(vict = get_char_room_vis(ch, arg))) {
      send_to_char("Administer first aid to whom?\r\n", ch);
      return;
    }

  if (IS_NPC(vict)) {
    send_to_char("You can't be serious!\r\n", ch);
    return;
  }

  if (GET_HIT(vict) > 0) {
    send_to_char("This person does not need first aid.\r\n", ch);
    return;
  }


  if (vict == ch) {
    send_to_char("You can't adminster first aid to yourself!!\r\n", ch);
    return;
  }

  percent = number(1, 101);     /* 101% is a complete failure */
  prob = GET_SKILL(ch, SKILL_AID);

  if (percent > prob) {
    send_to_char("Utoh, THAT wasnt right!\r\n", ch);
    act("$n botched his first aid to $N.", FALSE, ch, 0, vict, TO_ROOM);
      dam = dice(1,4);
      GET_HIT(vict) -= dam; /* added in some damage if you mess up
remove if you want to */
  }
  else {
    GET_HIT(vict) = 1;
    GET_POS(vict) = POS_SITTING; /* change positon from stunned to
sitting */
    act("You successfuly administer first aid to $N!", FALSE, ch, 0,
vict, TO_CHAR);
    send_to_char("You have been saved!!!\r\n", vict);
    act("$n administers first aid to $N.", FALSE, ch, 0, vict,
TO_NOTVICT);
  }
}

Thats it, enjoy (=

-=DemiGod=-
"When life and death are one, then immortality we shall reach"

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


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