Re: Calling set_fighting() inside a manual spell

From: Chuck Carson (ccarson@phi.org)
Date: 09/23/99


Cool, thanks.

I never though about calling hit()...

I have actually gotten this manual spell to work as I want it too but your
suggestion seems a bit cleaner.

Thanks,
CC

-----Original Message-----
From: Fizal [mailto:amustapa@yahoo.com]
Sent: Thursday, September 23, 1999 3:07 AM
To: CIRCLE@post.queensu.ca
Subject: Re: Calling set_fighting() inside a manual spell


--- Chuck Carson <ccarson@PHI.ORG> wrote:
> I have a manual spell, memory wrack, that reduces the victims mana.
> Regardless of whether the spell fails or not, I want this to start a
> fight using set_fighting().

Currently, if a spell is set as violent, the mob will only attack if
the caster fails the chance throw (see do_cast()). You can do add a
check in the manual spell, go ahead, but taking a look at the attacking
part in do_cast(), I think the following is simpler:

if (victim && IS_NPC(victim))
  hit(victim, ch, TYPE_UNDEFINED);

Why? Simple... hit() will call damage() that will not only call
set_fighting() for you with all the necessary checks, but it will also
check whether or not you can fight that person. Case and point: casting
the spell on a shopkeeper. In fact, if you take a look at do_backstab()
and do_kick(), they also use hit() instead of directly calling
set_fighting().

- Fizal




Afizal Mustapa
Petaling Jaya, Malaysia
(amustapa@hotmail.com)

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

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



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