View Single Post
Old 07-02-2002, 10:23 PM   #1
Nostrum
Member
 
Join Date: Apr 2002
Posts: 47
Nostrum is on a distinguished road
Send a message via ICQ to Nostrum
Once again this may have been a post for the coder's but i am a newbie so....anyways, the codebase is SMAUG1.4. I cannot get a clean compile after i Imp'd a new spell here is the code:
ch_ret spell_fyreball( int sn, int level, CHAR_DATA *ch, void *vo )
{
   CHAR_DATA *vch;
   CHAR_DATA *vch_next;
   int dam;
   int hpch;
   bool ch_died;
   
   ch_died = FALSE;

   if ( IS_SET( ch->in_room->room_flags, ROOM_SAFE ) )  
   {
       set_char_color( AT_MAGIC, ch );
       send_to_char( "You fail to cast your spell.\n\r", ch );
       return rNONE;
   }

   for ( vch = ch->in_room->first_person; vch; vch = vch_next )
   {
       vch_next = vch->next_in_room;
if ( !IS_NPC( vch ) && xIS_SET( vch->act, PLR_WIZINVIS )      
       && vch->pcdata->wizinvis >= LEVEL_IMMORTAL )
         continue;

       if ( IS_NPC(ch) ? !IS_NPC(vch) : IS_NPC(vch) )
       {
   act( AT_MAGIC, "A seering ball of flame from $n"
                       ", engulfs $N.",  
         ch, ch, vch, TO_ROOM );
           act( AT_MAGIC, "A seering ball of flame from you,"
                       " engulfs  $N",
         ch, ch, vch , TO_CHAR );

           hpch = UMAX( 10, ch->hit );
           dam  = number_range( hpch/14+1, hpch/7 );
           if ( saves_breath( level, vch ) )
               dam /= 2;
           if ( damage( ch, vch, dam, sn ) == rCHAR_DIED ||
char_died(ch) )
             ch_died = TRUE;
       }
   }

   if ( ch_died )
return rCHAR_DIED;
   else
return rNONE;  
}
the error msg. says that for each it can only be declared once in fight.c here is what i put in fight.c:

case ATCK_FYREBALL: retcode = spell_fyreball( skill_lookup( "fyreball" ),ch->level, ch, victim ); break;        

what did i miss to get such an error message? i thought this was a clean function.
Nostrum is offline   Reply With Quote