dbzskills.c

DBZu/src/dbzskills.c · 304.8 KB

From the archive DBZu.zip

Download the archive   « Back to the archive contents

/****************************************************************************
 * |Dragon Ball Z Universe, Version FINAL                     |             *
 * -----------------------------------------------------------|             *
 * |DBZUCodebase V. FINAL, 2005, 2006, 2007, Jessie Reidl     |             *
 * -----------------------------------------------------------|             *
 ****************************************************************************/

#include <sys/types.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <sys/stat.h>
#include "mud.h"

bool not_transformed args( (CHAR_DATA *ch ) );
bool in_range args(( CHAR_DATA *ch, CHAR_DATA *victim ));
bool can_userace( CHAR_DATA *ch, int gsn );

int     summon_state;
int     game_state;
int     moon_state;
AREA_DATA * summon_area;
ROOM_INDEX_DATA * summon_room;

POLL_DATA * first_vote;
POLL_DATA * last_vote;

bool can_usepl( CHAR_DATA *ch, int gsn )
{
  SKILLTYPE *skill;

skill = skill_table[gsn];

if ( skill->pl >= ch->exp )
return FALSE;
else
return TRUE;

}

bool can_userace( CHAR_DATA *ch, int gsn )
{
  SKILLTYPE *skill;

  skill = skill_table[gsn];

  if ( !skill )
  return FALSE;

  /* Human */
  if (xIS_SET(skill->raceskill, RACESKILL_HUMAN) && ch->race == RACE_HUMAN)
  return TRUE;
  /* Android */
  if (xIS_SET(skill->raceskill, RACESKILL_ANDROID) && ch->race == RACE_ANDROID)
  return TRUE;
  /* Saiyan */
  if (xIS_SET(skill->raceskill, RACESKILL_SAIYAN) && ch->race == RACE_SAIYAN)
  return TRUE;
  /* Halfbreed */
  if (xIS_SET(skill->raceskill, RACESKILL_HALFBREED) && ch->race == RACE_HALFBREED)
  return TRUE;
  /* Biodroid */
  if (xIS_SET(skill->raceskill, RACESKILL_BIOANDROID) && ch->race == RACE_BIOANDROID)
  return TRUE;
  /* Mutant */
  if (xIS_SET(skill->raceskill, RACESKILL_MUTANT) && ch->race == RACE_MUTANT)
  return TRUE;
  /* Icer */
  if (xIS_SET(skill->raceskill, RACESKILL_ICER) && ch->race == RACE_ICER)
  return TRUE;
  /* Namek */
  if (xIS_SET(skill->raceskill, RACESKILL_NAMEK) && ch->race == RACE_NAMEK)
  return TRUE;

 return FALSE;
}


ch_ret spell_cure( int sn, int level, CHAR_DATA *ch, void *vo )
{
    CHAR_DATA *victim = (CHAR_DATA *) vo;
    int dam;

    dam         = number_range( get_curr_con(ch) * 1.1, get_curr_con(ch) * 1.4 );
    victim->hit += dam;
    ch_printf(ch, "&wYour cure recovers %s for %d.&D\n\r", victim->name, dam );
    ch_printf(victim, "&wYour light wounds mend as your pain ebbs slightly. &G[%d]\n\r", dam );
    if (victim->hit > victim->max_hit)
    victim->hit = victim->max_hit;
}

ch_ret spell_cura( int sn, int level, CHAR_DATA *ch, void *vo )
{
    CHAR_DATA *victim = (CHAR_DATA *) vo;
    int dam;

    dam         = number_range( get_curr_con(ch) * 2, get_curr_con(ch) * 2.2 );
    victim->hit += dam;
    ch_printf(ch, "&wYour cura recovers %s for %d.&D\n\r", victim->name, dam );
    ch_printf(victim, "&wYour serious wounds mend as your pain ebbs slightly. &G[%d]\n\r", dam );
    if (victim->hit > victim->max_hit)
    victim->hit = victim->max_hit;
}

int convert_pos( int number )
{
   int temp;
   if (number > 0)
   return number;
   temp = number * number;
   temp = sqrt(temp);

   return temp;
}

ch_ret spell_curaga( int sn, int level, CHAR_DATA *ch, void *vo )
{
    CHAR_DATA *victim = (CHAR_DATA *) vo;
    int dam;

    dam         = number_range( get_curr_con(ch) * 4, get_curr_con(ch) * 4.4 );
    victim->hit += dam;
    ch_printf(ch, "&wYour curaga recovers %s for %d.&D\n\r", victim->name, dam );
    ch_printf(victim, "&wYour critical wounds mend as your pain ebbs slightly. &G[%d]\n\r", dam );
    if (victim->hit > victim->max_hit)
    victim->hit = victim->max_hit;
}

ch_ret spell_shell( int sn, int level, CHAR_DATA *ch, void *vo )
{
    CHAR_DATA *victim = (CHAR_DATA *) vo;
    AFFECT_DATA af;

    if ( IS_AFFECTED( victim, AFF_SHELL ) )
    {
    ch_printf(ch, "&GYou to try create a magical barrier but your target already has one.&D\n\r" );
      return rSPELL_FAILED;
    }
   else

  af.type = gsn_shell;
  af.duration = get_curr_str(ch);
  af.modifier  = 0;
  af.location = APPLY_AFFECT;
  af.bitvector = meb(AFF_SHELL);
  affect_to_char(victim, &af);

}

ch_ret spell_flare( int sn, int level, CHAR_DATA *ch, void *vo )
{
    CHAR_DATA *victim = (CHAR_DATA *) vo;

    int dam;
    int num1;
    int num2;

    dam         = number_range( 1, get_curr_con(ch) * 4 );
    if ( get_curr_wis(victim) > 1)
    dam - get_curr_wis(victim)/4; 
    return damage( ch, victim, dam, sn );
}

void do_stats( CHAR_DATA *ch, char *argument )
{
  ch_printf( ch, "\n\r&RCharacter Statistics&z:\n\r\n\r");
  ch_printf( ch, "&zYour current Practice Session is&O:&W %d\n\r", ch->practice );
  ch_printf( ch, "&zYour current Ki Gain is&O:&w %d\n\r", ch->skigain );
  ch_printf( ch, "&zYour current Stat Gain is&O: &W%d\n\r", ch->statgain);
  ch_printf( ch, "&zGravity is set to&O:&w %d\n\r", ch->gravset);
}

void do_slash( CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;

    if ( IS_NPC(ch) && IS_AFFECTED( ch, AFF_CHARM ) )
    {
        send_to_char( "You can't concentrate enough for that.\n\r", ch );
        return;
    }

    if ( !IS_NPC(ch)
    &&   ch->level < skill_table[gsn_slash]->skill_level[ch->class] )
    {
        send_to_char(
            "You better leave the slashing to the warriors.\n\r", ch );
        return;
    }

    if ( ( victim = who_fighting( ch ) ) == NULL )
    {
        send_to_char( "You aren't fighting anyone.\n\r", ch );
        return;
    }

    WAIT_STATE( ch, skill_table[gsn_slash]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_slash ) )
    {
        if ( can_use_skill(ch, number_percent(),gsn_dblslash ) )
        {
        global_retcode = damage( ch, victim, number_range( 1, ch->level ), gsn_slash );
        global_retcode = damage( ch, victim, number_range( 1, ch->level*1.5 ), gsn_dblslash );
        learn_from_success( ch, gsn_dblslash );
        }
        else
        global_retcode = damage( ch, victim, number_range( 1, ch->level ), gsn_slash );
        learn_from_success( ch, gsn_slash );
    }
    else
    {
        learn_from_failure( ch, gsn_slash );
        global_retcode = damage( ch, victim, 0, gsn_slash );
    }
    return;
}

#define CHANGES_FILE SYSTEM_DIR "changes.dat"

void append_changes( CHAR_DATA *ch, char *str );
static char *timestamp(void);

CHAR_DATA *sense_for_victim( CHAR_DATA *ch, char *name )
{
    CHAR_DATA *victim;
    ROOM_INDEX_DATA *was_in_room;
    EXIT_DATA *pexit;
    bool found;

    found = FALSE;
    victim = NULL;

    was_in_room = ch->in_room;
     for ( pexit = ch->in_room->first_exit; pexit; pexit = pexit->next )
     {
      char_from_room( ch );
      char_to_room( ch, pexit->to_room ); 

      if ( ( victim = get_char_room( ch, name ) ) == NULL )
      found = FALSE;

      if ( ( victim = get_char_room( ch, name ) ) != NULL )
      {
       found = TRUE;

       if (xIS_SET(ch->in_room->room_flags, ROOM_NOSNIPE))
       {
        found = FALSE;
        break;
       }

       break;
      }
     }
      char_from_room( ch );
      char_to_room( ch, was_in_room ); 

/*       if ( found && xIS_SET( victim->act, ACT_DEFLECT ) )
       {
        act( AT_WHITE, "&W$N stretches $s arm and deflects the ki attack back at you []" , ch,NULL,victim,TO_CHAR);
       } */

       if ( found && !can_use_skill(ch, number_percent(), gsn_sense ) )
       {
        act( AT_WHITE, "&W$n closes $s and tries to sense $N\n\r$n opens $s eyes and wonders..." , ch,NULL,victim, TO_ROOM);
        learn_from_failure( ch, gsn_sense );
        return NULL;
       }
     
      else if ( found && can_use_skill(ch, number_percent(), gsn_sense ) ) 
      {
      act( AT_WHITE, "&W$n closes $s and tries to sense $N\n\r$n opens $s eyes and grins..." , ch,NULL,victim,TO_ROOM);
      learn_from_success( ch, gsn_sense );
      return victim;
      }

  return NULL;
}


/* stamp that time! -Nopey */
static char *timestamp(void)
{
   static char buf[MAX_STRING_LENGTH];
   struct tm *t = localtime(&current_time);

   sprintf( buf, "%04d-%02d-%02d", t->tm_year+1900, t->tm_mon+1,  t->tm_mday );
   return buf;
}

void warcry( CHAR_DATA *ch, CHAR_DATA *victim )
{
  char buf[MAX_STRING_LENGTH];

   if ( ch->position != POS_FIGHTING  )
   {
    if ( !IS_NPC(victim))
    {
      sprintf( buf, "Help!  I am being attacked by %s!", ch->name );
      if ( IS_PKILL(victim) || victim->exp >= 5000000)
        do_wartalk( victim, buf );
      else
        do_yell( victim, buf );
    }
   }
}
                          
/* append changes to the changes.dat file inside /system/ -Nopey */
void append_changes( CHAR_DATA *ch, char *str )
{
    char buf[MAX_STRING_LENGTH];
    FILE *fp;

    if ( IS_NPC(ch) || str[0] == '\0' )
	return;

    if ( ( fp = fopen( CHANGES_FILE, "a" ) ) == NULL )
    {
	perror( CHANGES_FILE );
	send_to_char( "Could not open the file!\n\r", ch );
    }
    else
    {
	fprintf( fp, "&g[&G %s&g ]&c %s&C: %s\n", timestamp(), capitalize(ch->name), str );
	fclose( fp );
    }
    return;
}

/* The changes function :o -Nopey */
/*  void do_changes(CHAR_DATA *ch, char *argument)
{
    char buf[MAX_STRING_LENGTH];

  if(IS_NPC(ch))
  {
    send_to_char("Huh?\n\r", ch);
    return;
  }
  
  if(*argument == '\0' || !argument || !IS_IMMORTAL(ch))
  {
    set_char_color(AT_WHITE, ch);
    show_file(ch, CHANGES_FILE);
    return;
  }
  else if(IS_IMMORTAL(ch))
  { 
    append_changes(ch, argument);
    send_to_char("Changes log appended.\n\r", ch);
    sprintf( buf, "&z[&WDBZU&z]&W A new &rc&Rh&ra&Rn&rg&Re&W has been added, type 'changes' to view it.&D" );
    talk_info( AT_BLUE, buf );
    return;
  }
} */

#define NUM_DAYS 35
#define NUM_MONTHS 17
#define MAP_WIDTH 72
#define MAP_HEIGHT 8


const char * star_map[] =
{
"                                               C. C.                  g*",
"    O:       R*        G*    G.  W* W. W.          C. C.    Y* Y. Y.    ", 
"  O*.                c.          W.W.     W.            C.       Y..Y.  ",   
"O.O. O.              c.  G..G.           W:      B*                   Y.",     
"     O.    c.     c.                     W. W.                  r*    Y.",
"     O.c.     c.      G.             P..     W.        p.      Y.   Y:  ",
"        c.                    G*    P.  P.           p.  p:     Y.   Y. ",
"                 b*             P.: P*                 p.p:             "
};

/****************** CONSTELLATIONS and STARS *****************************
  Cygnus     Mars        Orion      Dragon       Cassiopeia          Venus
           Ursa Ninor                           Mercurius     Pluto    
               Uranus              Leo                Crown       Raptor
*************************************************************************/	
const char * sun_map[] =
{
"\\`|'/",
"- O -",
"/.|.\\"
};
const char * moon_map[] =
{
" @@@ ",
"@@@@@",
" @@@ "
};

