Calling set_fighting() inside a manual spell

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


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(). Here are the three scenarios I want this spell to be
cast in:

1 player and 1 mob not currently fighting, thus a fight will ensue.
1 player and 1 mob already engaged in a fight.
1 player and 1 mob already engaged in a fight, player casts the spell
   on mob 2. (who may or may not be fighting the player, ie helper mob)

Can I do a check like this inside a manual spell:

if (!FIGHTING(ch))
   set_fighting(ch, victim);
else if (!(FIGHTING(ch) == victim))
         set_fighting(ch, victim)

Will this change who the player is fighting or will it add them to the list
of mobs the player is fighting? How will I go about doing this or should I
avoid this type of thing in manual spells all together? I am currently
getting "Assert failed in fight.c" because set_fighting() is being called
when the player is already fighting. This happens because the player is
casting the spell after combat has began or on another mob in the room.

Thanks,
Chuck


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