View Single Post
Old 02-22-2003, 11:04 AM   #5
DSer
Member
 
Join Date: Apr 2002
Location: Virginia
Posts: 65
DSer is on a distinguished road
Send a message via ICQ to DSer Send a message via AIM to DSer
<font = "arial">
[code] //************************************************** **********************
// RUB SKILL (Rub your eyes clean.) **************************************
// Used with permission from Devil's Silence MUD (dsmud.com 5000) ********
//************************************************** **********************
void do_rub( CHAR_DATA *ch, char *argument )
{
   char arg[INPUTLEN];
   int chance, dex;

   if( (chance = get_skill(ch,gsn_rub)) < 1 )
   {
               send_to_char("You don't know the first thing about rubbing your eyes out!\n\r",ch);
               return;
   }

   one_argument(argument, arg);

       if( IS_AFFECTED(ch,AFF_BLIND))
       {
                       if( !is_affected(ch, skill_lookup("fire breath")) &&
                       !is_affected(ch, skill_lookup("dirt kicking")))                {
                       send_to_char("Rubbing your eyes won't help that!\n\r",ch);
                       return;
               }
       }
       else
       {
               send_to_char("But you aren't blinded!\n\r",ch);
               return;
       }
   
   if( ch->stunned)
   {
       send_to_char("You're still a little woozy.\n\r",ch);
       return;
   }
               
       //*** Calculate chance of success.
       chance /= 2;
               
       if( (dex = get_curr_stat(ch,STAT_DEX)) > 15)
               chance += dex - 15;
       else
               chance -= UMIN(5, dex-15);
               
       if( IS_AFFECTED(ch,AFF_HASTE))
               chance += 10;

       if( IS_AFFECTED(ch,AFF_SLOW))
               chance -= 5;

       if( chance < 0)
               chance = 0;
   
       if( number_percent() < chance )
   {
               send_to_char("{rYou cleared your eyes!{0\n\r",ch);
       act("{k$n rubbed $s eyes clear!{x",ch,NULL,NULL,TO_ROOM);                
       if( is_affected(ch, skill_lookup("fire breath")))
         affect_strip(ch, skill_lookup("fire breath"));
       if( is_affected(ch, skill_lookup("dirt kicking")))
         affect_strip(ch, skill_lookup("dirt kicking"));
                   
                       
       check_improve(ch,gsn_rub,TRUE,2);
       WAIT_STATE(ch,skill_table[gsn_rub].beats);
   }
   else
   {
               send_to_char("{RYou failed to rub your eyes clear!{0\n\r",ch);
       check_improve(ch,gsn_rub,FALSE,2);
       WAIT_STATE(ch,skill_table[gsn_rub].beats);
   }
}

[/quote]
DSer is offline   Reply With Quote