[CODE] New Prayer Command

From: Phillip A. Ames (kirk47@JUNO.COM)
Date: 10/08/98


Here's a little snippet I wrote a couple of minutes ago, it's a
replacement for the 'pray' social, it will take 2 random numbers, compare
them, and if one is greater than the other, it they will get sanct for a
duration of 8....  If it's not, then the gods get pissed and curse them
;)  You can change it to be based on charisma, I think thats what I may
want to do...  It's also currently a cleric command, you may want to
change that...  You'll need to make a modification to utils.h(Optional)
about removing the define of MAX_SPELL_AFFECTS from void mag_affects... I
stuck it in utils.h because I didn't feel like having to go change every
occurence of it when I wanted to...  And you'll also need to add this
line to the top of the file you put it in(unless you put it in magic.c):

extern struct affected_type af[MAX_SPELL_AFFECTS];

Otherwise you'll get loads of errors about left of .bitvector stuff,
etc...  And of course you'll need to prototype it in files where you need
to use it, and change the stock pray command in interpreter.c to become
do_pray rather than do_action.

ACMD(do_pray)
{
int num, num2;

if(GET_CLASS(ch) != CLASS_CLERIC){
        send_to_char("You pray for help, but the Gods refuse to
answer!\r\n", ch);
        act("$n attempts to call for the support of the Gods, but they
refuse to answer!", TRUE, ch, 0, 0, TO_ROOM);
        return;
}
if(AFF_FLAGGED(ch, AFF_SANCTUARY)){
        send_to_char("You are already protected by the Gods!\r\n", ch);
        act("$n attempts to call for the support of the Gods, but is
already protected by them!", TRUE, ch, 0, 0, TO_ROOM);
        return;
}
if(AFF_FLAGGED(ch, AFF_CURSE)){
        send_to_char("The Gods have heard enough of your cries for help.
SILENCE!!\r\n", ch);
        act("$n's prayers are ignored.", TRUE, ch, 0, 0, TO_ROOM);
}

num = number(0, 100);
num2 = number(0, 100);

if(num > num2){
        af[0].duration = 8;
        af[0].bitvector = AFF_SANCTUARY;
        send_to_char("The Gods protect you!\r\n", ch);
        act("$n's prayers to the Gods are answered!", TRUE, ch, 0, 0,
TO_ROOM);
        send_to_char("You are surrounded by a white aura!\r\n", ch);
        act("$n is surrounded by a white aura", TRUE, ch, 0, 0, TO_ROOM);
        return;
}
if(num2 >= num){
        send_to_char("The Gods have heard enough of your cries for
help!\r\n", ch);
    act("$n's repeated cries for help to the Gods have been ignored!",
TRUE, ch, 0, 0, TO_ROOM);
        act("$n is surrounded by a dark, evil, aura.", TRUE, ch, 0, 0,
TO_ROOM);
        af[1].duration = 8;
        af[1].bitvector = AFF_CURSE;
        return;
        }
}


Enjoy!!!

-Phillip

Phillip Ames    | Satisfaction is not guaranteed.
kirk47@juno.com | -Ferengi Rule of Acquisition #19
ICQ: 8778335    | AOL IM: Grathol
http://members.xoom.com/Gowron/index.html(Unfinished)

___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
or call Juno at (800) 654-JUNO [654-5866]


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