void look_sky ( CHAR_DATA * ch )
{
    static char buf[MAX_STRING_LENGTH];
    static char buf2[4];
    int starpos, sunpos, moonpos, moonphase, i, linenum, precip;

   pager_printf_color(ch,"You gaze up towards the heavens and see:\n\r");

	precip = (ch->in_room->area->weather->precip + 3*weath_unit - 1)/
		weath_unit;
   if (precip > 1)                 
{
  send_to_char("There are some clouds in the sky so you cannot see anything else.\n\r", ch);
   return;
}
   sunpos  = (MAP_WIDTH * (24 - time_info.hour) / 24);
   moonpos = (sunpos + time_info.day * MAP_WIDTH / NUM_DAYS) % MAP_WIDTH;
   if ((moonphase = ((((MAP_WIDTH + moonpos - sunpos ) % MAP_WIDTH ) +
                      (MAP_WIDTH/16)) * 8 ) / MAP_WIDTH)
		         > 4) moonphase -= 8;
   starpos = (sunpos + MAP_WIDTH * time_info.month / NUM_MONTHS) % MAP_WIDTH;
   /* The left end of the star_map will be straight overhead at midnight during 
      month 0 */

   for ( linenum = 0; linenum < MAP_HEIGHT; linenum++ )
   {
     if ((time_info.hour >= 6 && time_info.hour <= 18) &&
         (linenum < 3 || linenum >= 6))
       continue;
     sprintf(buf," ");
   

     /* for ( i = MAP_WIDTH/4; i <= 3*MAP_WIDTH/4; i++)*/
     for ( i = 1; i <= MAP_WIDTH; i++)
     {
       /* plot moon on top of anything else...unless new moon & no eclipse */
       if ((time_info.hour >= 6 && time_info.hour <= 18)  /* daytime? */
        && (moonpos >= MAP_WIDTH/4 - 2) && (moonpos <= 3*MAP_WIDTH/4 + 2) /* in sky? */
        && ( i >= moonpos - 2 ) && (i <= moonpos + 2) /* is this pixel near moon? */
        && ((sunpos == moonpos && time_info.hour == 12) || moonphase != 0  ) /*no eclipse*/
        && (moon_map[linenum-3][i+2-moonpos] == '@'))
       {
         if ((moonphase < 0 && i - 2 - moonpos >= moonphase) ||
             (moonphase > 0 && i + 2 - moonpos <= moonphase))
           strcat(buf,"&W@");
         else
           strcat(buf," ");
       }
       else
       if ((linenum >= 3) && (linenum < 6) && /* nighttime */
           (moonpos >= MAP_WIDTH/4 - 2) && (moonpos <= 3*MAP_WIDTH/4 + 2) /* in sky? */
        && ( i >= moonpos - 2 ) && (i <= moonpos + 2) /* is this pixel near moon? */
        && (moon_map[linenum-3][i+2-moonpos] == '@'))
       {
         if ((moonphase < 0 && i - 2 - moonpos >= moonphase) ||
             (moonphase > 0 && i + 2 - moonpos <= moonphase))
           strcat(buf,"&W@");
         else
           strcat(buf," ");
       }
       else /* plot sun or stars */
       {
         if (time_info.hour>=6 && time_info.hour<=18) /* daytime */
         {
           if ( i >= sunpos - 2 && i <= sunpos + 2 )
           {
             sprintf(buf2,"&Y%c",sun_map[linenum-3][i+2-sunpos]);
             strcat(buf,buf2);
           }
           else
             strcat(buf," ");
         }
         else
         {
           switch (star_map[linenum][(MAP_WIDTH + i - starpos)%MAP_WIDTH])
           {
             default     : strcat(buf," ");    break;
             case ':'    : strcat(buf,":");    break;
             case '.'    : strcat(buf,".");    break;
             case '*'    : strcat(buf,"*");    break;
             case 'G'    : strcat(buf,"&G ");  break;
             case 'g'    : strcat(buf,"&g ");  break;
             case 'R'    : strcat(buf,"&R ");  break;
             case 'r'    : strcat(buf,"&r ");  break;
             case 'C'    : strcat(buf,"&C ");  break;
             case 'O'    : strcat(buf,"&O ");  break;
             case 'B'    : strcat(buf,"&B ");  break;
             case 'P'    : strcat(buf,"&P ");  break;
             case 'W'    : strcat(buf,"&W ");  break;
             case 'b'    : strcat(buf,"&b ");  break;
             case 'p'    : strcat(buf,"&p ");  break;
             case 'Y'    : strcat(buf,"&Y ");  break;
             case 'c'    : strcat(buf,"&c ");  break;
           }
         }
       }
     }
     strcat(buf,"\n\r");
     pager_printf_color(ch,buf);
  }
}

