[DG Scripts] do_wheal

From: Tony Robbins (tonyr@NWPACLINK.COM)
Date: 01/09/98


Here's a cut and paste snippet for DG Scripts (released by Mark Heilpern).
What
this does is allow the room (should easily copy as a mobcmd if necessary) heal
a person as in 'wheal <person> <amount>'
(I thought this might be useful for a "Holy Room" where a player could
"pray" (command
trigger) for hitpoints.)

Here it is:

In dg_wldcmd.c:

(In the WCMDs)
WCMD(do_wheal)
{
    char_data *ch;
    char name[MAX_INPUT_LENGTH], amount[MAX_INPUT_LENGTH];
    int dam = 0;

    two_arguments(argument, name, amount);

    if (!*name || !*amount) {
        wld_log(room, "wheal: too few arguments");
        return;
    }

    dam = atoi(amount);

    if ((ch = get_char_by_room(room, name))) {
        if ((GET_MAX_HIT(ch) - GET_HIT(ch) < dam))
          dam = (GET_MAX_HIT(ch) - GET_HIT(ch));
        if (GET_MAX_HIT(ch) != GET_HIT(ch)) {
        (GET_HIT(ch) += dam);
        }
    } else {
        wld_log(room, "wheal: target not found");

    dam = atoi(amount);

    if ((ch = get_char_by_room(room, name))) {
        if ((GET_MAX_HIT(ch) - GET_HIT(ch) < dam))
          dam = (GET_MAX_HIT(ch) - GET_HIT(ch));
        if (GET_MAX_HIT(ch) != GET_HIT(ch)) {
        (GET_HIT(ch) += dam);
        }
    } else {
        wld_log(room, "wheal: target not found");
        return;
    }
}

In the world command table:

    { "wheal"      , do_wheal     , 0 },


Hope you like it.

-B.


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