Re: Calling set_fighting() inside a manual spell

From: Fizal (
Date: 09/23/99

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

- Fizal

Afizal Mustapa
Petaling Jaya, Malaysia

Do You Yahoo!?
Bid and sell for free at

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

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