void do_train( CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *mob;
/*   char              arg1[MAX_INPUT_LENGTH]; */
    sh_int *pAbility;
    char *pOutput;
    int cost;
    int chance;
    int reqki1, reqki2;
    chance = number_range(0, 3);
    reqki1 = ch->max_mana / 4;
    reqki2 = ch->max_mana / 3; 

/*   argument = one_argument( argument, arg1 ); */

    if ( IS_NPC(ch) )
        return;

/*    if (!xIS_SET(ch->in_room->room_flags, ROOM_GRAVITY) && !str_cmp( argument, "gravity" ) )
      {
         send_to_char( "You aren't in a gravity chamber.\n\r", ch );
         return;
      }

   if ( xIS_SET(ch->in_room->room_flags, ROOM_GRAVITY) && !str_cmp( argument, "gravity" ) )
      {
        if ( ch->gravset = 0 )
         {
         send_to_char( "You must first set a level of gravity using 'Gravset'.\n\r", ch );
         return;
         }
       } */

   if (!IN_TRAIN(ch) )
     {
      if ( !str_cmp( argument, "str" ) || !str_cmp( argument, "int" ) || !str_cmp( argument,  "wis" ) || !str_cmp( argument, "dex" ) || !str_cmp( argument, "con" ) || !str_cmp( argument,"cha" ) || !str_cmp( argument, "lck" ) || !str_cmp( argument, "chikara1" ) || !str_cmp( argument, "chikara2" )|| !str_cmp( argument, "chikara3") || !str_cmp( argument, "chikara4") || !str_cmp( argument, "primary") || !str_cmp( argument, "secondary") || !str_cmp( argument, "chikara5") )
     {
         send_to_char( "You can't do that here.\n\r", ch );
         return;
    }
   }

    if (ch->position < POS_STANDING)
    {
        send_to_char( "You cannot train in this position.\n\r", ch );
        return;
    }
    cost = 1;   /* Other then prime att cost */

    if ( !str_cmp( argument, "gravity" ) )
    {
       
    }

    if ( !str_cmp( argument, "str" ) )
    {
        if ( class_table[ch->class]->attr_prime == APPLY_STR )
            cost    = 1;
        pAbility    = &ch->perm_str;
        pOutput     = "strength";
    }

    else if ( !str_cmp( argument, "int" ) )
    {
        if ( class_table[ch->class]->attr_prime == APPLY_INT )
            cost    = 1;
        pAbility    = &ch->perm_int;
        pOutput     = "intelligence";
    }
    else if ( !str_cmp( argument, "wis" ) )
    {
        if ( class_table[ch->class]->attr_prime == APPLY_WIS )
            cost    = 1;
        pAbility    = &ch->perm_wis;
        pOutput     = "wisdom";
    }

    else if ( !str_cmp( argument, "dex" ) )
    {
        if ( class_table[ch->class]->attr_prime == APPLY_DEX )
            cost    = 1;
        pAbility    = &ch->perm_dex;
        pOutput     = "dexterity";
    }

    else if ( !str_cmp( argument, "con" ) )
    {
        if ( class_table[ch->class]->attr_prime == APPLY_CON )
            cost    = 1;
        pAbility    = &ch->perm_con;
        pOutput     = "constitution";
    }
    else if ( !str_cmp( argument, "cha" ) )
    {
        if ( class_table[ch->class]->attr_prime == APPLY_CHA )
            cost    = 1;
        pAbility    = &ch->perm_cha;
        pOutput     = "charisma";
    }

    else if ( !str_cmp( argument, "lck" ) )
    {
        if ( class_table[ch->class]->attr_prime == APPLY_LCK )
            cost    = 1;
        pAbility    = &ch->perm_lck;
        pOutput     = "luck";
    }
    else if( !str_cmp( argument, "chikara1" ) )
    {
     save_char_obj( ch );
     if (ch->pcdata->learned[gsn_chikone] == 0) { send_to_char("You don't know Chikara 1.\n\r",ch); return; }
     if (ch->mana < reqki1){ send_to_char("You need more energy to train.\n\r", ch); return;}
     if (ch->pcdata->learned[gsn_chikone] >= 100 )
     { send_to_char("You have fully trained Chikara 1.\n\r", ch); ch->pcdata->learned[gsn_chikone] = 100; return;}
     if (ch->pcdata->learned[gsn_chikone] < 101 )
     {
      ch->mana -= reqki1;
      send_to_char("\n\r&wYou feel the power rushing through your body as you train, excellent!.\n\r", ch);
      do_release(ch, "" );
      do_sleep(ch, "" );
      act( AT_YELLOW, "$n trains Chikara 1.", ch, NULL, NULL, TO_ROOM );
      if (chance == 0 || chance == 2)
      ch->pcdata->learned[gsn_chikone] += number_range(2, 3);
     }
     return;
    }
    else if( !str_cmp( argument, "chikara2" ) )
    {
     save_char_obj( ch );
     if (ch->pcdata->learned[gsn_chiktwo] == 0) { send_to_char("You don't know Chikara 2.\n\r",ch); return; }
     if (ch->mana < reqki1){ send_to_char("You need more energy to train.\n\r", ch); return;}
     if (ch->pcdata->learned[gsn_chiktwo] >= 100 )
     { send_to_char("You have fully trained Chikara 2.\n\r", ch); ch->pcdata->learned[gsn_chiktwo] = 100; return;}
     if (ch->pcdata->learned[gsn_chiktwo] < 101 )
     {
      ch->mana -= reqki1;
       send_to_char("\n\r&wYou feel the power rushing through your body as you train,excellent!.\n\r", ch);
      do_release(ch, "" );
      do_sleep(ch, "" );
      act( AT_YELLOW, "$n trains Chikara 2.", ch, NULL, NULL, TO_ROOM );
      if (chance == 0 || chance == 2)
      ch->pcdata->learned[gsn_chiktwo] += number_range(2, 3);
     }
     return;
    }
    else if( !str_cmp( argument, "chikara3" ) )
    {
     save_char_obj( ch );
     if (ch->pcdata->learned[gsn_chikthree] == 0) { send_to_char("You don't know Chikara 3.\n\r",ch); return; }
     if (ch->mana < reqki2){ send_to_char("You need more energy to train.\n\r", ch); return;}
     if (ch->pcdata->learned[gsn_chikthree] >= 100 )
     { send_to_char("You have fully trained Chikara 3.\n\r", ch); ch->pcdata->learned[gsn_chikthree] = 100; return;}
     if (ch->pcdata->learned[gsn_chikthree] < 101 )
     {
      ch->mana -= reqki2;
      send_to_char("\n\r&wYou feel the power rushing through your body as you train, excellent!.\n\r", ch);
      do_release(ch, "" );
      do_sleep(ch, "" );
      act( AT_YELLOW, "$n trains Chikara 3.", ch, NULL, NULL, TO_ROOM );
      if (chance == 0 || chance == 2)
      ch->pcdata->learned[gsn_chikthree] += number_range(2, 3);
     }
    return;
    }
    else if( !str_cmp( argument, "chikara4" ) )
    {
     save_char_obj( ch );
     if (ch->pcdata->learned[gsn_chikfour] == 0) { send_to_char("You don't know Chikara 4.\n\r",ch); return; }
     if (ch->mana < reqki2){ send_to_char("You need more energy to train.\n\r", ch); return;}
     if (ch->pcdata->learned[gsn_chikfour] >= 100 )
     { send_to_char("You have fully trained Chikara 4.\n\r", ch); ch->pcdata->learned[gsn_chikfour] = 100; return;}
     if (ch->pcdata->learned[gsn_chikfour] < 101 )
     {
      ch->mana -= reqki2;
      send_to_char("\n\r&wYou feel the power rushing through your body as you train,excellent!.\n\r", ch);
      do_release(ch, "" );
      do_sleep(ch, "" );
      act( AT_YELLOW, "\n\r$n trains Chikara 4.", ch, NULL, NULL, TO_ROOM );
      if (chance == 0 || chance == 2)
      ch->pcdata->learned[gsn_chikfour] += number_range(2, 3);
     }
    return;
    }
/*    else if( !str_cmp( argument, "chikara5" ) )
    {
     save_char_obj( ch );
     if (ch->pcdata->learned[gsn_chikfive] == 0) { send_to_char("You don't know Chikara 5.\n\r",ch); return; }
     if (ch->mana < reqki2){ send_to_char("You need more energy to train.\n\r", ch); return;}
     if (ch->pcdata->learned[gsn_chikfive] >= 100 )
     { send_to_char("You have fully trained Chikara 5.\n\r", ch); ch->pcdata->learned[gsn_chikfive] = 100; return;}
     if (ch->pcdata->learned[gsn_chikfive] < 101 )
     {
      ch->mana -= reqki2;
      send_to_char("\n\r&wYou feel the power rushing through your body as you train, excellent!.\n\r", ch);
      do_release(ch, "" );
      do_sleep(ch, "" );
      act( AT_YELLOW, "$n trains Chikara 5.", ch, NULL, NULL, TO_ROOM );
      if (chance == 0 || chance == 2)
      ch->pcdata->learned[gsn_chikfive] += number_range(2, 3);
     }
    return;
    } */

    else if( !str_cmp( argument, "secondary" ) )
    {
     save_char_obj( ch );

     if (ch->mana < 1000)
     { send_to_char("You need more energy to train.\n\r", ch);
       return;
     }
     if (ch->pcdata->learned[gsn_secondary_skill] >= 100 )
     {
        send_to_char("You have fully trained Secondary Skill.\n\r", ch);
        return;
     }
     if (ch->pcdata->learned[gsn_secondary_skill] == 0)
     {
         send_to_char( "You don't know Secondary Skill.\n\r",ch);
         return;
     }
     else if(ch->pcdata->learned[gsn_secondary_skill] < 100 )
     {
        ch->mana -= 1000;
        send_to_char("&wYou train your Secondary Skill.\n\r", ch);
        act( AT_YELLOW, "$n trains Secondary Skill.", ch, NULL, NULL, TO_ROOM );
        if (chance == 0 || chance == 2)
        ch->pcdata->learned[gsn_secondary_skill] += number_range(2, 3);
     }
        if ( ch->pcdata->learned[gsn_secondary_skill] >= 50
        && !xIS_SET(ch->act, PLR_SECONDARY_CORTEX)
        && !xIS_SET(ch->act, PLR_SECONDARY_IMPROVEDSKIN)
        && !xIS_SET(ch->act, PLR_SECONDARY_SPIKES)
        && !xIS_SET(ch->act, PLR_SECONDARY_KICONTROL)
        && !xIS_SET(ch->act, PLR_SECONDARY_ULTRABODY))
        {
        if (number_range( 1, 10 ) == 1 )
        {
        send_to_char("&RYou body beings to grow.\n\r&cLarge Spikes petrude from your body.\n\r&YYou have just attained  Spikes.", ch );
        xSET_BIT( ch->act, PLR_SECONDARY_SPIKES );
        }
        else if (number_range( 1, 10 ) == 2 )
        {
        send_to_char("&RYour body begins to change.\n\r&cYour skin begins to harden.\n\r&YYou have just attained Improved Skin.", ch );
        xSET_BIT( ch->act, PLR_SECONDARY_IMPROVEDSKIN );
        }
        else if (number_range( 1, 10 ) == 3 )
        {
        send_to_char("&RYou body beings to grow.\n\r&cLarge Spikes petrude from your body.\n\r&YYou have just attained Spikes.", ch );
        xSET_BIT( ch->act, PLR_SECONDARY_SPIKES );
        }
        else if (number_range( 1, 10 ) == 4 )
        {
        send_to_char("&RYour body changes.\n\r&cYour feel like you can take on the world.\n\r&YYou have just attainedUltraBody.", ch );
        xSET_BIT( ch->act, PLR_SECONDARY_ULTRABODY );
        }
        else if (number_range( 1, 10 ) == 5 )
        {
        send_to_char("&RYour body changes.\n\r&cYour feel like you can take on the world.\n\r&YYou have just attained UltraBody.", ch );
        xSET_BIT( ch->act, PLR_SECONDARY_ULTRABODY );
        }
        else if (number_range( 1, 10 ) == 6 )
        {
        send_to_char("&RYour body changes.\n\r&cYour feel like you can take on the world.\n\r&YYou have just attainedUltraBody.", ch );
        xSET_BIT( ch->act, PLR_SECONDARY_ULTRABODY );
        }
        else if (number_range( 1, 10 ) == 8 )
        {
        send_to_char("&RYour intelligence rises.\n\r&cYour feel more adept using ki abilities.\n\r&YYou have just attained Ki Control.", ch );
        xSET_BIT( ch->act, PLR_SECONDARY_KICONTROL );
        }
        else if (number_range( 1, 10 ) == 7 )
        {
        send_to_char("&RYour intelligence rises.\n\r&cYour feel more adept using ki abilities.\n\r&YYou have justattained Ki Control.", ch );
        xSET_BIT( ch->act, PLR_SECONDARY_KICONTROL );
        }
        else if (number_range( 1, 10 ) == 9 )
        {
        send_to_char("&RA warm glow fills your body.\n\r&cYou become more adept to the skill scattershot.\n\r&YYou have just attained Cortex", ch );
        xSET_BIT( ch->act, PLR_SECONDARY_CORTEX );
        }
        else if (number_range( 1, 10 ) == 10 )
        {
        send_to_char("&RYou body beings to grow.\n\r&cLarge Spikes petrude from your body.\n\r&YYou have just attained Spikes.", ch );
        xSET_BIT( ch->act, PLR_SECONDARY_SPIKES );
        }
       
        learn_from_success( ch, gsn_secondary_skill);
        return;
      }
  return;
}

/*    else if( !str_cmp( argument, "primarytechnique" ) )
    {
     int result;

     save_char_obj( ch );
     saving_char = NULL;
     if (!IS_BIODROID(ch)){ send_to_char("Huh?\n\r", ch ); return;}
     if (ch->mana < ch->max_mana/7)
     {
      send_to_char("You need more ki.\n\r", ch); return;
     }
     if (ch->pcdata->learned[gsn_primaryattack] == 0) { send_to_char("Practice it First.\n\r",ch); return; }
     if (ch->pcdata->learned[gsn_primaryattack] >= 100) {send_to_char("Its at maximum.\n\r",ch); return;}
     if (ch->pcdata->learned[gsn_primaryattack] < 100 ) {
     send_to_char("\n\r&YYou train your primary attack.\n\r", ch);
     ch->mana -= ch->max_mana/7;
     ch->pcdata->learned[gsn_primaryattack] += 1; }
       if (xIS_SET(ch->act, PLR_PRIMARY_TRIBEAM) || xIS_SET(ch->act, PLR_PRIMARY_MASENKO) || xIS_SET(ch->act, PLR_PRIMARY_DDD) || xIS_SET(ch->act, PLR_PRIMARY_SCATTER) || xIS_SET(ch->act, PLR_PRIMARY_BARRIER))
       return;

     save_char_obj( ch );
     int result;

       result = (sh_int) number_range( 0, 12 );

     if (ch->mana < ch->max_mana/7)
     { send_to_char("You need more energy to train.\n\r", ch);
       return;
     }
     if (ch->pcdata->learned[gsn_primaryattack] >= 100 )
     {
        send_to_char("You have fully trained Primary Technique.\n\r", ch);
        return;
     }
     if (ch->pcdata->learned[gsn_primaryattack] == 0)
     {
         send_to_char( "You don't know Primary Technique.\n\r",ch);
         return;
     }
     else if(ch->pcdata->learned[gsn_primaryattack] < 100 )
     {
        ch->mana -= ch->max_mana/7;
        send_to_char("&wYou train your Primary Technique.\n\r", ch);
        act( AT_YELLOW, "$n trains Primary Technique.", ch, NULL, NULL, TO_ROOM );
        if (chance == 0 || chance == 2)
        ch->pcdata->learned[gsn_primaryattack] += number_range(2, 3);
     }
        if ( ch->pcdata->learned[gsn_primaryattack] >= 50
        && !xIS_SET(ch->act, PLR_PRIMARY_SCATTER)
        && !xIS_SET(ch->act, PLR_PRIMARY_TRIBEAM)
        && !xIS_SET(ch->act, PLR_PRIMARY_BARRIER)
        && !xIS_SET(ch->act, PLR_PRIMARY_MASENKO)
        && !xIS_SET(ch->act, PLR_PRIMARY_DDD))
        {

       if ( result >= 0 && result <= 4  )
       {
        send_to_char("&zAs you train your primary technique.\n\r&pYou clench your fists and gain a sudden rush of energy.\n\r&RYou are now adept with TRIBEAM!\n\r", ch);
        xSET_BIT(ch->act, PLR_PRIMARY_TRIBEAM);
        ch->pcdata->learned[gsn_tribeam] = 100;
        return;
       }
       if ( result >= 5 && result <= 9 )
       {
        send_to_char("&zAs you train your primary technique.\n\r&pYou clench your fists and gain a sudden rush of energy.\n\r&RYou are now adept with MASENKO!\n\r", ch);
        xSET_BIT(ch->act, PLR_PRIMARY_MASENKO);
        ch->pcdata->learned[gsn_masenko] = 100;
        return;
       }
       if ( result == 10 )
       {
        send_to_char("&zAs you train your primary technique.\n\r&pYou clench your fists and gain a sudden rush of energy.\n\r&RYou are now adept with SCATTERSHOT!\n\r", ch);
        xSET_BIT(ch->act, PLR_PRIMARY_SCATTER);
        ch->pcdata->learned[gsn_scattershot] = 100;
        return;
       }
       if ( result == 11 )
       {
        send_to_char("&zAs you train your primary attack,\n\r&pYou clench your fists and gain a sudden rush of energy.\n\r&RYou are now adept with DUAL DESTRUCTO DISK!\n\r", ch);
        xSET_BIT(ch->act, PLR_PRIMARY_DDD);
        ch->pcdata->learned[gsn_ddd] = 100;
        return;
       }
       if ( result == 12 )
       {
        send_to_char("&zAs you train your primary attack,\n\r&pYou clench your fists and gain a sudden rush of energy.\n\r&RYou are now adept with ENERGY BARRIER!\n\r", ch);
        xSET_BIT(ch->act, PLR_PRIMARY_BARRIER);
        ch->pcdata->learned[gsn_ebar] = 100;
        return;
       }
}
    return;
    } */

    else if( !str_cmp( argument, "primary" ) )
    {
     save_char_obj( ch );

     if (ch->mana < 100)
     { send_to_char("You need more energy to train.\n\r", ch);
       return;
     }
     if (ch->pcdata->learned[gsn_primary_skill] >= 100 )
     {
        send_to_char("You have fully trained Primary Skill.\n\r", ch);
        return;
     }
     if (ch->pcdata->learned[gsn_primary_skill] == 0)
     {
         send_to_char( "You don't know Primary Skill.\n\r",ch);
         return;
     }
     else if(ch->pcdata->learned[gsn_primary_skill] < 100 )
     {
        ch->mana -= 100;
        send_to_char("&wYou train your Primary Skill.\n\r", ch);
        act( AT_YELLOW, "$n trains Primary Skill.", ch, NULL, NULL, TO_ROOM );
        if (chance == 0 || chance == 2)
        ch->pcdata->learned[gsn_primary_skill] += number_range(2, 3);
     }
        if ( ch->pcdata->learned[gsn_primary_skill] >= 50
        && !xIS_SET(ch->act, PLR_PRIMARY_MEGABRAIN)
        && !xIS_SET(ch->act, PLR_PRIMARY_HIKI)
        && !xIS_SET(ch->act, PLR_PRIMARY_STONESKIN)
        && !xIS_SET(ch->act, PLR_PRIMARY_SMALLSIZE)
        && !xIS_SET(ch->act, PLR_PRIMARY_LARGESIZE) )
        {
        if (number_range( 1, 6 ) == 1 )
        {
       send_to_char("&RYour body shinks in size.\n\r&cYou become smaller, but faster.\n\r&YYou have just attained Small Size.", ch );
        xSET_BIT( ch->act, PLR_PRIMARY_SMALLSIZE );
        ch->mod_dex = 10;
        ch->mod_str = -5;
        }
/*        else if (number_range( 1, 6 ) == 3 )
        {
        send_to_char("&RYour body begins to change.\n\r&cYour skin changes into stone.\n\r&YYou have just attained Stone Skin.", ch );
        xSET_BIT( ch->act, PLR_PRIMARY_STONESKIN );
        ch->mod_lck = 2;
        ch->mod_str = 2;
        } */
        else if (number_range( 1, 6 ) == 6 )
        {
        send_to_char("&RYour body begins to change.\n\r&cYour skin changes into stone.\n\r&YYou have just attained Stone Skin.", ch );
        xSET_BIT( ch->act, PLR_PRIMARY_STONESKIN );
        ch->mod_lck = 2;
        ch->mod_str = 2;
        }
        else if (number_range( 1, 6 ) == 3 )
        {
       send_to_char("&RYour body shinks in size.\n\r&cYou become smaller, but faster.\n\r&YYou have just attained Small Size.", ch );
        xSET_BIT( ch->act, PLR_PRIMARY_SMALLSIZE );
        ch->mod_dex = 10;
        ch->mod_str = -5;
        }
        else if (number_range( 1, 6 ) == 2 )
        {
        send_to_char("&RYou feel your body's energy increase.\n\r&cYour ki has just been multiplied.\n\r&YYou have just attained Hi Ki.", ch );
        xSET_BIT( ch->act, PLR_PRIMARY_HIKI );
        ch->max_mana *= 1.5;
           ch->mod_str = -3;
           ch->mod_dex = 3;
           ch->mod_lck = 3;
        }
        else if (number_range( 1, 6 ) == 4 )
        {
        send_to_char("&RYour body grows in size.\n\r&cYou become stronger, but slower.\n\r&YYou have just attained Large Size.", ch);
        xSET_BIT( ch->act, PLR_PRIMARY_LARGESIZE );
           ch->mod_str = 10;
           ch->mod_dex = -5;
           ch->mod_lck = 2;
        }
        else if (number_range( 1, 6 ) == 5 )
        {
        send_to_char("&RYou head begins to grow.\n\r&cYou become much smarter.\n\r&YYou have just attained MegaBrain.", ch );
        xSET_BIT( ch->act, PLR_PRIMARY_MEGABRAIN );
        ch->mod_wis = 10;
        ch->mod_dex = 2;
        }
        learn_from_success( ch, gsn_primary_skill);
        return;
        }
    return;
   }
    else
    {

        send_to_char( "Train what?\n\r", ch );
        return;
    }

    if ( *pAbility >= 25  && (!str_cmp( argument, "str" ) || !str_cmp( argument, "int" ) || !str_cmp( argument, "wis" ) || !str_cmp( argument, "dex" ) || !str_cmp( argument, "con" ) || !str_cmp( argument, "cha" ) || !str_cmp( argument, "lck" ) ))  /* 25 is the max you can train a stat */

   {
        act(AT_BLUE, "Your $T is already at maximum.", ch, NULL, pOutput, TO_CHAR );
        return;
    }
    if ( cost > ch->train )
    {
        send_to_char( "You don't have enough trains.\n\r", ch );
        return;
    }

    ch->train       -= cost;
    *pAbility           += 1;
         act(AT_YELLOW, "Your $T increases!", ch, NULL, pOutput, TO_CHAR );
         act(AT_YELLOW, "$n's $T increases!", ch, NULL, pOutput, TO_ROOM );
         return;
}

char *strlinwrp(char *src, int length)
{
  int srclen,in_p,x,last_line;
  char newstr[MAX_STRING_LENGTH];
  bool looking;
    if(!length)
      length = 60;
    srclen = strlen(src);
    in_p = 0;
// STRFREE(newstr); Commented out - was just defined!
    looking = FALSE;
    for(x=0,last_line=0;x<srclen;x++,last_line++)
    {
        if(src[x] == '\r' || src[x] == '\n')
        {
            last_line = 0;
            looking = FALSE;
        }
        else if(last_line%length == 0 && x != 0)
            looking = TRUE;
        if(looking)
        {
          if(src[x] == ' ')
          {
            newstr[in_p++] = '\r';
            newstr[in_p++] = '\n';
            looking = FALSE;
            last_line = 0;
            if(src[x+1] == ' ')
              x++;
            continue;
          }
        }
        newstr[in_p++] = src[x];
    }
    newstr[in_p++] = '\r';
    newstr[in_p++] = '\n';
    newstr[in_p++] = '\0';
  return strdup( newstr );
}


char *strrep(char *src, char *sch,char *rep)
{
  int lensrc,lensch,lenrep;
  char newsrc[MAX_STRING_LENGTH];
  int x,y,in_p;
  bool searching;
    lensrc = strlen(src);
    lensch = strlen(sch);
    lenrep = strlen(rep);
    searching = FALSE;
    for(x=0,in_p=0;x<lensrc;x++,in_p++)
    {
        if(src[x] == sch[0])
        {
            searching = TRUE;
            for(y=0;y<lensch;y++)
                if(src[x+y] != sch[y])
                    searching = FALSE;
            if(searching)
            {
                for(y=0;y<lenrep;y++,in_p++)
                    newsrc[in_p] = rep[y];
                x+=lensch;
                searching = FALSE;
            }
        }
        newsrc[in_p] = src[x];
    }
    newsrc[in_p] = '\0';
  return STRALLOC( newsrc );
}

