[CODE] Multi-cast?:>

From: Maximum Carnage (carnage@games2.mudsrus.com)
Date: 01/22/99

        Ok awhile back I wrote on here asking if anyone had ever
implemented a multi-casting system so that a mage could cast more than one
fireball or any other damge spell in one round.  I got a reply back saying
to look at the multi-hit code, so thats what I did.  Suggestions very
welcome and so is criticism:>  Laterz

-Smillie, IMP
MAximum Carnage
Carnage.mudsrus.com 6669

Ok In Magic.c I did all this stuff:

In int mag_damge function at the top where int dam is:

int apr = -1;

Than in the appropriate spell case, which for my test I used fireball,
before it does anything else add this:
    if (GET_LEVEL(ch) >= 30) {

Than at the bottom change the place where it says return damage( to just
damage( and snip this in from the original multi-hit:
  /* For multiple damge casts in a round */
  apr = MAX(-1, MIN(apr, 4));

  if(GET_POS(victim) > POS_DEAD) {
     if (apr >= 0) {
       for (; apr >= 0; apr--)
  damage(ch, victim, dam, spellnum);
  return 0;

Note this last part gets clipped in all the way at the end.  I moved the
return than from the original damage part and put it here in the bottom so
if for some reason nothing happens it just drops the whole idea.  Also the
place where it says about getting level to see if they are able to
multi-cast I am gonna use that for my tier classings but I figured I'd
write it on here like this for general purposes.  Lastly that part about
getting position before even finding out the APR count is because when I
first did this a scond cast could crash the mud if the target died on the
first cast, this way thsecond cast only happens if the target is ALIVE!:>

     | 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