[CODE] Special Proc

From: Chuck Reed (creed@I-55.COM)
Date: 03/16/98


I have this proc to make a serpent randomly do things throughout a battle,
but the proc only goes off when the player hits enter.  Thus, the player
can stand still and the serpent will never do anything.  If anyone knows
how I can get it to go off randomly during fights, I'd much appreciate it.

Here's the code:

SPECIAL(serpent)
{
  struct char_data *vict;

  if(GET_POS(ch) != POS_FIGHTING)
    return FALSE;

  vict = FIGHTING(ch);

  if(!vict)
     return FALSE;

  switch(number(1,4)) {
     case 1:
       act("The serpent hisses and sprays venom about the room!",
             FALSE, vict, 0, 0, TO_ROOM);
       cast_spell(vict, ch, NULL, SPELL_ACID_BLAST);
       break;

     case 2:
       act("The serpent screams angrily and thrashes around violently!",
             FALSE, vict, 0, 0, TO_ROOM);
       break;

     case 3:
       act("The serpent spits a hissing bolt of acid!",
             FALSE, vict, 0, 0, TO_ROOM);
       cast_spell(vict, ch, NULL, SPELL_ACID_BOLT);
       break;

     case 4:
       act("The serpent eyes you and hisses madly!",
             FALSE, vict, 0, 0, TO_ROOM);
       break;

     default:
       act("The serpent looks quite stunned!", FALSE, ch, 0, 0, TO_ROOM);
       break;
   }
return FALSE;
}


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