void do_learn( CHAR_DATA *ch, char *argument )
{
  CHAR_DATA *mob=NULL;
  char buf[MAX_STRING_LENGTH];
  int sn, value, gsn;
  bool can=FALSE;
  int lasttype, lasttype2;
  struct skill_type *skill;
  bool ability=FALSE;

 lasttype = SKILL_ASKILL;
 lasttype2 = SKILL_SSKILL;

  if ( IS_NPC(ch))
  {
      send_to_char( "Huh?\n\r", ch);
      return;
  }

   if (!IN_TRAIN(ch))
   {
    send_to_char( "You can't do that here.\n\r", ch );
    return;
   }

  if ( ( sn = skill_lookup( argument )) >= 0 )
//    if ( ( sn = bsearch_skill_prefix( argument ) ) >= 0 )
  {
     skill = skill_table[sn];
     if ( skill->type == lasttype )
     ability=TRUE;
     else if ( skill->type == lasttype2 )
     ability=FALSE;
     else
     {
     send_to_char( "Unknown Skill.\n\r", ch );
     return;
     }

  }
  else
  {
     send_to_char( "Unknown Skill.\n\r", ch );
     return;
  }

  if ( ability )
  {
       if ( can_userace( ch, sn ) == FALSE )
         can = FALSE;
       else
        can=TRUE;
       if ( !can )
       {
         send_to_char("You cannot learn this skill.\n\r", ch);
         return;
       }
  }

  gsn = ch->pcdata->learned[sn];

  if ( skill->teachers )
  {
        send_to_char("This cannot be practiced here.\n\r", ch);
        return;
  }

  if ( ch->practice < 1 )
  {
    send_to_char( "You don't have any practice sessions available.\n\r", ch);
    return;
  }

  if ( skill->pl && ch->exp < skill->pl )
  {
    send_to_char( "You are not strong enough.\n\r", ch);
    return;
  }
  if ( gsn > 0 )
  {
    send_to_char( "You have to train this on your own.\n\r", ch);
    return;
  }

  value = 5;
  value += get_curr_int(ch)/2;
  value = URANGE( 0, value, 20 );
  ch->pcdata->learned[sn] = value;
  ch->practice -= 1;
  ch_printf(ch,"You practice %s.\n\r", skill->name);
  act( AT_WHITE, "$n practices $T.", ch, NULL, skill->name, TO_ROOM );

}


/* void do_learn( CHAR_DATA *ch, char *argument )
{
    char arg1 [MAX_INPUT_LENGTH];
    char arg2 [MAX_INPUT_LENGTH];

   argument = one_argument(argument, arg1);
   argument = one_argument(argument, arg2);

   if (IS_NPC(ch))
   return;
   if (!IS_AWAKE(ch))
   {
    send_to_char("You aren't awake...\n\r", ch);
    return;
   }
   if ( arg1[0] == '\0' )
   {
     send_to_char( "Practice what?\n\r", ch );
     return;
   }
   if (!IN_TRAIN(ch))
   {
    send_to_char( "You can't do that here.\n\r", ch );
    return;
   }
   if ( ch->practice <= 0 )
   {
    act( AT_TELL, "You must earn some more practice sessions.", ch, NULL, NULL, TO_CHAR );
    return;
   }

   if ( !str_cmp( arg1, "barrier" ) && (IS_HALFBREED(ch) || IS_HUMAN(ch) || IS_NAMEK(ch) || IS_MUTANT (ch)))
   {
     if (ch->pcdata->learned[gsn_ebar] > 0)
     {
       send_to_char("You already know everything about Energy Barrier.\n\r", ch);
       return;
     }
     if ( ch->exp < 50000 )
     {
       send_to_char("You're not ready to learn Energy Barrier.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_ebar] = 15;
     send_to_char("You practice Energy Barrier.\n\r", ch);
     act( AT_WHITE, "$n practices Energy Barrier.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "mentalthrow" ) && (IS_ICER(ch) ))
   {
     if (ch->pcdata->learned[gsn_mentalthrow] > 0)
     {
       send_to_char("You already know everything about Mental Throw.\n\r", ch);
       return;
     }
     if ( ch->exp < 5500000 )
     {
       send_to_char("You're not ready to learn Mental Throw.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_mentalthrow] = 15;
     send_to_char("You practice Mental Throw.\n\r", ch);
     act( AT_WHITE, "$n practices Mental Throw.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "ddd" ) && (IS_ICER(ch) ))
   {
     if (ch->pcdata->learned[gsn_ddd] > 0)
     {
       send_to_char("You already know everything about Dual Destructo Disk.\n\r", ch);
       return;
     }
     if ( ch->exp < 4000000 )
     {
       send_to_char("You're not ready to learn Dual Destructo Disk.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_ddd] = 15;
     send_to_char("You practice Dual Destructo Disk.\n\r", ch);
     act( AT_WHITE, "$n practices Dual Destructo Disk.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "destructodisk" ) && (IS_ICER(ch) || IS_HUMAN(ch)))
   {
     if (ch->pcdata->learned[gsn_destructo] > 0)
     {
       send_to_char("You already know everything about Destructo Disk.\n\r", ch);
       return;
     }
     if ( ch->exp < 750000 )
     {
       send_to_char("You're not ready to learn Destructo Disk.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_destructo] = 15;
     send_to_char("You practice Destructo Disk.\n\r", ch);
     act( AT_WHITE, "$n practices Destructo Disk.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "secondattack" ))
   {
     if (ch->pcdata->learned[gsn_second_attack] > 0)
     {
       send_to_char("You already know everything about Second Attack.\n\r", ch);
       return;
     }
     if ( ch->exp < 2500000 )
     {
       send_to_char("You're not ready to learn Second Attack.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_second_attack] = 15;
     send_to_char("You practice Second Attack.\n\r", ch);
     act( AT_WHITE, "$n practices Second Attack.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "extract" ))
   {
     if (ch->pcdata->learned[gsn_extract] > 0)
     {
       send_to_char("You already know everything about Extract.\n\r", ch);
       return;
     }
     if ( ch->exp < 5000000 )
     {
       send_to_char("You're not ready to learn Extract.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_extract] = 15;
     send_to_char("You practice Extract.\n\r", ch);
     act( AT_WHITE, "$n practices Extract.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "sense" ))
   {
     if (ch->pcdata->learned[gsn_sense] > 0)
     {
       send_to_char("You already know everything about Sense.\n\r", ch);
       return;
     }
     if ( ch->exp < 500000 )
     {
       send_to_char("You're not ready to learn Sense.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_sense] = 15;
     send_to_char("You practice Sense.\n\r", ch);
     act( AT_WHITE, "$n practices Sense.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "grip" ) && (IS_ANDROID(ch) || IS_BIODROID(ch)))
   {
     if (ch->pcdata->learned[gsn_grip] > 0)
     {
       send_to_char("You already know everything about Grip.\n\r", ch);
       return;
     }
     if ( ch->exp < 1000000 )
     {
       send_to_char("You're not ready to learn Grip.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_grip] = 15;
     send_to_char("You practice Grip.\n\r", ch);
     act( AT_WHITE, "$n practices Grip.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "regenerate" ) && (IS_SAIYAN(ch) || IS_BIODROID(ch)))
   {
     if (ch->pcdata->learned[gsn_regen] > 0)
     {
       send_to_char("You already know everything about Regenerate.\n\r", ch);
       return;
     }
     if ( ch->exp < 250000 )
     {
       send_to_char("You're not ready to learn Regenerate.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_regen] = 15;
     send_to_char("You practice Regenerate.\n\r", ch);
     act( AT_WHITE, "$n practices Regenerate.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "fly" ))
   {
     if (ch->pcdata->learned[gsn_fly] > 0)
     {
       send_to_char("You already know everything about Fly.\n\r", ch);
       return;
     }
     if ( ch->exp < 50000 )
     {
       send_to_char("You're not ready to learn Fly.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_fly] = 15;
     send_to_char("You practice Fly.\n\r", ch);
     act( AT_WHITE, "$n practices Fly.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "suppress" ))
   {
     if (ch->pcdata->learned[gsn_suppress] > 0)
     {
       send_to_char("You already know everything about Suppress.\n\r", ch);
       return;
     }
     if ( ch->exp < 1000000 )
     {
       send_to_char("You're not ready to learn Suppress.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_suppress] = 15;
     send_to_char("You practice Suppress.\n\r", ch);
     act( AT_WHITE, "$n practices Suppress.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "claw" ) && (IS_MUTANT(ch)))
   {
     if (ch->pcdata->learned[gsn_claw] > 0)
     {
       send_to_char("You already know everything about Claw.\n\r", ch);
       return;
     }
     if ( ch->exp < 250000 )
     {
       send_to_char("You're not ready to learn Claw.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_claw] = 15;
     send_to_char("You practice Claw.\n\r", ch);
     act( AT_WHITE, "$n practices Claw.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "absorb" ) && (IS_BIODROID(ch) || IS_ANDROID(ch) ))
   {
     if (ch->pcdata->learned[gsn_absorb] > 0)
     {
       send_to_char("You already know everything about Absorb.\n\r", ch);
       return;
     }
     if ( ch->exp < 125000 )
     {
       send_to_char("You're not ready to learn Absorb.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_absorb] = 15;
     send_to_char("You practice Absorb.\n\r", ch);
     act( AT_WHITE, "$n practices Absorb.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "fingerbeam" ) && (IS_BIODROID(ch) || IS_ANDROID(ch) || IS_ICER(ch)))
   {
     if (ch->pcdata->learned[gsn_fingerbeam] > 0)
     {
       send_to_char("You already know everything about Fingerbeam.\n\r", ch);
       return;
     }
     if ( ch->exp < 1000000 )
     {
       send_to_char("You're not ready to learn Fingerbeam.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_fingerbeam] = 15;
     send_to_char("You practice Fingerbeam.\n\r", ch);
     act( AT_WHITE, "$n practices Fingerbeam.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "kamehameha" ) && (IS_HALFBREED(ch) || IS_SAIYAN(ch) || IS_HUMAN(ch) || IS_BIODROID(ch)))
   {
     if (ch->pcdata->learned[gsn_kame] > 0)
     {
       send_to_char("You already know everything about Kamehameha.\n\r", ch);
       return;
     }
     if ( ch->exp < 1500000 )
     {
       send_to_char("You're not ready to learn Kamehameha.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_kame] = 15;
     send_to_char("You practice Kamehameha.\n\r", ch);
     act( AT_WHITE, "$n practices Kamehameha.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "punch" ))
   {
     if (ch->pcdata->learned[gsn_punch] > 0)
     {
       send_to_char("You already know everything about Punch.\n\r", ch);
       return;
     }
     if ( ch->exp < 5000 )
     {
       send_to_char("You're not ready to learn Punch.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_punch] = 15;
     send_to_char("You practice Punch.\n\r", ch);
     act( AT_WHITE, "$n practices Punch.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "blastdoor" ))
   {
     if (ch->pcdata->learned[gsn_blastdoor] > 0)
     {
       send_to_char("You already know everything about Blastdoor.\n\r", ch);
       return;
     }
     if ( ch->exp < 5000000 )
     {
       send_to_char("You're not ready to learn Blastdoor.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_blastdoor] = 15;
     send_to_char("You practice Blastdoor.\n\r", ch);
     act( AT_WHITE, "$n practices Blastdoor.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "kick" ))
   {
     if (ch->pcdata->learned[gsn_kick] > 0)
     {
       send_to_char("You already know everything about Kick.\n\r", ch);
       return;
     }
     if ( ch->exp < 1000 )
     {
       send_to_char("You're not ready to learn Kick.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_kick] = 15;
     send_to_char("You practice Kick.\n\r", ch);
     act( AT_WHITE, "$n practices Kick.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "instanttransmission" ) )
   {
     if (ch->pcdata->learned[gsn_instant] > 0)
     {
       send_to_char("You already know everything about Instant Transmission.\n\r", ch);
       return;
     }
     if ( ch->exp < 95000000 )
     {
       send_to_char("You're not ready to learn Instant Transmission.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_instant] = 15;
     send_to_char("You practice Instant Transmission.\n\r", ch);
     act( AT_WHITE, "$n practices Instant Transmission.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "direct" ))
   {
     if (ch->pcdata->learned[gsn_direct] > 0)
     {
       send_to_char("You already know everything about Direct.\n\r", ch);
       return;
     }
     if ( ch->exp < 25000 )
     {
       send_to_char("You're not ready to learn Direct.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_direct] = 15;
     send_to_char("You practice Direct.\n\r", ch);
     act( AT_WHITE, "$n practices Direct.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "energyball" ))
   {
     if (ch->pcdata->learned[gsn_energyball] > 0)
     {
       send_to_char("You already know everything about Energy Ball.\n\r", ch);
       return;
     }
     if ( ch->exp < 25000 )
     {
       send_to_char("You're not ready to learn Energy Ball.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_energyball] = 15;
     send_to_char("You practice Energy Ball.\n\r", ch);
     act( AT_WHITE, "$n practices Energy Ball.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "energysphere" ) && (IS_SAIYAN(ch) || IS_NAMEK(ch) || IS_HALFBREED(ch) || IS_BIODROID(ch) ||IS_ANDROID(ch) || IS_MUTANT(ch) ))
   {
     if (ch->pcdata->learned[gsn_energysphere] > 0)
     {
       send_to_char("You already know everything about Energy Sphere.\n\r", ch);
       return;
     }
     if ( ch->exp < 25000 )
     {
       send_to_char("You're not ready to learn Energy Sphere.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_energysphere] = 15;
     send_to_char("You practice Energy Sphere.\n\r", ch);
     act( AT_WHITE, "$n practices Energy Sphere.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "charge" ))
   {
     if (ch->pcdata->learned[gsn_charge] > 0)
     {
       send_to_char("You already know everything about Charge.\n\r", ch);
       return;
     }
     if ( ch->exp < 25000 )
     {
       send_to_char("You're not ready to learn Charge.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_charge] = 15;
     send_to_char("You practice Charge.\n\r", ch);
     act( AT_WHITE, "$n practices Charge.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "superandroid" ) && (IS_ANDROID(ch)))
   {
     if (ch->pcdata->learned[gsn_accelerate] > 0)
     {
       send_to_char("You already know everything about Super Android.\n\r", ch);
       return;
     }
     if ( ch->exp < 5000000 )
     {
       send_to_char("You're not ready to learn Super Android.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_accelerate] = 15;
     send_to_char("You practice Super Android.\n\r", ch);
     act( AT_WHITE, "$n practices Super Android.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "eyebeam" ) && (IS_ANDROID(ch)))
   {
     if (ch->pcdata->learned[gsn_eyebeam] > 0)
     {
       send_to_char("You already know everything about Eyebeam.\n\r", ch);
       return;
     }
     if ( ch->exp < 4000000 )
     {
       send_to_char("You're not ready to learn Eyebeam.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_eyebeam] = 15;
     send_to_char("You practice Eyebeam.\n\r", ch);
     act( AT_WHITE, "$n practices Eyebeam.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "superhuman" ) && (IS_HUMAN(ch)))
   {
     if (ch->pcdata->learned[gsn_superhuman] > 0)
     {
       send_to_char("You already know everything about Superhuman.\n\r", ch);
       return;
     }
     if ( ch->exp < 2500000 )
     {
       send_to_char("You're not ready to learn Superhuman.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_superhuman] = 15;
     send_to_char("You practice Superhuman.\n\r", ch);
     act( AT_WHITE, "$n practices Superhuman.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "doublepunch" ) && (IS_HUMAN(ch)))
   {
     if (ch->pcdata->learned[gsn_doublepunch] > 0)
     {
       send_to_char("You already know everything about Doublepunch.\n\r", ch);
       return;
     }
     if ( ch->exp < 1500000 )
     {
       send_to_char("You're not ready to learn Doublepunch.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_doublepunch] = 15;
     send_to_char("You practice Doublepunch.\n\r", ch);
     act( AT_WHITE, "$n practices Doublepunch.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "doublekick" ) && (IS_HUMAN(ch)))
   {
     if (ch->pcdata->learned[gsn_doublekick] > 0)
     {
       send_to_char("You already know everything about Doublekick.\n\r", ch);
       return;
     }
     if ( ch->exp < 1500000 )
     {
       send_to_char("You're not ready to learn Doublekick.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_doublekick] = 15;
     send_to_char("You practice Doublekick.\n\r", ch);
     act( AT_WHITE, "$n practices Doublekick.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "tribeam" ) && (IS_HUMAN(ch)))
   {
     if (ch->pcdata->learned[gsn_tribeam] > 0)
     {
       send_to_char("You already know everything about Tribeam.\n\r", ch);
       return;
     }
     if ( ch->exp < 55000000 )
     {
       send_to_char("You're not ready to learn Tribeam.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_tribeam] = 15;
     send_to_char("You practice Tribeam.\n\r", ch);
     act( AT_WHITE, "$n practices Tribeam.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "masenko" ) && (IS_HALFBREED(ch)))
   {
     if (ch->pcdata->learned[gsn_masenko] > 0)
     {
       send_to_char("You already know everything about Masenko.\n\r", ch);
       return;
     }
     if ( ch->exp < 55000000 )
     {
       send_to_char("You're not ready to learn Masenko.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_masenko] = 15;
     send_to_char("You practice Masenko.\n\r", ch);
     act( AT_WHITE, "$n practices Masenko.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "splitform" ) && (IS_NAMEK(ch)))
   {
     if (ch->pcdata->learned[gsn_split] > 0)
     {
       send_to_char("You already know everything about Split Form.\n\r", ch);
       return;
     }
     if ( ch->exp < 500000 )
     {
       send_to_char("You're not ready to learn Split Form.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_split] = 15;
     send_to_char("You practice Split Form.\n\r", ch);
     act( AT_WHITE, "$n practices Split Form.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "heal" ) && (IS_NAMEK(ch) || IS_BIODROID(ch)))
   {
     if (ch->pcdata->learned[gsn_heal] > 0)
     {
       send_to_char("You already know everything about Heal.\n\r", ch);
       return;
     }
     if ( ch->exp < 100000 )
     {
       send_to_char("You're not ready to learn Heal.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_heal] = 15;
     send_to_char("You practice Heal.\n\r", ch);
     act( AT_WHITE, "$n practices Heal.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "sbc" ) && (IS_NAMEK(ch) || IS_BIODROID(ch)))
   {
     if (ch->pcdata->learned[gsn_sbc] > 0)
     {
       send_to_char("You already know everything about Special Beam Cannon.\n\r", ch);
       return;
     }
     if ( ch->exp < 5000000 )
     {
       send_to_char("You're not ready to learn Special Beam Cannon.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_sbc] = 15;
     send_to_char("You practice Special Beam Cannon.\n\r", ch);
     act( AT_WHITE, "$n practices Special Beam Cannon.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "aid" ))
   {
     if (ch->pcdata->learned[gsn_aid] > 0)
     {
       send_to_char("You already know everything about Aid.\n\r", ch);
       return;
     }
     if ( ch->exp < 1000 )
     {
       send_to_char("You're not ready to learn Aid.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_aid] = 15;
     send_to_char("You practice Aid.\n\r", ch);
     act( AT_WHITE, "$n practices Aid.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "blast" ))
   {
     if (ch->pcdata->learned[gsn_blast] > 0)
     {
       send_to_char("You already know everything about Blast.\n\r", ch);
       return;
     }
     if ( ch->exp < 5000000 )
     {
       send_to_char("You're not ready to learn Blast.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_blast] = 15;
     send_to_char("You practice Blast.\n\r", ch);
     act( AT_WHITE, "$n practices Blast.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "galicgun" ) && IS_SAIYAN(ch))
   {
     if (ch->pcdata->learned[gsn_galicgun] > 0)
     {
       send_to_char("You already know everything about Galic Gun.\n\r", ch);
       return;
     }
     if ( ch->exp < 85000000 )
     {
       send_to_char("You're not ready to learn Galic Gun.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_galicgun] = 15;
     send_to_char("You practice Galic Gun.\n\r", ch);
     act( AT_WHITE, "$n practices Galic Gun.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "scatter" ) && (IS_NAMEK(ch) || IS_MUTANT(ch)))
   {
     if (ch->pcdata->learned[gsn_scattershot] > 0)
     {
       send_to_char("You already know everything about Scattershot.\n\r", ch);
       return;
     }
     if ( ch->exp < 55000000 )
     {
       send_to_char("You're not ready to learn Scattershot.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_scattershot] = 15;
     send_to_char("You practice Scattershot.\n\r", ch);
     act( AT_WHITE, "$n practices Scattershot.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "secondaryskill" ) && (IS_MUTANT(ch)))
   {
     if (ch->pcdata->learned[gsn_secondary_skill] > 0)
     {
       send_to_char("You already know everything about Secondary Skill.\n\r", ch);
       return;
     }
     if ( ch->exp < 85000000 )
     {
       send_to_char("You're not ready to learn Secondary Skill.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_secondary_skill] = 15;
     send_to_char("You practice Secondary Skill.\n\r", ch);
     act( AT_WHITE, "$n practices Secondary Skill.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "primarytechnique" ) && (IS_BIODROID(ch)))
   {
     if (ch->pcdata->learned[gsn_primaryattack] > 0)
     {
       send_to_char("You already know everything about Primary Technique.\n\r", ch);
       return;
     }
     if ( ch->exp < 70000000 )
     {
       send_to_char("You're not ready to learn Primary Technique.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_primaryattack] = 15;
     send_to_char("You practice Primary Technique.\n\r", ch);
     act( AT_WHITE, "$n practices Primary Technique.", ch, NULL, NULL, TO_ROOM );
   }
   else if ( !str_cmp( arg1, "primaryskill" ) && (IS_MUTANT(ch)))
   {
     if (ch->pcdata->learned[gsn_primary_skill] > 0)
     {
       send_to_char("You already know everything about Primary skill.\n\r", ch);
       return;
     }
     if ( ch->exp < 1500000 )
     {
       send_to_char("You're not ready to learn Primary Skill.\n\r", ch);
       return;
     }
     ch->pcdata->learned[gsn_primary_skill] = 15;
     send_to_char("You practice Primary Skill.\n\r", ch);
     act( AT_WHITE, "$n practices Primary Skill.", ch, NULL, NULL, TO_ROOM );
   }
   else
   {
    send_to_char("You're not ready to learn that yet.\n\r", ch);
    return;
   }
  ch->practice -= 1;
} */

/* void do_practice( CHAR_DATA *ch, char *argument )
{
    char              arg1[MAX_INPUT_LENGTH];

   if ( IS_NPC(ch) )
     return;

   argument = one_argument( argument, arg1 );

   if ( arg1[0] == '\0' )
   {
     ch_printf( ch,"\n\r&z------------------------------[ &wSkills&z ]------------------------------\n\r");
     ch_printf( ch,"\n\r  &cChikara 1  &z[&w%3d&W%%&z]  &c        Chikara 2 &z[&w%3d&W%%&z]&c        Chikara 3 &z[&w%3d&W%%&z]", ch->pcdata->learned[gsn_chikone], ch->pcdata->learned[gsn_chiktwo], ch->pcdata->learned[gsn_chikthree] );
     ch_printf( ch,"\n\r  &cChikara 4  &z[&w%3d&W%%&z]  &c           Charge &z[&w%3d&W%%&z]&c", ch->pcdata->learned[gsn_chikfour], ch->pcdata->learned[gsn_charge] );
     ch_printf( ch,"\n\r  &c    Sense  &z[&w%3d&W%%&z]  &c    Second Attack &z[&w%3d&W%%&z]&c           Direct &z[&w%3d&W%%&z]", ch->pcdata->learned[gsn_sense], ch->pcdata->learned[gsn_second_attack], ch->pcdata->learned[gsn_direct] );
     ch_printf( ch,"\n\r  &c     Kick  &z[&w%3d&W%%&z]  &c            Punch &z[&w%3d&W%%&z]&c            Blast &z[&w%3d&W%%&z]", ch->pcdata->learned[gsn_kick], ch->pcdata->learned[gsn_punch], ch->pcdata->learned[gsn_blast] );
     ch_printf( ch,"\n\r  &c      Aid  &z[&w%3d&W%%&z]  &c         Suppress &z[&w%3d&W%%&z]&c              Fly &z[&w%3d&W%%&z]", ch->pcdata->learned[gsn_aid], ch->pcdata->learned[gsn_suppress], ch->pcdata->learned[gsn_fly]);
     ch_printf( ch,"\n\r  &c       IT  &z[&w%3d&W%%&z]  &c        Blastdoor &z[&w%3d&W%%&z]&c          Extract &z[&w%3d&W%%&z]&c", ch->pcdata->learned[gsn_instant], ch->pcdata->learned[gsn_blastdoor], ch->pcdata->learned[gsn_extract] );
     ch_printf( ch,"\n\r  &cEnergyball &z[&w%3d&W%%&z]  &cBattle Experience &z[&w%3d&W%%&z]&c", ch->pcdata->learned[gsn_energyball], ch->pcdata->learned[gsn_be] );
     ch_printf( ch,"\n\r");
     ch_printf( ch,"\n\r&z-----------------------------[ &wAbilities&z ]-----------------------------\n\r");
    if (IS_BIODROID(ch))
    {
     ch_printf( ch,"\n\r &c       SBC &z[&w%3d&W%%&z]&c        PrimaryTech &z[&w%3d&W%%&z]&c", ch->pcdata->learned[gsn_sbc], ch->pcdata->learned[gsn_primaryattack] );
     ch_printf( ch,"\n\r &c      Heal &z[&w%3d&W%%&z]&c         Kamehameha &z[&w%3d&W%%&z]&c       Fingerbeam &z[&w%3d&W%%&z]", ch->pcdata->learned[gsn_heal], ch->pcdata->learned[gsn_kame], ch->pcdata->learned[gsn_fingerbeam] );
     ch_printf( ch,"\n\r &c    Absorb &z[&w%3d&W%%&z]&c         Regenerate &z[&w%3d&W%%&z]&c             Grip &z[&w%3d&W%%&z]", ch->pcdata->learned[gsn_absorb], ch->pcdata->learned[gsn_regen], ch->pcdata->learned[gsn_grip] );
    }
    else if (IS_ANDROID(ch))
    {
     ch_printf( ch,"\n\r&c Fingerbeam &z[&w%3d&W%%&z]&c      
Super Android &z[&w%3d&W%%&z]     &cGrip &z[&w%3d&W%%&z]", ch->pcdata->learned[gsn_fingerbeam], ch->pcdata->learned[gsn_accelerate], ch->pcdata->learned[gsn_grip] );
     ch_printf( ch,"\n\r&c     Absorb &z[&w%3d&W%%&z]&c            Eyebeam &z[&w%3d&W%%&z]", ch->pcdata->learned[gsn_absorb], ch->pcdata->learned[gsn_eyebeam] );
    }
    else if (IS_HALFBREED(ch))
    {
     ch_printf( ch,"\n\r&c    Masenko &z[&w%3d&W%%&z] &c        Kamehameha &z[&w%3d&W%%&z]&c     Energy Barrier &z[&w%d&w%%&z]", ch->pcdata->learned[gsn_masenko], ch->pcdata->learned[gsn_kame], ch->pcdata->learned[gsn_ebar] );
     ch_printf( ch,"\n\r&c     Mystic &z[&w%3d&W%%&z] &c           Kaioken &z[&w%3d&W%%&z]", ch->pcdata->learned[gsn_mystic], ch->pcdata->learned[gsn_kaioken] );
    }
    else if (IS_HUMAN(ch))
    {
     ch_printf( ch,"\n\r&c    Tribeam &z[&w%3d&W%%&z]&c        Doublepunch &z[&w%3d&W%%&z]&c       Doublekick &z[&w%3d&W%%&z]", ch->pcdata->learned[gsn_tribeam], ch->pcdata->learned[gsn_doublepunch], ch->pcdata->learned[gsn_doublekick] );
     ch_printf( ch,"\n\r&cEnergy Disk &z[&w%3d&W%%&z]&c     Energy Barrier &z[&w%3d&W%%&z]&c      Super Human &z[&w%3d&W%%&z]", ch->pcdata->learned[gsn_destructo], ch->pcdata->learned[gsn_ebar], ch->pcdata->learned[gsn_superhuman] );
     ch_printf( ch,"\n\r&cKamehameha  &z[&w%3d&W%%&z]&c", ch->pcdata->learned[gsn_kame] ); 
    }
    else if (IS_ICER(ch))
    {
     ch_printf( ch,"\n\r&c Fingerbeam &z[&w%3d&W%%&z]&c Dual Destructo Dis &z[&w%3d&W%%&z]&c Red Destructo Disk &z[&w%3d&W%%&z]", ch->pcdata->learned[gsn_fingerbeam], ch->pcdata->learned[gsn_ddd], ch->pcdata->learned[gsn_destructo] );
     ch_printf( ch,"\n\r&c       Tail &z[&w%3d&W%%&z]&c       Mental Throw&z [&w%3d&W%%&z]", ch->pcdata->learned[gsn_claw], ch->pcdata->learned[gsn_mentalthrow] );
    }
    else if (IS_NAMEK(ch))
    {
     ch_printf( ch,"\n\r&c       Heal &z[&w%3d&W%%&z]&c        Scattershot &z[&w%3d&W%%&z]&c   Energy Barrier &z[&w%3d&W%%&z]", ch->pcdata->learned[gsn_heal], ch->pcdata->learned[gsn_scattershot], ch->pcdata->learned[gsn_ebar] );
     ch_printf( ch,"\n\r&c        SBC &z[&w%3d&W%%&z]&c      Energy Sphere &z[&w%3d&W%%&z]&c       Split Form &z[&w%3d&W%%&z]&c", ch->pcdata->learned[gsn_sbc], ch->pcdata->learned[gsn_energysphere], ch->pcdata->learned[gsn_split] );
    }
    else if (IS_MUTANT(ch))
    {
     ch_printf( ch,"\n\r&c       Claw &z[&w%3d&W%%&z]&c       Scattershot &z[&w%3d&W%%&z]&c    Primary Skill &z[&w%3d&W%%&z]&R", ch->pcdata->learned[gsn_claw], ch->pcdata->learned[gsn_scattershot], ch->pcdata->learned[gsn_primary_skill] );
     ch_printf( ch,"\n\r&cEnergy Barrier &z[&w%3d&W%%&z]&c Secondary Skill &z[&w%3d&W%%&z]&c", ch->pcdata->learned[gsn_ebar], ch->pcdata->learned[gsn_secondary_skill] );
    }
    else if (IS_SAIYAN(ch))
    {
     ch_printf( ch,"\n\r&c    Kaioken &z[&w%3d&W%%&z]&c         Kamehameha &z[&w%3d&W%%&z]&c       Regenerate &z[&w%3d&W%%&z]", ch->pcdata->learned[gsn_kaioken], ch->pcdata->learned[gsn_kame], ch->pcdata->learned[gsn_regen] );
     ch_printf( ch,"\n\r&c  Galic Gun &z[&w%3d&W%%&z]", ch->pcdata->learned[gsn_galicgun] );
    }
     ch_printf( ch,"\n\r\n\r&z-----------------------------------------------------------------------\n\r");
     ch_printf( ch,"&wYou have &z%d&w practice sessions left.\n\r", ch->practice);
     ch_printf( ch,"&wYou have &z%d&w attribute training sessions left.\n\r", ch->train);
   }
  else
   {
     do_learn(ch, arg1);
     return;
   }
} */

void do_practice( CHAR_DATA *ch, char *argument )
{
   int sn, col, col2;
   col = col2 = 0;
   if ( IS_NPC(ch))
   {
      send_to_char( "Huh?\n\r", ch);
      return;
   }
   if ( argument[0] == '\0' )
   {
     ch_printf( ch,"\n\r&B-----------------------------------[ &wSkills&B &B]----------------------------------&w\n\r\n\r");
     for ( sn = 0; sn < top_sn; sn++ )
     {
        sh_int lasttype;

        lasttype = SKILL_SSKILL;

          if ( skill_table[sn]->type != lasttype )
          continue;

      if ( skill_table[sn]->name )
      {
       col++;
       ch_printf(ch, " &B%17.17s  &w%3d%%", skill_table[sn]->name, ch->pcdata->learned[sn] );
      }

      if ( col >= 3 )
      {
       ch_printf(ch, "\n\r");
       col = 0;
       }
     }
     ch_printf( ch,"\n\r\n\r&B---------------------------------[ &wAbilities &B]---------------------------------&w\n\r\n\r");
/*     for ( sn = 0; sn < top_sn; sn++ )
     {
      if ( col2 >= 3 )
      {
       ch_printf(ch, "\n\r");
       col2 = 0;
      }

      if ( skill_table[sn]->name )
      {
       if ( can_userace( ch, sn ) == FALSE )
       continue;
       col2++;
       ch_printf(ch, " &B%17.17s  &w%3d%%", skill_table[sn]->name, ch->pcdata->learned[sn] );
      }
     } */
     for ( sn = 0; sn < top_sn; sn++ )
     {
        sh_int lasttype3;

        lasttype3 = SKILL_ASKILL;

          if ( skill_table[sn]->type != lasttype3 )
          continue;

      if ( skill_table[sn]->name )
      {
       if ( can_userace( ch, sn ) == FALSE )
       continue;

       col++;
       ch_printf(ch, " &B%17.17s  &w%3d%%", skill_table[sn]->name, ch->pcdata->learned[sn] );
      }

      if ( col >= 3 )
      {
       ch_printf(ch, "\n\r");
       col = 0;
       }
     }
/*     ch_printf( ch,"\n\r\n\r&B----------------------------------[ &wRacial 
&B]-----------------------------------&w\n\r\n\r");
     for ( sn = 0; sn < top_sn; sn++ )
     {
        sh_int lasttype2;

        lasttype2 = SKILL_RSKILL;

          if ( skill_table[sn]->type != lasttype2 )
          continue;

       if ( can_usepl( ch, sn ) == FALSE )
       continue;

      if ( skill_table[sn]->name )
      {
       col++;
       ch_printf(ch, " &B%17.17s", skill_table[sn]->name );
      }

      if ( col >= 3 )
      {
       ch_printf(ch, "\n\r");
       col = 0;
       }
     } */
     ch_printf( ch,"\n\r\n\r&B-------------------------------------------------------------------------------\n\r");
     ch_printf( ch,"&BYou have &w%d &Battribute training sessions left.\n\r", ch->train);
     ch_printf( ch,"&BYou have &w%d&B practice sessions left.\n\r", ch->practice);
   }
   else
   {
     do_learn(ch, argument);
     return;
   }

}

void do_cuttail( CHAR_DATA *ch, char *argument)
{

   if (!xIS_SET(ch->act, PLR_TAIL))
   {
    send_to_char( "You don't have a tail.\n\r", ch );
    return;
   }
   if (IS_ICER(ch))
   {
    send_to_char( "You can't do that to your tail.\n\r", ch );
    return;
   }

   if (ch->position == POS_RESTING || ch->position == POS_SITTING )
   {
    send_to_char( "Stand up first.\n\r", ch);
    return;
   }
   if (!IS_AWAKE(ch))
   {
    send_to_char( "You're sleeping!\n\r", ch);
    return;
   }
   send_to_char("You grab ahold of your tail and rip it out!\n\r", ch);
   act(AT_RED,"$n grabs ahold of there tail and rips it out!", ch, NULL, NULL, TO_CANSEE);
   xREMOVE_BIT(ch->act, PLR_TAIL);

   if (xIS_SET(ch->act, PLR_OOZARU))
   {
    send_to_char("As you cut your tail, you lose your power of Oozaru!\n\r", ch);
    act(AT_RED,"As $n finishes ripping there tail off as they lose there Oozaru transformation!", ch, NULL, NULL,TO_CANSEE);
    ch->mod = 1;
    ch->height_mod = 0;
    ch->weight_mod = 0;
    ch->mod_str = 0;
    ch->mod_dex = 0;
    ch->mod_lck = 0;
    ch->mod_int = 0;
    xREMOVE_BIT(ch->act, PLR_OOZARU);
    return;
}
}



void do_growtail( CHAR_DATA *ch, char *argument )
{
 if (CAN_TAIL(ch))
 {
  if (!xIS_SET(ch->act, PLR_TAIL))
  {
   xSET_BIT(ch->act, PLR_TAIL);
   send_to_char( "&OYour tail grows back.&D\n\r", ch);
  }
 }
}

bool not_transformed(CHAR_DATA *ch)
{
   if( IS_NPC(ch) ) return FALSE;

if(xIS_SET( ch->act,  PLR_USSJ ) ) return FALSE;
if(xIS_SET( ch->act,  PLR_MUTATE2 ) ) return FALSE;
if(xIS_SET( ch->act,  PLR_MUTATE3) ) return FALSE;
if(xIS_SET( ch->act,  PLR_MUTATE4) ) return FALSE;
if(xIS_SET( ch->act,  PLR_SNAMEK) ) return FALSE;
if(xIS_SET( ch->act,  PLR_OOZARU) ) return FALSE;
if(xIS_SET( ch->act,  PLR_MYSTIC) ) return FALSE;
if(xIS_SET( ch->act,  PLR_KAIOKEN) ) return FALSE;
if(xIS_SET( ch->act,  PLR_SSJ1) ) return FALSE;
if(xIS_SET( ch->act,  PLR_SSJ2) ) return FALSE;
if(xIS_SET( ch->act,  PLR_SSJ3) ) return FALSE;
if(xIS_SET( ch->act,  PLR_SSJ4) ) return FALSE;
if(xIS_SET( ch->act,  PLR_TRANSFORM2) ) return FALSE;
if(xIS_SET( ch->act,  PLR_TRANSFORM3 ) ) return FALSE;
if(xIS_SET( ch->act,  PLR_TRANSFORM4) ) return FALSE;
if(xIS_SET( ch->act,  PLR_TRANSFORM5) ) return FALSE;

return TRUE;
}

void do_powerdown(CHAR_DATA* ch, char* argument)
{
     char pdown_msg[256] = "&BYou close your eyes and release your breath as your aura fades and your incredible strength returns to normal.\n\r ";

     if(IS_NPC(ch)) return;

     if(!IS_AWAKE(ch))
     {
          send_to_char("You're asleep...\n\r", ch);
          return;
     }
     if(xIS_SET(ch->act, PLR_POWERUP7))
     {
          send_to_char(pdown_msg, ch);
          xREMOVE_BIT(ch->act, PLR_POWERUP7);
          ch->mod = 1;
          return;
     }
     if(xIS_SET(ch->act, PLR_POWERUP6))
     {
          send_to_char(pdown_msg, ch);
          xREMOVE_BIT(ch->act, PLR_POWERUP6);
          ch->mod = 1;
          return;
     }
     if(xIS_SET(ch->act, PLR_POWERUP5))
     {
          send_to_char(pdown_msg, ch);
          xREMOVE_BIT(ch->act, PLR_POWERUP5);
          ch->mod = 1;
          return;
     }
     if(xIS_SET(ch->act, PLR_POWERUP4))
     {
          send_to_char(pdown_msg, ch);
          xREMOVE_BIT(ch->act, PLR_POWERUP4);
          ch->mod = 1;
          return;
     }
     if(xIS_SET(ch->act, PLR_POWERUP3))
     {
          send_to_char(pdown_msg, ch);
          xREMOVE_BIT(ch->act, PLR_POWERUP3);
          ch->mod = 1;
          return;
     }
     if(xIS_SET(ch->act, PLR_POWERUP2))
     {
          send_to_char(pdown_msg, ch);
          xREMOVE_BIT(ch->act, PLR_POWERUP2);
          ch->mod = 1;
          return;
     }
     if(xIS_SET(ch->act, PLR_POWERUP1))
     {
          send_to_char(pdown_msg, ch);
          xREMOVE_BIT(ch->act, PLR_POWERUP1);
          ch->mod = 1;
          return;
     }
     if(xIS_SET(ch->act, PLR_ACCELERATE))
     {
          send_to_char(pdown_msg, ch);
          xREMOVE_BIT(ch->act, PLR_ACCELERATE);
          ch->mod = 1;
          ch->mod_str = 0;
          ch->mod_dex = 0;
          ch->mod_int = 0;
          ch->mod_lck = 0;
          ch->mod_con = 0;
          ch->mod_lck = 0;
          return;
     }

     send_to_char("You're not powered up.\n\r", ch);
}

OBJ_DATA *carrying_dball( CHAR_DATA *ch )
{
    OBJ_DATA *obj, *obj_next;
    for( obj = ch->first_carrying; obj != NULL ; obj = obj_next )
    {
        obj_next = obj->next_content;
        if( obj->item_type == ITEM_DRAGONBALL )
        {
            return obj;
        }
    }
    return NULL;
}

bool seven_dballs_here( CHAR_DATA *ch, char *planet )
{
    OBJ_DATA *obj;
    bool onestar = FALSE;
    bool twostar = FALSE;
    bool threestar = FALSE;
    bool fourstar = FALSE;
    bool fivestar = FALSE;
    bool sixstar = FALSE;
    bool sevenstar = FALSE;

    if( !str_cmp(planet,"earth") )
    {
        if( (obj = get_obj_vnum_room(ch,51)) != NULL )
          onestar = TRUE;
        if( (obj = get_obj_vnum_room(ch,52)) != NULL )
          twostar = TRUE;
        if( (obj = get_obj_vnum_room(ch,53)) != NULL )
          threestar = TRUE;
        if( (obj = get_obj_vnum_room(ch,54)) != NULL )
          fourstar = TRUE;
        if( (obj = get_obj_vnum_room(ch,55)) != NULL )
          fivestar = TRUE;
        if( (obj = get_obj_vnum_room(ch,56)) != NULL )
          sixstar = TRUE;
        if( (obj = get_obj_vnum_room(ch,57)) != NULL )
          sevenstar = TRUE;

        if( onestar && twostar && threestar && fourstar &&
            fivestar && sixstar && sevenstar )
          return TRUE;
        else
          return FALSE;
    }

    return FALSE;
}

void do_grant( CHAR_DATA *ch, char *argument )
{
    char buf[MAX_STRING_LENGTH];

    if( IS_NPC(ch) )
        return;

    if( summon_state != SUMMON_NONE1 )
     {
        ch_printf(ch,"How can you make a wish without the Eternal Dragon summoned?\n\r");
        return;
    }

    if( argument[0] == '\0' )
    {
        ch_printf(ch,"\n\rSyntax: grant (option)\n\r");
        ch_printf(ch,"\n\rOption has to be one of the following:\n\r");
        ch_printf(ch,"gold power bless\n\r");
        return;
    }

    if( !str_cmp(argument,"finish") )
    {
        summon_state = SUMMON_LEAVE1;
        return;
    }

    else if( !str_cmp(argument,"gold") )
    {
        ch->gold += 4000000;
        sprintf( buf, "&z[&WDBZU&z]&C %s&W has wished for wealth!&D", ch->name );
        talk_info( AT_BLUE, buf );
        summon_state = SUMMON_LEAVE1;
        return;
    }

    else if( !str_cmp(argument,"power") )
    {
        ch->exp += ch->exp / 25;
        sprintf( buf, "&z[&WDBZU&z]&C %s&W has wished for power!&D", ch->name );
        talk_info( AT_BLUE, buf );
        summon_state = SUMMON_LEAVE1;
        return;
    }

    else if( !str_cmp(argument,"bless") )
    {
        ch->pcdata->quest_curr += 2;
        ch->pcdata->quest_accum += 2;
        sprintf( buf, "&z[&WDBZU&z]&C %s&W has wished to be blessed by the gods!&D", ch->name );
        talk_info( AT_BLUE, buf );
        summon_state = SUMMON_LEAVE1;
        return;
    }

/*    else if( !str_cmp(argument,"spacepod") )
    {
        sprintf( buf, "&z[&WDBZU&z]&C %s&W has wished to have a personal spacepod!&D", ch->name );
        talk_info( AT_BLUE, buf );
        summon_state = SUMMON_LEAVE1;
        return;
    } */

    return;
}

void do_dragonball( CHAR_DATA *ch, char *argument )
{
  CHAR_DATA *vch;
  CHAR_DATA *vch_next;
  char buf[MAX_STRING_LENGTH];
   int value;
   char arg[MAX_STRING_LENGTH];
   argument = one_argument( argument, arg );

   if ( arg[0] == '\0' )
   {
      send_to_char("\n\r&wSyntax: Handle <field> <value>\n\r", ch);
      send_to_char("  Field being one of:\n\r\n\r", ch);
      send_to_char("  db, db2, db3, kitimer, mobileupdate, search_boost, reset_sector,\n\r", ch);
      send_to_char("  add_income, scatter, start_ctf, end_ctf, start_koth, end_koth, find_fighters, moonphase,\n\r", ch);
      send_to_char("  space_update, moon_update, char_update, db_update, time_update,\n\r", ch);
      send_to_char("  shuttle_update, webclan, webwho, webwizlist, webchanges\n\r", ch);

      return;
   }

   if (!str_cmp(arg, "time_update"))
   {
     time_update();
     ch_printf( ch, "\n\rUpdating Time...&w\n\r");
     return;
   }

   if (!str_cmp(arg, "demoon"))
   {
        for ( vch = first_char; vch; vch = vch_next )
        {
            vch_next = vch->next;

            if ( !IS_NPC( vch ) )
            {
               if ( ( IS_SAIYAN(vch) || IS_HALFBREED(vch) ) && xIS_SET(vch->act, PLR_OOZARU) )
               untransform_oozaru(vch);
            }
        }
      moon_state = MOON_NONE;
     ch_printf( ch, "\n\rArtificial moon destroyed.&w\n\r");
        sprintf( buf, "&z[&WDBZU&z]&C %s&W sends a ki blast at the moon, destroying it!!!!&D", ch->name );
        talk_info( AT_BLUE, buf );
     return;
   }

   if (!str_cmp(arg, "moon"))
   {
        for ( vch = first_char; vch; vch = vch_next )
        {
            vch_next = vch->next;

            if ( !IS_NPC( vch ) )
            {
               if ( ( IS_SAIYAN(vch) || IS_HALFBREED(vch) ) && !xIS_SET(vch->act, PLR_OOZARU) )
               transform_oozaru(vch);
            }
        }
        moon_state = MOON_FULL;
        sprintf( buf, "&z[&WDBZU&z]&C %s&W throws a glowing ball of light into the sky!&D", ch->name );
        talk_info( AT_BLUE, buf );
     ch_printf( ch, "\n\rArtificial moon created.&w\n\r");
     return;
   }

   if (!str_cmp(arg, "doublegains"))
   {

        if ( game_state == GAME_DOUBLE )
        {
        game_state = GAME_NONE;
        sprintf( buf, "&z[&WDBBZV&z]&w %s&W pulls the plug on the PL machine!&D",ch->name );
        talk_info( AT_BLUE, buf );
        ch_printf( ch, "\n\rPL gains now set to single.&w\n\r");
        return;
        }
        game_state = GAME_DOUBLE;
        sprintf( buf, "&z[&WDBBZV&z]&w %s&W inserts a coin into the nearest PL machine, your gains have doubled!&D", ch->name );
        talk_info( AT_BLUE, buf );
        ch_printf( ch, "\n\rPL gains now doubled.&w\n\r");
        return;
   }

   if (!str_cmp(arg, "stunwars"))
   {

        if ( game_state == GAME_STUNWARS )
        {
        game_state = GAME_NONE;
        sprintf( buf, "&z[&WDBZU&z]&C STUNWARS has officially ended! Players stuncounters have been reset!&D" );
        talk_info( AT_BLUE, buf );
        ch_printf( ch, "\n\rStunwars Ends. Players stuncounters have been reset!&w\n\r");
        for ( vch = first_char; vch; vch = vch_next )
        {
            vch_next = vch->next;

            if ( !IS_NPC( vch ) )
            {
               vch->stuns = 0;
            }
        }

        return;
        }
        game_state = GAME_STUNWARS;
        sprintf( buf, "&z[&WDBZU&z]&C A Game of STUNWARS has begun!&D" );
        talk_info( AT_BLUE, buf );
        ch_printf( ch, "\n\rStunwars Begins.&w\n\r");
        return;
   }

   if (!str_cmp(arg, "char_update"))
   {
     char_update();
     ch_printf( ch, "\n\rUpdating in MUD characters...&w\n\r");
     return;
   }

}

char *itoa(int foo)
{
  static char bar[256];

  sprintf(bar,"%d",foo);
  return(bar);
}
void add_letter( char *string, char letter)
{
  char buf[MAX_INPUT_LENGTH];

  sprintf(buf, "%c", letter);
  strcat(string, buf);
  return;
}


char *number_sign( char *txt, int num )
{
  static char newstring[MAX_INPUT_LENGTH];
  int i;

  if ( !txt)
    return "";

  newstring[0] = '\0';
  for ( i = 0; txt[i] != '\0'; i++ )
  {
     if (txt[i] == '#')
       strcat(newstring, itoa(num));
     else
      add_letter(newstring, txt[i]);
  }
  return newstring;
}

void do_loop( CHAR_DATA *ch, char *argument)
{
    char arg[MAX_INPUT_LENGTH];
    int start, stop, x;

    if ( argument[0] == '\0' )
    {
        send_to_char( "Syntax: loop <start> <end> <command>   \n\r", ch );
        return;
    }
    argument = one_argument( argument, arg );

    if ( (start = atoi(arg)) < 0)
    {
      if (!is_number(arg))
      return;

        send_to_char( "You must start on a zero or higher.\n\r", ch );
        return;
    }
    argument = one_argument( argument, arg );

    if ((stop= atoi(arg)) <= start)
    {
      if (!is_number(arg))
      return;
        ch_printf( ch, "You must stop at a point higher than you've started. %d is %s than %d.\n\r", stop, stop == start ? "equal to" : "less than", start );
        return;
    }

    for ( x = start; x <= stop; x++ )
     interpret( ch, number_sign(argument, x) );
}


void do_dbscatter( CHAR_DATA *ch , char *argument )
{
    char arg1[MAX_INPUT_LENGTH];
    char arg2[MAX_INPUT_LENGTH];
    char arg3[MAX_INPUT_LENGTH];
    char buf[MAX_STRING_LENGTH];
    CHAR_DATA *victim;
    AREA_DATA *tarea;
    int count, created;
    bool found=FALSE;
    MOB_INDEX_DATA *pMobIndex;
    OBJ_INDEX_DATA *pObjIndex;
    ROOM_INDEX_DATA *location;
    ROOM_INDEX_DATA *location2;
    ROOM_INDEX_DATA *location3;
    ROOM_INDEX_DATA *location4;
    ROOM_INDEX_DATA *location5;
    ROOM_INDEX_DATA *location6;
    ROOM_INDEX_DATA *location7;
    OBJ_DATA *obj;
    
    int set1, set2;

    argument = one_argument( argument, arg1 );
    argument = one_argument( argument, arg2 );
    count = atoi( arg2 );
    if ( arg1[0] == '\0' )
    {
	send_to_char( "dbscatter <area>\n\r", ch );
	return;
    }
    for ( tarea = first_area; tarea; tarea = tarea->next )
	if ( !str_cmp( tarea->filename, arg1 ) )
	{
	  found = TRUE;
	  break;
	}

    if ( !found )
    {
	send_to_char( "Area not found.\n\r", ch );
	return;
    }

    if ( found )
    {

        set1 = tarea->low_r_vnum;
        set2 = tarea->hi_r_vnum;


/*        obj = create_object( get_obj_index(51), 1 );
        location = get_room_index( number_range(set1, set2) );
        if ( location == NULL )
        return;
        obj_to_room( obj, location );
        obj = create_object( get_obj_index(52), 1 );
        location2 = get_room_index( number_range(set1, set2) );
        obj_to_room( obj, location2 );
        obj = create_object( get_obj_index(53), 1 );
        location3 = get_room_index( number_range(set1, set2) );
        obj_to_room( obj, location3 );
        obj = create_object( get_obj_index(54), 1 );
        location4 = get_room_index( number_range(set1, set2 ) );
        obj_to_room( obj, location4 );
        obj = create_object( get_obj_index(55), 1 );
        location5 = get_room_index(number_range(set1, set2) );
        obj_to_room( obj, location5 );
        obj = create_object( get_obj_index(56), 1 );
        location6 = get_room_index(number_range( set1, set2) );
        obj_to_room( obj, location6 );
        obj = create_object( get_obj_index(57), 1 );
        location7 = get_room_index(number_range(set1, set2) );
        obj_to_room( obj, location7 ); */

        location = get_room_index( number_range(set1, set2) );
        location2 = get_room_index( number_range(set1, set2) );
        location3 = get_room_index( number_range(set1, set2) );
        location4 = get_room_index( number_range(set1, set2 ) );
        location5 = get_room_index(number_range(set1, set2) );
        location6 = get_room_index(number_range( set1, set2) );
        location7 = get_room_index(number_range(set1, set2) );

        if ( location == NULL )
        {
        send_to_char( "FATAL ERROR: Contact Cell, area needs to be fixed!\n\r", ch );
        return;
        }        
        if ( location2 == NULL )
        {
        send_to_char( "FATAL ERROR: Contact cell, area needs to be fixed!\n\r", ch );
        return;
        }
        if ( location3 == NULL )
        {
        send_to_char( "FATAL ERROR: Contact Cell, area needs to be fixed!\n\r", ch );
        return;
        }
        if ( location4 == NULL )
        {
        send_to_char( "FATAL ERROR: Contact Cell, area needs to be fixed!\n\r", ch );
        return;
        }
        if ( location5 == NULL )
        {
        send_to_char( "FATAL ERROR: Contact Cell, area needs to be fixed!\n\r", ch );
        return;
        }
        if ( location6 == NULL )
        {
        send_to_char( "FATAL ERROR: Contact Cell, area needs to be fixed!\n\r", ch );
        return;
        }
        if ( location7 == NULL )
        {
        send_to_char( "FATAL ERROR: Contact Cell, area needs to be fixed!\n\r", ch );
        return;
        }

        obj = create_object( get_obj_index(51), 1 );
        obj_to_room( obj, location );
        obj = create_object( get_obj_index(52), 1 );
        obj_to_room( obj, location2 );
        obj = create_object( get_obj_index(53), 1 );
        obj_to_room( obj, location3 );
        obj = create_object( get_obj_index(54), 1 );
        obj_to_room( obj, location4 );
        obj = create_object( get_obj_index(55), 1 );
        obj_to_room( obj, location5 );
        obj = create_object( get_obj_index(56), 1 );
        obj_to_room( obj, location6 );
        obj = create_object( get_obj_index(57), 1 );
        obj_to_room( obj, location7 ); 


	send_to_char( "The scatter was successful!\n\r", ch );
        sprintf( buf, "&z[&WDBZU&z]&W The dragonballs have been scattered across %s!&D", tarea->name );
        talk_info( AT_BLUE, buf );
        return;
    }

}

void do_summon( CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    /*CHAR_DATA *dragon;
    MOB_INDEX_DATA *pMobIndex;*/
    char buf[MAX_STRING_LENGTH];
    OBJ_DATA *obj;

    if( IS_NPC(ch) )
        return;

    if( summon_state != SUMMON_NONE )
    {
        ch_printf(ch,"A dragon is already being summoned!\n\r");
        return;
    }
    if( summon_room != NULL || summon_area != NULL )
    {
        ch_printf(ch,"A dragon is already summoned somewhere else.\n\r");
        return;
    }

    if( argument[0] == '\0' )
    {
        ch_printf(ch,"\n\rSyntax: summon <dragon>\n\r");
        ch_printf(ch,"\n\rDragon has to be one of the following:\n\r");
        ch_printf(ch,"shenron\n\r");
        return;
    }
    if( xIS_SET(ch->in_room->room_flags, ROOM_SAFE) )
    {
        ch_printf(ch,"You can't summon the dragon in a safe room.\n\r");
        return;
    }

    if( !str_cmp(argument,"shenron") )
    {
        if( !seven_dballs_here(ch,"earth") )
        {
          ch_printf(ch,"\n\r&RAll seven dragonballs must be here on the ground for you to be able to summon the dragon.\n\r" );
          return;
        }

        summon_state = SUMMON_SKY1;
        summon_area = ch->in_room->area;
        summon_room = ch->in_room;

        sprintf(buf,"%s has summoned the eternal dragon Shenron at room %d",
                ch->name, ch->in_room->vnum );
        to_channel( buf, CHANNEL_MONITOR, "Monitor", LEVEL_IMMORTAL );
        sprintf( buf, "&z[&WDBZU&z]&W %s has summoned the eternal dragon Shenron!&D", ch->name );
        talk_info( AT_BLUE, buf );

        if( (obj = get_obj_vnum_room(ch,51)) != NULL )
          REMOVE_BIT(obj->wear_flags,ITEM_TAKE);
        if( (obj = get_obj_vnum_room(ch,52)) != NULL )
          REMOVE_BIT(obj->wear_flags,ITEM_TAKE);
        if( (obj = get_obj_vnum_room(ch,53)) != NULL )
          REMOVE_BIT(obj->wear_flags,ITEM_TAKE);
        if( (obj = get_obj_vnum_room(ch,54)) != NULL )
          REMOVE_BIT(obj->wear_flags,ITEM_TAKE);
        if( (obj = get_obj_vnum_room(ch,55)) != NULL )
          REMOVE_BIT(obj->wear_flags,ITEM_TAKE);
        if( (obj = get_obj_vnum_room(ch,56)) != NULL )
          REMOVE_BIT(obj->wear_flags,ITEM_TAKE);
        if( (obj = get_obj_vnum_room(ch,57)) != NULL )
          REMOVE_BIT(obj->wear_flags,ITEM_TAKE);

        xSET_BIT(summon_room->room_flags, ROOM_SAFE);
        return;
    }
    do_summon(ch,"");
}





/* void do_sense( CHAR_DATA *ch, char *argument )
{
    ROOM_INDEX_DATA *was_in_room;
    EXIT_DATA *pexit;
    sh_int dir = -1;
    sh_int dist;
    sh_int max_dist = 8;
    bool found = FALSE;

    set_char_color( AT_ACTION, ch );

  if (ch->pcdata->learned[gsn_sense] == 0)
  {
   send_to_char("Huh?\n\r", ch);
   return;
  }

   if ( ch->position < POS_SLEEPING )
   {
        send_to_char("You can't do that while sleeping!\n\r", ch);
        return;
   }

    if ( argument[0] == '\0' )
    {
        was_in_room = ch->in_room;

        for(dir = 0; dir < 10; ++dir)
        {
             if((pexit = get_exit(ch->in_room, dir)) == NULL) continue;

             if(IS_SET(pexit->exit_info, EX_CLOSED) || IS_SET(pexit->exit_info, EX_SECRET)
                  || IS_SET(pexit->exit_info, EX_DIG)) break;

             if(room_is_private(pexit->to_room) && ch->level < LEVEL_GREATER) break;

             char_from_room(ch);
             char_to_room(ch, pexit->to_room);

             if(ch == ch->in_room->first_person) break;
             set_char_color( AT_YELLOW, ch );
             send_to_char( ch->in_room->name, ch );
             send_to_char( "\n\r", ch );
             send_to_char("You pick up the ", ch);
             if(ch->in_room->first_person->exp > ch->exp) send_to_char("&Rstrong&Y", ch);
             else send_to_char("&bfaint&Y", ch);
             send_to_char(" powerlevel of ", ch);
             send_to_char(ch->in_room->first_person->name, ch);
             send_to_char("\n\r", ch);
             found = TRUE;
         }
         if(!found)send_to_char("You can't sense any powerlevels nearby.\n\r", ch);
         char_from_room(ch);

         char_to_room(ch, was_in_room);

         return;
    }
    if ( ( dir = get_door( argument ) ) == -1 )
    {
        send_to_char( "Sense in WHAT direction?\n\r", ch );
        return;
    }
   if ( ch->position < POS_SLEEPING )
   {
        send_to_char("You can't do that while sleeping!\n\r", ch);
        return;
   }

    was_in_room = ch->in_room;
    act( AT_GREY, "Sensing $t...", ch, dir_name[dir], NULL, TO_CHAR );
    act( AT_GREY, "$n senses $t.", ch, dir_name[dir], NULL, TO_ROOM );

    if ( !can_use_skill(ch, number_percent(), gsn_sense ) )
    {
        act( AT_GREY, "You can't pick up any more powerlevels coming from $t.", ch,
            dir_name[dir], NULL, TO_CHAR );
        learn_from_failure( ch, gsn_sense );
        return;
    }

    if ( ( pexit = get_exit( ch->in_room, dir ) ) == NULL )
    {
        act( AT_GREY, "You can't see $t.", ch, dir_name[dir], NULL, TO_CHAR );
        return;
    }

    for ( dist = 1; dist <= max_dist; )
    {
        if ( IS_SET(pexit->exit_info, EX_CLOSED) )
        {
            if ( IS_SET(pexit->exit_info, EX_SECRET)
            ||   IS_SET(pexit->exit_info, EX_DIG) )
                act( AT_GREY, "Your cant sense $t any further.", ch,
                    dir_name[dir], NULL, TO_CHAR );
            else
                act( AT_GREY, "Your cant sense $t any further.", ch,
                    dir_name[dir], NULL, TO_CHAR );
            break;
        }
        if ( room_is_private( pexit->to_room )

        &&   ch->level < LEVEL_GREATER )
        {
            act( AT_GREY, "Your cant sense $t any further.", ch,
                dir_name[dir], NULL, TO_CHAR );
            break;
        }
               send_to_char(dir_name[dir], ch);
               send_to_char("\n\r", ch);


        char_from_room( ch );
        char_to_room( ch, pexit->to_room );
        set_char_color( AT_YELLOW, ch );
        send_to_char( ch->in_room->name, ch );
        send_to_char( "\n\r", ch );
        show_char_to_char( ch->in_room->first_person, ch );
        switch( ch->in_room->sector_type )
        {
            default: dist++; break;
            case SECT_AIR:
                if ( number_percent() < 80 ) dist++; break;
            case SECT_INSIDE:
            case SECT_FIELD:
            case SECT_UNDERGROUND:
                dist++; break;
            case SECT_FOREST:
            case SECT_CITY:
            case SECT_DESERT:
            case SECT_HILLS:
                dist += 2; break;
            case SECT_WATER_SWIM:
            case SECT_WATER_NOSWIM:
                dist += 3; break;
            case SECT_MOUNTAIN:
            case SECT_UNDERWATER:
            case SECT_OCEANFLOOR:
                dist += 4; break;
        }
        if ( dist >= max_dist )
        {
            act( AT_GREY, "You can't pick up any more powerlevels coming from $t.", ch, dir_name[dir], NULL, TO_CHAR );
            break;
        }
        if ( ( pexit = get_exit( ch->in_room, dir ) ) == NULL )
        {
            act( AT_GREY, "You can't pick up any more powerlevels coming from $t.", ch,
                dir_name[dir], NULL, TO_CHAR );
            break;
        }
    }

    char_from_room( ch );
    char_to_room( ch, was_in_room );
    learn_from_success( ch, gsn_sense );

    return;
} */

void do_sense( CHAR_DATA *ch, char *argument )
{
    ROOM_INDEX_DATA *was_in_room;
    EXIT_DATA *pexit;
    ROOM_INDEX_DATA *location;
    CHAR_DATA *inroom;
    sh_int dir = -1;
    sh_int dist;
    sh_int max_dist = 4;
    char  buf[MAX_INPUT_LENGTH];
    char  buf2[MAX_INPUT_LENGTH];
    location = ch->in_room;

    if ( IS_NPC(ch))
    return;

  if (ch->pcdata->learned[gsn_sense] == 0)
  {
   send_to_char("Huh?\n\r", ch);
   return;
  }

   if ( !IS_AWAKE(ch) )
   {
      send_to_char("Not in your sleep...\n\r", ch);
      return;
   }

    if ( argument[0] == '\0' )
    {
   if ( ch->position < POS_SLEEPING )
   {
        send_to_char("You can't do that while sleeping!\n\r", ch);
        return;
   }

      was_in_room = ch->in_room;
      location = ch->in_room;
      send_to_char("&wScanning Surroundings...&G\n\r", ch );
      learn_from_success( ch, gsn_sense );
      for ( pexit = ch->in_room->first_exit; pexit; pexit = pexit->next )
      {
        if ( IS_SET(pexit->exit_info, EX_CLOSED) || location == pexit->to_room )
        {
            if ( IS_SET(pexit->exit_info, EX_SECRET)
            ||   IS_SET(pexit->exit_info, EX_DIG) )
                act( AT_GREY, "Your cant sense any further.", ch,
                    NULL, NULL, TO_CHAR );
            else
                act( AT_GREY, "Your cant sense any further.", ch,
                    NULL, NULL, TO_CHAR );
            break;
        }

        char_from_room( ch );
        char_to_room( ch, pexit->to_room );
        set_char_color( AT_GREEN, ch );
        send_to_char( ch->in_room->name, ch );
        send_to_char( "\n\r", ch );
        for ( inroom = ch->in_room->first_person; inroom; inroom = inroom->next_in_room )
        {
          if (inroom == ch)
          continue;
         if ( inroom->exp < 1000000 )
         sprintf(buf2, "&Rfaint");
         else if ( inroom->exp < 5000000 )
         sprintf(buf2, "&Rweak");
         else if ( inroom->exp < 50000000 )
         sprintf(buf2, "&Rstrong");
         else
         sprintf(buf2, "&Rvery strong");

          sprintf( buf, "&YJudging from the &R%s&Y powerlevel, you think &w%s&Y is here.&w\n\r", buf2, inroom->name );
          if (!IS_ANDROID(inroom) && !xIS_SET(inroom->act, PLR_WIZINVIS) && !xIS_SET(inroom->act, ACT_MOBINVIS) )
          {
             send_to_char( buf, ch);
          }
        }
      }
      char_from_room( ch );
      char_to_room( ch, was_in_room );
      return;
    }
    else if ( ( dir = get_door( argument ) ) == -1 )
    {
        send_to_char( "Sense in WHAT direction?\n\r", ch );
        return;
    }
    else
    {
   if ( ch->position < POS_SLEEPING )
   {
        send_to_char("You can't do that while sleeping!\n\r", ch);
        return;
   }

    was_in_room = ch->in_room;
    act( AT_GREY, "You close your eyes as you sense $t...", ch, dir_name[dir], NULL, TO_CHAR );
    act( AT_GREY, "$n tries to pick up new powerlevels from $t.", ch, dir_name[dir], NULL, TO_ROOM );


    if ( ( pexit = get_exit( ch->in_room, dir ) ) == NULL )
    {
        act( AT_GREY, "You can't see $t.", ch, dir_name[dir], NULL, TO_CHAR );
        return;
    }
    if (IS_SET(pexit->exit_info, EX_SECRET))
    {
        act( AT_GREY, "You can't see $t.", ch, dir_name[dir], NULL, TO_CHAR );
        return;
    }
    for ( dist = 1; dist <= max_dist; )
    {
        if ( IS_SET(pexit->exit_info, EX_CLOSED) || location == pexit->to_room )
        {
            if ( IS_SET(pexit->exit_info, EX_SECRET)
            ||   IS_SET(pexit->exit_info, EX_DIG) )
                act( AT_GREY, "Your cant sense $t any further.", ch,
                    dir_name[dir], NULL, TO_CHAR );
            else
                act( AT_GREY, "Your cant sense $t any further.", ch,
                    dir_name[dir], NULL, TO_CHAR );
            break;
        }

        char_from_room( ch );
        char_to_room( ch, pexit->to_room );
        set_char_color(AT_GREEN, ch );
        send_to_char( ch->in_room->name, ch );
        send_to_char( "\n\r", ch );
        for ( inroom = ch->in_room->first_person; inroom; inroom = inroom->next_in_room )
        {
          if (inroom == ch)
          continue;
         if ( inroom->exp < 1000000 )
         sprintf(buf2, "&Rfaint");
         else if ( inroom->exp < 5000000 )
         sprintf(buf2, "&Rweak");
         else if ( inroom->exp < 50000000 )
         sprintf(buf2, "&Rstrong");
         else
         sprintf(buf2, "&Rvery strong");

          sprintf( buf, "&YJudging from the &R%s&Y powerlevel, you think &w%s&Y is here.&w\n\r", buf2, inroom->name );
          if (!IS_ANDROID(inroom) && !xIS_SET(inroom->act, PLR_WIZINVIS) && !xIS_SET(inroom->act, ACT_MOBINVIS) )
          {
             send_to_char( buf, ch);
          }
       }
            dist++;
        if ( dist >= max_dist )
        {
            act( AT_GREY, "You can't pick up any more powerlevels coming from $t.", ch, dir_name[dir], NULL, TO_CHAR );
            break;
        }
        if ( ( pexit = get_exit( ch->in_room, dir ) ) == NULL )
        {
            act( AT_GREY, "You can't pick up any more powerlevels coming from $t.", ch,
                dir_name[dir], NULL, TO_CHAR );
            break;
        }
    }

    char_from_room( ch );
    char_to_room( ch, was_in_room );
   }
    return;
}

void do_scan( CHAR_DATA *ch, char *argument )
{
    OBJ_DATA * eyes;
    char arg[MAX_INPUT_LENGTH];
    char buf[MAX_INPUT_LENGTH];
    CHAR_DATA *victim;
    int class, classtotal;


    if ( ( eyes = get_eq_char( ch, WEAR_EYES ) ) == NULL )
    {
        send_to_char( "You don't have anything in your eyes.\n\r", ch );
        return;
    }
    if ( eyes->item_type != ITEM_SCOUTER )
    {
        send_to_char( "You can only scan a person with a scouter..\n\r", ch );
        return;
    }
    one_argument( argument, arg );
    if ( arg[0] == '\0' )
    {
        send_to_pager( "Scan who?\n\r", ch );
        return;
    }
    if ( ( victim = get_char_room( ch, arg ) ) == NULL )
    {
        send_to_pager( "They aren't here.\n\r", ch );
        return;
    }

          if ( eyes->value[3] == 1 )
          classtotal = 25000000;
       else  if ( eyes->value[3] == 2 )
          classtotal = 100000000;
       else  if ( eyes->value[3] == 3 )
          classtotal = 500000000;
       else  if ( eyes->value[3] == 4 )
          classtotal = 1000000000;
       else  if ( eyes->value[3] == 5 )
          classtotal = 2000000000;
        else
          classtotal = 2000000000;


//        if ( victim->exp * victim->mod  >= eyes->value[3] ) 

      if ( IS_NPC(victim) )
        {
      if ( victim->exp > classtotal )
             {
            act( AT_GREY, "Your scouter explodes from $N's powerlevel.", ch, NULL, victim, TO_CHAR );
            act( AT_GREY, "$n's scouter explodes from your powerlevel.", ch, NULL, victim, TO_VICT );
            act( AT_GREY, "$n's scouter explodes from $N's powerlevel.", ch, NULL, victim, TO_NOTVICT );
            obj_from_char( eyes );
            extract_obj( eyes );
                return;
             } 
         }

      if ( !IS_NPC(victim) )
        {
      if ( victim->exp * victim->mod >= classtotal )
             {
            act( AT_GREY, "Your scouter explodes from $N's powerlevel.", ch, NULL, victim, TO_CHAR );
            act( AT_GREY, "$n's scouter explodes from your powerlevel.", ch, NULL, victim, TO_VICT );
            act( AT_GREY, "$n's scouter explodes from $N's powerlevel.", ch, NULL, victim, TO_NOTVICT );
            obj_from_char( eyes );
            extract_obj( eyes );
                return;
             }
         }

       sprintf( buf , "&R%s presses a button on %s scouter and looks at you.&D" , ch->name, ch->sex == 1 ? "his" : ch->sex == 2 ? "her" : "its" );
       act( AT_GREY, buf , victim, NULL, ch, TO_CHAR );
       sprintf( buf, "&R%s presses a button on %s scouter and looks at %s.&D" , ch->name, ch->sex == 1 ? "his" : ch->sex == 2 ? "her" : "its", victim->name );
       act( AT_GREY, buf, ch, NULL, victim, TO_NOTVICT );
    if (IS_NPC(victim))
{
      ch_printf(ch,"&gIt appears that&w %s&g has a powerlevel of &G%s.\n\r", victim->name, num_punct(victim->exp));
      return;
}
      ch_printf(ch,"&gIt appears that&w %s&g has a powerlevel of &G%s.\n\r", victim->name,
      xIS_SET( victim->act, PLR_SUPPRESS ) ? num_punct(victim->suppress) : num_punct(victim->exp *victim->mod));
      if ( victim->barrier > 0 )
      ch_printf(ch,"&gThe energy barrier is an estimated &G%s&g.\n\r", num_punct(victim->barrier) );
      if ( victim->charge > 0 )
      ch_printf(ch,"&gThe energy attack is an estimated &G%sx&g their powerlevel.\n\r", num_punct(victim->charge) );
   }

void do_remember(CHAR_DATA *ch, char *argument )
{
	
	 char arg[MAX_INP

Showing the first 100 KB of 304.8 KB. Download the archive for the full file.

Site Stats

Snippets: 1791
Codebases: 571