class.c

swrots/src/class.c · 219.7 KB

From the archive swrots.tgz

Download the archive   « Back to the archive contents

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

void do_skills( CHAR_DATA *ch, char *argument )
{
 char arg[MAX_INPUT_LENGTH];
 char arg2[MAX_INPUT_LENGTH];
 int iSkill, skill, gain;
 int maxskill=0;

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

   if( IS_NPC(ch) )
	return;

  if( arg[0] == '\0' )
   {
   ch_printf( ch, "&wAppraise              &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[APPRAISE_SKILL], ch->skill_percent[APPRAISE_SKILL] );
   ch_printf( ch, "&wAstrogate             &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[ASTROGATE_SKILL], ch->skill_percent[ASTROGATE_SKILL] );
   ch_printf( ch, "&wBalance               &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[BALANCE_SKILL], ch->skill_percent[BALANCE_SKILL] );
   ch_printf( ch, "&wClimb                 &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[CLIMB_SKILL], ch->skill_percent[CLIMB_SKILL] );
   ch_printf( ch, "&wCraft &g- &wArmor         &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[CRAFT_ARMOR], ch->skill_percent[CRAFT_ARMOR] );
   ch_printf( ch, "&g      -&w Blaster       &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[CRAFT_BLASTERS], ch->skill_percent[CRAFT_BLASTERS] );
   ch_printf( ch, "&g      -&w Computer      &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[CRAFT_COMPUTER], ch->skill_percent[CRAFT_COMPUTER] );
   ch_printf( ch, "&g      -&w Droid         &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[CRAFT_DROID], ch->skill_percent[CRAFT_DROID] );
   ch_printf( ch, "&g      -&w Device        &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[CRAFT_DEVICE], ch->skill_percent[CRAFT_DEVICE] );
  if( IS_IMMORTAL(ch) || ch->class_level[FORCE_ADEPT_ABILITY] != 0 || ch->class_level[JEDIGUARDIAN_ABILITY] != 0 || ch->class_level[JEDICONSULAR_ABILITY] != 0 )
   ch_printf( ch, "&g      -&w Lightsaber    &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[CRAFT_LIGHTSABER], ch->skill_percent[CRAFT_LIGHTSABER] );
   ch_printf( ch, "&g      -&w Bowcaster     &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[CRAFT_BOWCASTER], ch->skill_percent[CRAFT_BOWCASTER] );
   ch_printf( ch, "&g      -&w Heavy Weap    &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[CRAFT_HEAVY], ch->skill_percent[CRAFT_HEAVY] );
   ch_printf( ch, "&g      -&w Hyperdrive    &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[CRAFT_HYPERDRIVE], ch->skill_percent[CRAFT_HYPERDRIVE] );
   ch_printf( ch, "&g      -&w Medpac        &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[CRAFT_MEDPAC], ch->skill_percent[CRAFT_MEDPAC] );
   ch_printf( ch, "&g      -&w Simple        &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[CRAFT_SIMPLE], ch->skill_percent[CRAFT_SIMPLE] );
   ch_printf( ch, "&g      -&w Slugthrower   &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[CRAFT_SLUG], ch->skill_percent[CRAFT_SLUG] );
   ch_printf( ch, "&g      -&w Midship       &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[CRAFT_MIDSHIP], ch->skill_percent[CRAFT_MIDSHIP] );
   ch_printf( ch, "&g      -&w Starfighter   &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[CRAFT_FIGHTER], ch->skill_percent[CRAFT_FIGHTER] );
   ch_printf( ch, "&g      -&w Ship Weap     &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[CRAFT_STARWEAP], ch->skill_percent[CRAFT_STARWEAP] );
   ch_printf( ch, "&g      -&w Vibro         &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[CRAFT_VIBRO], ch->skill_percent[CRAFT_VIBRO] );   
   ch_printf( ch, "&wDemolitions           &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[DEMOLITIONS_SKILL], ch->skill_percent[DEMOLITIONS_SKILL] );
   ch_printf( ch, "&wDiplomacy             &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[DIPLOMACY_SKILL], ch->skill_percent[DIPLOMACY_SKILL] );
   ch_printf( ch, "&wDisable Device        &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[DISABLE_DEVICE], ch->skill_percent[DISABLE_DEVICE] );
   ch_printf( ch, "&wDisguise              &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[DISGUISE_SKILL], ch->skill_percent[DISGUISE_SKILL] );
   ch_printf( ch, "&wEscape Artist         &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[ESCAPE_ARTIST], ch->skill_percent[ESCAPE_ARTIST] );
   ch_printf( ch, "&wGamble                &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[GAMBLE_SKILL], ch->skill_percent[GAMBLE_SKILL] );
   ch_printf( ch, "&wGather Information    &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[GATHER_INFO], ch->skill_percent[GATHER_INFO] );
   ch_printf( ch, "&wHide                  &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[HIDE_SKILL], ch->skill_percent[HIDE_SKILL] );
   ch_printf( ch, "&wIntimidate            &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[INTIMIDATE_SKILL], ch->skill_percent[INTIMIDATE_SKILL] );
   ch_printf( ch, "&wListen                &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[LISTEN_SKILL], ch->skill_percent[LISTEN_SKILL] );
   ch_printf( ch, "&wMove Silently         &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[MOVE_SILENTLY], ch->skill_percent[MOVE_SILENTLY] );
   ch_printf( ch, "&wPilot                 &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[PILOT_SKILL], ch->skill_percent[PILOT_SKILL] );
   ch_printf( ch, "&wRepair                &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[REPAIR_SKILL], ch->skill_percent[REPAIR_SKILL] );
   ch_printf( ch, "&wRide                  &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[RIDE_SKILL], ch->skill_percent[RIDE_SKILL] );
   ch_printf( ch, "&wSearch                &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[SEARCH_SKILL], ch->skill_percent[SEARCH_SKILL] );
   ch_printf( ch, "&wSleight Of Hand       &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[SLEIGHT_OF_HAND], ch->skill_percent[SLEIGHT_OF_HAND] );
   ch_printf( ch, "&wSpeak Language        &g- &w%3d&w\n\r", ch->skill_level[SPEAK_LANG] );
   ch_printf( ch, "&wSpot                  &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[SPOT_SKILL], ch->skill_percent[SPOT_SKILL] );
   ch_printf( ch, "&wSurvival              &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[SURVIVAL_SKILL], ch->skill_percent[SURVIVAL_SKILL] );
   ch_printf( ch, "&wSwim                  &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[SWIM_SKILL], ch->skill_percent[SWIM_SKILL] );
   ch_printf( ch, "&wTreat Injury          &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[TREAT_INJURY], ch->skill_percent[TREAT_INJURY] );
   ch_printf( ch, "&wTumble                &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[TUMBLE_SKILL], ch->skill_percent[TUMBLE_SKILL] );
   ch_printf( ch, "&wUse Computer          &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->skill_level[COMPUTER_SKILL], ch->skill_percent[COMPUTER_SKILL] );
   ch_printf( ch, "\n\r" );
   ch_printf( ch, "&wYou have &g%d&w skillpoints left.\n\r", ch->skillpoints );
   return;
   }
  if( !str_cmp(arg, "learn") )
   {
    if( arg[0] == '\0' )
     {
	send_to_char( "&wLearn which skill?\n\r", ch );
	return;
     }
    skill = -1;
    for( iSkill = 0; iSkill < MAX_NSKILL; iSkill++ )
     {
      if( !str_prefix( arg2, nskill_name[iSkill] ) )
       {
	skill = iSkill;
	break;
       }
     }
    if( skill == -1 )
     {
	send_to_char( "&wThat isn't a skill.\n\r", ch );
	return;
     }
    if( !IS_IMMORTAL(ch) && skill == CRAFT_LIGHTSABER && ch->class_level[FORCE_ADEPT_ABILITY] == 0 && ch->class_level[JEDIGUARDIAN_ABILITY] == 0 && ch->class_level[JEDICONSULAR_ABILITY] == 0 )
     {
	send_to_char( "&wThat isn't a skill.\n\r", ch );
	return;
     }
    if( argument[0] == '\0' || !is_number(argument) )
     {
      	ch_printf( ch, "&wPut how many skillpoints into the &g%s&w skill?\n\r", nskill_name[iSkill] );
      	return;
     }
    gain = atoi(argument);
    if( gain < 1 )
     {
	send_to_char( "&wNow you're just being sillie.\n\r", ch );
	return;
     }
    if( gain > ch->skillpoints )
     {
	send_to_char( "&wYou don't have that many skillpoints.\n\r", ch );
	return;
     }
    maxskill = skill_max( ch, skill );
    if( (gain + ch->skill_level[skill] ) > maxskill )
     {
	ch_printf( ch, "&w&WYou can only have &G%d &w&Wskillpoints in &G%s&w&W.\n\r", maxskill, nskill_name[skill] );
	return;
     }
    if( skill == SPEAK_LANG )
     {
      if( ch->skill_level[SPEAK_LANG] >= 29 )
       {
	send_to_char( "&wMax skill for &bSpeak Language&w is &r29&w.\n\r", ch );
	return;
       }
      if( ch->skill_level[SPEAK_LANG] + gain > 29 )
       {
	ch_printf( ch, "&wYou can only put &r%d&w more pointsinto &bSpeak Language&w.\n\r", (29 - ch->skill_level[SPEAK_LANG]) );
	return;
       }
     }
    ch->skill_level[skill] += gain;
    ch->skill_percent[skill] = 0;
    ch->skillpoints -= gain;
    ch_printf( ch, "&wYou put &r%d&w skillpoints into the &b%s&w skill.\n\r", gain, nskill_name[skill] );
    return;
   }
  send_to_char( "Huh?\n\r", ch );
  return;
}

void do_fskills( CHAR_DATA *ch, char *argument )
{
  char arg[MAX_INPUT_LENGTH];
  char arg2[MAX_INPUT_LENGTH];
  int skill, iSkill, gain;
  int bonus=0;
  argument = one_argument( argument, arg );
  argument = one_argument( argument, arg2);

  if( IS_NPC(ch) )
   return;

  if( !HAS_FEAT(ch, FORCE_SENSITIVE) && !IS_IMMORTAL(ch) )
   {
	send_to_char( "Huh?\n\r", ch );
	return;
   }

 if( arg[0] == '\0' )
  {
  if( IS_IMMORTAL(ch) || HAS_FFEAT(ch, SITH_SORCERY) )
     ch_printf( ch, "&r+&wAlchemy          &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->force_level[ALCHEMY_SKILL], ch->force_percent[ALCHEMY_SKILL] );
  if( IS_IMMORTAL(ch) || HAS_FFEAT(ch, ALTER_FEAT) )
     ch_printf( ch, "&w Affect Mind      &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->force_level[AFFECT_MIND], ch->force_percent[AFFECT_MIND] );
  if( IS_IMMORTAL(ch) || HAS_FFEAT(ch, CONTROL_FEAT) )
     ch_printf( ch, "&w Battlemind       &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->force_level[BATTLEMIND_SKILL], ch->force_percent[BATTLEMIND_SKILL] );
  if( IS_IMMORTAL(ch) || HAS_FFEAT(ch, ALTER_FEAT) )
     ch_printf( ch, "&r+&wDrain Energy     &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->force_level[DRAIN_ENERGY], ch->force_percent[DRAIN_ENERGY] );
  if( IS_IMMORTAL(ch) || HAS_FEAT( ch, FORCE_SENSITIVE ) )
     ch_printf( ch, "&w Enhance Ability  &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->force_level[ENHANCE_ABILITY], ch->force_percent[ENHANCE_ABILITY] );
  if( IS_IMMORTAL(ch) || HAS_FFEAT(ch, SENSE_FEAT) )
   {
     ch_printf( ch, "&w Enhance Senses   &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->force_level[ENHANCE_SENSES], ch->force_percent[ENHANCE_SENSES] );
     ch_printf( ch, "&w Farseeing        &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->force_level[FARSEEING_SKILL], ch->force_percent[FARSEEING_SKILL] );
     ch_printf( ch, "&r+&wFear             &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->force_level[FEAR_SKILL], ch->force_percent[FEAR_SKILL] );
   }
  if( IS_IMMORTAL(ch) || HAS_FFEAT(ch, CONTROL_FEAT) )
     ch_printf( ch, "&w Force Defense    &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->force_level[FORCE_DEFENSE], ch->force_percent[FORCE_DEFENSE] );
  if( IS_IMMORTAL(ch) || HAS_FFEAT(ch, ALTER_FEAT) )
   {
     ch_printf( ch, "&r+&wForce Grip       &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->force_level[FORCE_GRIP], ch->force_percent[FORCE_GRIP] );
     ch_printf( ch, "&r+&wForce Lightning  &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->force_level[FORCE_LIGHTNING], ch->force_percent[FORCE_LIGHTNING] );
   }
  if( IS_IMMORTAL(ch) || HAS_FFEAT(ch, CONTROL_FEAT) )
     ch_printf( ch, "&w Force Stealth    &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->force_level[FORCE_STEALTH], ch->force_percent[FORCE_STEALTH] );
  if( IS_IMMORTAL(ch) || HAS_FFEAT(ch, ALTER_FEAT) )
   {
     ch_printf( ch, "&w Force Strike     &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->force_level[FORCE_STRIKE], ch->force_percent[FORCE_STRIKE] );
     ch_printf( ch, "&w Heal Another     &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->force_level[HEAL_OTHER], ch->force_percent[HEAL_OTHER] );
   }
  if( IS_IMMORTAL(ch) || HAS_FEAT( ch, FORCE_SENSITIVE ) )
     ch_printf( ch, "&w Heal Self        &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->force_level[HEAL_SELF], ch->force_percent[HEAL_SELF] );
  if( IS_IMMORTAL(ch) || HAS_FFEAT(ch, ALTER_FEAT) )
   {
     ch_printf( ch, "&w Illusion         &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->force_level[ILLUSION_SKILL], ch->force_percent[ILLUSION_SKILL] );
     ch_printf( ch, "&w Move Object      &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->force_level[MOVE_OBJECT], ch->force_percent[MOVE_OBJECT] );
   }
  if( IS_IMMORTAL(ch) || HAS_FFEAT(ch, SENSE_FEAT) )
   {
     ch_printf( ch, "&w See Force        &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->force_level[SEE_FORCE], ch->force_percent[SEE_FORCE] );
     ch_printf( ch, "&w Telepathy        &g- &w%3d  &g(&w%2d&g/&w100&g)&w\n\r", ch->force_level[TELEPATHY_SKILL], ch->force_percent[TELEPATHY_SKILL] );
   } 
  send_to_char( "\n\r", ch );
  send_to_char( "&r+&w denotes a &gDark Side&w skill.\n\r", ch );
  send_to_char( "\n\r", ch );
  ch_printf( ch, "&w You have &g%d&w skillpoints remaining.\n\r", ch->skillpoints );
  return;
  }
  if( !str_cmp(arg, "learn") )
   {
    if( arg[0] == '\0' )
     {
	send_to_char( "&wLearn which skill?\n\r", ch );
	return;
     }
    skill = -1;
    for( iSkill = 0; iSkill < MAX_FSKILL; iSkill++ )
     {
      if( !str_prefix( arg2, fskill_name[iSkill] ) )
       {
	skill = iSkill;
	break;
       }
     }
    if( skill == -1 )
     {
	send_to_char( "&wThat isn't a skill.\n\r", ch );
	return;
     }
    if( argument[0] == '\0' || !is_number(argument) )
     {
      	ch_printf( ch, "&wPut how many skillpoints into the &b%s&w skill?\n\r", fskill_name[iSkill] );
      	return;
     }
    gain = atoi(argument);
    if( gain < 1 )
     {
	send_to_char( "&wNow you're just being sillie.\n\r", ch );
	return;
     }
    if( ch->pcdata->force_bonus >= 700 && ch->pcdata->force_bonus < 850 )
	bonus = 4;
    if( ch->pcdata->force_bonus >= 850 && ch->pcdata->force_bonus < 950 )
	bonus = 8;
    if( ch->pcdata->force_bonus >= 950 )
	bonus = 10;
    if( (gain + ch->force_level[skill] ) > fskill_max( ch, skill ) )
     {
        ch_printf( ch, "&w&WYou can only have &G%d &w&Wskillpoints in &G%s&w&W.\n\r", fskill_max( ch, skill ), fskill_name[skill] );
        return;
     }
    if( gain > ch->skillpoints )
     {
	send_to_char( "&wYou don't have that many skillpoints.\n\r", ch );
	return;
     }
    ch->force_level[skill] += gain;
    ch->force_percent[skill] = 0;
    ch->skillpoints -= gain;
    ch_printf( ch, "&wYou put &r%d&w skillpoints into the &b%s&w skill.\n\r", gain, fskill_name[skill] );
    return;
   }
  send_to_char( "Huh?\n\r", ch );
  return;
}

int get_fflag( char *flag )
{
  int x;
  for ( x = 0; x < 32; x++ )
    if ( !str_cmp( flag, feat_name[x] ) )
        return x;
    return -1;
}

int get_f2flag( char *flag )
{
  int x;
  for ( x = 0; x < 32; x++ )
    if ( !str_cmp( flag, feat2_name[x] ) )
	return x;
    return -1;
}

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

  if( IS_NPC(ch) )
    return;

 if( argument[0] == '\0' )
 {
  send_to_char( "&wAlertness&w ", ch );
   if( HAS_FEAT(ch, ALERTNESS_FEAT) )
	send_to_char( "&r+\n\r", ch );
   else
	send_to_char( "\n\r", ch );
  send_to_char( "&wAmbidexterity&w ", ch );
   if( HAS_FEAT(ch, AMBIDEXTERITY_FEAT) )
	send_to_char( "&r+\n\r", ch );
   else
	send_to_char( "&w\n\r", ch );
  send_to_char( "&wAthletic&w ", ch );
   if( HAS_FEAT(ch, ATHLETIC_FEAT) )
	send_to_char( "&r+\n\r", ch );
   else
	send_to_char( "\n\r", ch );
  send_to_char( "&wBlind-Fighting&w ", ch );
   if( HAS_FEAT(ch, BLIND_FIGHT) )
	send_to_char( "&r+\n\r", ch );
   else
	send_to_char( "\n\r", ch );
  send_to_char( "&wCautious&w ", ch );
   if( HAS_FEAT(ch, CAUTIOUS_FEAT ) )
   	send_to_char( "&r+\n\r", ch );
   else
	send_to_char( "\n\r", ch );
  send_to_char( "&wDodge&w ", ch );
   if( HAS_FEAT(ch, DODGE_FEAT ) )
	send_to_char( "&r+\n\r", ch );
   else
	send_to_char( "\n\r", ch );
  send_to_char( "&wFame&w ", ch );
   if( HAS_FEAT(ch, FAME_FEAT ) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wForce-Sensitive&w ", ch );
   if( HAS_FEAT(ch, FORCE_SENSITIVE) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wFrightful Presense&w ", ch );
   if( HAS_FEAT(ch, FRIGHTFUL_PRESENSE) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wGearhead&w ", ch );
   if( HAS_FEAT(ch, GEARHEAD_FEAT) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wGreat Fortitude&w ", ch );
   if( HAS_FEAT(ch, GREAT_FORTITUDE) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wHeadstrong&w ", ch );
   if( HAS_FEAT(ch, HEADSTRONG_FEAT) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wImproved Disarm&w ", ch );
   if( HAS_FEAT(ch, IMPROVED_DISARM) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch ); 
  send_to_char( "&wImproved Trip&w ", ch );
   if( HAS_FEAT(ch, IMPROVED_TRIP) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wImproved Two Weapon Fighting&w ", ch );
   if( HAS_FEAT(ch, IMPROVED_TWO_WEAPON) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wInfamy&w ", ch );
   if( HAS_FEAT(ch, INFAMY_FEAT) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wInfluence&w ", ch );
   if( HAS_FEAT(ch, INFLUENCE_FEAT) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wIron Will&w ", ch );
   if( HAS_FEAT(ch, IRON_WILL) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wLightning Reflexes&w ", ch );
   if( HAS_FEAT(ch, LIGHTNING_REFLEXES) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wLow Profile&w ", ch );
   if( HAS_FEAT(ch, LOW_PROFILE) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wNimble&w ", ch );
   if( HAS_FEAT(ch, NIMBLE_FEAT) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wQuickness\n\r", ch );
  send_to_char( "&wRugged&w ", ch );
   if( HAS_FEAT(ch, RUGGED_FEAT) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wSharp-Eyed&w ", ch );
   if( HAS_FEAT(ch, SHARP_EYED) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wSkill Emphasis\n\r", ch );
  send_to_char( "&wSpacer&w ", ch );
   if( HAS_FEAT(ch, SPACER_FEAT) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wStarship Dodge&w ", ch );
   if( HAS_FEAT(ch, STARSHIP_DODGE) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wStarfighter Operations&w ", ch );
   if( HAS_FEAT(ch, FIGHTER_OPS) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wMidship Operations&w ", ch );
   if( HAS_FEAT(ch, MIDSHIP_OPS) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wCapital Operations&w ", ch );
   if( HAS_FEAT(ch, CAPITAL_OPS) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wSteady&w ", ch );
   if( HAS_FEAT(ch, STEADY_FEAT) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wStealthy&w ", ch );
   if( HAS_FEAT(ch, STEALTHY_FEAT) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wTrack&w ", ch );
   if( HAS_FEAT(ch, TRACK_FEAT) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&wTwo Weapon Fighting&w ", ch );
   if( HAS_FEAT(ch, TWO_WEAP_FIGHTING) )
        send_to_char( "&r+\n\r", ch );
   else
        send_to_char( "\n\r", ch );
  send_to_char( "&bBlaster Feats&w\n\r", ch );
  if( HAS_FEAT3(ch, POINT_BLANK ) )
   send_to_char( "&gPoint Blank Shot&w, ", ch );
  else
   send_to_char( "&wPoint Blank Shot, ", ch );
  if( HAS_FEAT3(ch, PRECISE_SHOT ) )
   send_to_char( "&gPrecise Shot&w, ", ch );
  else
   send_to_char( "&wPrecise Shot, ", ch );
  if( HAS_FEAT3(ch, FAR_SHOT ) )
   send_to_char( "&gFar Shot&w, ", ch );
  else
   send_to_char( "&wFar Shot, ", ch );
  if( HAS_FEAT3(ch, RAPID_SHOT ) )
   send_to_char( "&gRapid Shot&w\n\r", ch );
  else
   send_to_char( "&wRapid Shot\n\r", ch );   
  send_to_char( "&bWeapon Proficiencies&w\n\r", ch );
  if( HAS_FEAT2(ch, WEAP_PROF_PISTOLS) )
   send_to_char( "&gBlaster Pistols&w, ", ch );
  else
   send_to_char( "&wBlaster Pistols, ", ch );
  if( HAS_FEAT2(ch, WEAP_PROF_RIFLES) )
   send_to_char( "&gBlaster Rifles&w, ", ch );
  else
   send_to_char( "&wBlaster Rifles, ", ch );
  if( HAS_FEAT2(ch, WEAP_PROF_HEAVY) )
   send_to_char( "&gHeavy Weapons&w, ", ch );
  else
   send_to_char( "&wHeavy Weapons, ", ch );
  if( HAS_FEAT2(ch, WEAP_PROF_PRIMITIVE) )
   send_to_char( "&gPrimitive&w, ", ch );
  else
   send_to_char( "&wPrimitive, ", ch );
  if( HAS_FEAT2(ch, WEAP_PROF_SIMPLE) )
   send_to_char( "&gSimple&w, ", ch );
  else
   send_to_char( "&wSimple, ", ch );
  if( HAS_FEAT2(ch, WEAP_PROF_VIBRO) )
   send_to_char( "&gVibros&w, ", ch );
  else
   send_to_char( "&wVibros, ", ch );
  if( HAS_FEAT2(ch, WEAP_PROF_LIGHTSABER) )
   send_to_char( "&gLightsaber&w, ", ch );
  else
   send_to_char( "&wLightsaber, ", ch );
  if( HAS_FEAT2(ch, WEAP_PROF_FORCEPIKE) )
   send_to_char( "&gForce Pike&w, ", ch );
  else
   send_to_char( "&wForce Pike, ", ch );
  if( HAS_FEAT2(ch, WEAP_PROF_BOWCASTER) )
   send_to_char( "&gBowcasters&w\n\r", ch );
  else
   send_to_char( "&wBowcasters\n\r", ch );
 
  send_to_char( "&bImproved Critical&w\n\r", ch );
  if( HAS_FEAT2(ch, IMP_CRITICAL_PISTOLS) )
   send_to_char( "&gBlaster Pistols&w, ", ch );
  else
   send_to_char( "&wBlaster Pistols, ", ch );
  if( HAS_FEAT2(ch, IMP_CRITICAL_RIFLES) )
   send_to_char( "&gBlaster Rifles&w, ", ch );
  else
   send_to_char( "&wBlaster Rifles, ", ch );
  if( HAS_FEAT2(ch, IMP_CRITICAL_HEAVY) )
   send_to_char( "&gHeavy Weapons&w, ", ch );
  else
   send_to_char( "&wHeavy Weapons, ", ch );
  if( HAS_FEAT2(ch, IMP_CRITICAL_PRIMITIVE) )
   send_to_char( "&gPrimitive&w, ", ch );
  else
   send_to_char( "&wPrimitive, ", ch );
  if( HAS_FEAT2(ch, IMP_CRITICAL_SIMPLE) )
   send_to_char( "&gSimple&w, ", ch );
  else
   send_to_char( "&wSimple, ", ch );
  if( HAS_FEAT2(ch, IMP_CRITICAL_VIBRO) )
   send_to_char( "&gVibros&w, ", ch );
  else
   send_to_char( "&wVibros, ", ch );
  if( HAS_FEAT2(ch, IMP_CRITICAL_LIGHTSABER) )
   send_to_char( "&gLightsaber&w, ", ch );
  else 
   send_to_char( "&wLightsaber, ", ch );
  if( HAS_FEAT2(ch, IMP_CRITICAL_BOWCASTER) )
   send_to_char( "&gBowcasters&w\n\r", ch );
  else
   send_to_char( "&wBowcasters\n\r", ch );
  
  send_to_char( "&bArmor Proficiencies&w\n\r", ch );
  if( HAS_FEAT2(ch, ARMOR_LIGHT) )
   send_to_char( "&gLight Armor&w, ", ch );
  else
   send_to_char( "&wLight Armor, ", ch );
  if( HAS_FEAT2(ch, ARMOR_MEDIUM) )
   send_to_char( "&gMedium Armor&w, ", ch );
  else
   send_to_char( "&wMedium Armor, ", ch );
  if( HAS_FEAT2(ch, ARMOR_HEAVY) )
   send_to_char( "&gHeavy Armor&w, ", ch );
  else
   send_to_char( "&wHeavy Armor, ", ch );
  if( HAS_FEAT2(ch, ARMOR_POWERED) )
   send_to_char( "&gPowered Armor&w\n\r", ch );
  else
   send_to_char( "&wPowered Armor\n\r", ch );
  
  send_to_char( "&bMartial Proficiencies&w\n\r", ch );
  if( HAS_FEAT2(ch, MARTIAL_ARTS) )
   send_to_char( "&gMartial Arts&w, ", ch );
  else
   send_to_char( "&wMartial Arts, ", ch );
  if( HAS_FEAT2(ch, DEF_MARTIAL_ARTS) ) 
   send_to_char( "&gDefensive Martial Arts&w, ", ch );
  else
   send_to_char( "&wDefensive Martial Arts, ", ch );
  if( HAS_FEAT2(ch, IMP_MARTIAL_ARTS) )
   send_to_char( "&gImproved Martial Arts&w, ", ch );
  else
   send_to_char( "&wImproved Martial Arts, ", ch );
  if( HAS_FEAT(ch, ADV_MARTIAL_ARTS) )
   send_to_char( "&gAdvanced Martial Arts&w\n\r", ch );
  else
   send_to_char( "&wAdvanced Martial Arts\n\r", ch );
  send_to_char( "\n\r", ch );
  ch_printf( ch, "&wYou have &g%d&w free feats.\n\r", ch->unused_feats );
  return;
 }

 if( ch->unused_feats < 1 )
 {
	send_to_char( "&wYou don't have any unused feat points.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "point blank") || !str_cmp(argument, "point blank shot" ) )
 {
	if( HAS_FEAT3(ch, POINT_BLANK) )
	 {
		send_to_char( "&wYou already have this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats3, POINT_BLANK);
	send_to_char( "&wYou now possess the &YPoint Blank Shot&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "precise shot") )
 {
	if( HAS_FEAT3(ch, PRECISE_SHOT) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	if( !HAS_FEAT3(ch, POINT_BLANK) )
	 {
		send_to_char( "&wYou lack a requirement for this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats3, PRECISE_SHOT);
	send_to_char( "&wYou now possess the &YPrecise Shot&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "far shot" ) )
 {
	if( HAS_FEAT3(ch, FAR_SHOT) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	if( !HAS_FEAT3(ch, POINT_BLANK) )
	 {
		send_to_char( "&wYou lack a requirement for this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats3, FAR_SHOT);
	send_to_char( "&wYou now possess the &YFar Shot&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "rapid shot" ) )
 {
	if( HAS_FEAT3(ch, RAPID_SHOT) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	if( !HAS_FEAT3(ch, POINT_BLANK) || get_curr_dex(ch) < 13 )
	 {
		send_to_char( "&wYou lack a requirement for this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats3, RAPID_SHOT);
	send_to_char( "&wYou now possess the &YRapid Shot&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "martial arts") )
 {
	if( IS_DROID(ch) )
	 {
		send_to_char( "&wDroids must purchase Martial Art programming.\n\r", ch );
		return;
	 }
	if( HAS_FEAT2(ch, MARTIAL_ARTS) )
         {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats2, MARTIAL_ARTS);
	send_to_char( "&wYou have gained the &YMartial Arts&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "advanced martial arts") )
 {
	if( IS_DROID(ch) )
	 {
		send_to_char( "&wDroids must purchase Martial Art programming.\n\r", ch );
		return;
	 }
	if( HAS_FEAT(ch, ADV_MARTIAL_ARTS) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	if( !HAS_FEAT2(ch, IMP_MARTIAL_ARTS) || ch->top_level < 8 )
	 {
		send_to_char( "&wYou lack a requirement for this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats2, ADV_MARTIAL_ARTS);
	send_to_char( "&wYou have gained the &YImproved Martial Arts&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "defensive martial arts") )
 {
	if( IS_DROID(ch) )
	 {
		send_to_char( "&wDroids must purchase martial arts programming.\n\r", ch );
		return;
	 }
	if( HAS_FEAT2(ch, DEF_MARTIAL_ARTS) ) 
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	if( !HAS_FEAT2(ch, MARTIAL_ARTS) )
	 {
		send_to_char( "&wYou lack a requirement for this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats2, DEF_MARTIAL_ARTS);
	send_to_char( "&wYou have gained the &YDefensive Martial Arts&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "improved martial arts") )
 {
	if( IS_DROID(ch) )
	 {
		send_to_char( "&wDroids must purchase martial arts programming.\n\r", ch );
		return;
	 }
	if( HAS_FEAT2(ch, IMP_MARTIAL_ARTS) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	if( !HAS_FEAT2(ch, MARTIAL_ARTS) || ch->top_level < 4 )
	 {
		send_to_char( "&wYou lack a requirement for this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats2, IMP_MARTIAL_ARTS);
	send_to_char( "&wYou have gained the &YImproved Martial Arts&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "alertness") )
 {
	if( HAS_FEAT(ch, ALERTNESS_FEAT) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	ch->skill_level[LISTEN_SKILL] += 2;
	ch->skill_level[SPOT_SKILL] += 2;
	SET_BIT(ch->feats, ALERTNESS_FEAT);
	send_to_char( "&wYou have gained the &YAlertness&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "ambidexterity") )
 {
	if( HAS_FEAT(ch, AMBIDEXTERITY_FEAT) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	if( get_curr_dex(ch) < 15 )
	 {
		send_to_char( "&wYou lack the required &bDexterity&w to do this.\n\r", ch );
		return;
	 }
	SET_BIT(ch->feats, AMBIDEXTERITY_FEAT);
	ch->unused_feats -= 1;
	send_to_char( "&wYou have gained the &YAmbidexterity&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "athletic") )
 {
	if( HAS_FEAT(ch, ATHLETIC_FEAT) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	ch->skill_level[CLIMB_SKILL] += 2;
	ch->skill_level[SWIM_SKILL] += 2;
	SET_BIT(ch->feats, ATHLETIC_FEAT);
	send_to_char( "&wYou have gained the &YAthletic&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "blind-fighting") )
 {
	if( HAS_FEAT(ch, BLIND_FIGHT) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats, BLIND_FIGHT);
	send_to_char( "&wYou have gained the &YBlind-Fighting&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "cautious" ) )
 {
	if( HAS_FEAT(ch, CAUTIOUS_FEAT) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
 	 }
	ch->unused_feats -= 1;
	ch->skill_level[DISABLE_DEVICE] += 2;
	ch->skill_level[DEMOLITIONS_SKILL] += 2;
	SET_BIT(ch->feats, CAUTIOUS_FEAT);
	send_to_char( "&wYou have gained the &YCautious&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "dodge" ) )
 {
	if( HAS_FEAT(ch, DODGE_FEAT) ) 
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	ch->dodge_bonus += 1;
	SET_BIT(ch->feats, DODGE_FEAT);
	send_to_char( "&wYou have gained the &YDodge&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "fame" ) )
 {
	if( HAS_FEAT(ch, FAME_FEAT) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	ch->reputation += 3;
	SET_BIT(ch->feats, FAME_FEAT);
	send_to_char( "&wYou have gained the &YFame&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "force-sensitive") || !str_cmp(argument, "force sensitive") )
 {
        if( IS_DROID(ch) )
         {
                send_to_char( "&wDroids can't be Force-Sensitive.\n\r", ch );
                return;
         }
	if( HAS_FEAT(ch, FORCE_SENSITIVE) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	ch->forcepoints += 1;
	SET_BIT(ch->feats, FORCE_SENSITIVE);
	send_to_char( "&wYou have gained the &YForce-Sensitive&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "frightful presense") )
 {
	if( HAS_FEAT(ch, FRIGHTFUL_PRESENSE) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	if( get_curr_cha(ch) < 15 || ch->skill_level[INTIMIDATE_SKILL] < 9 )
   	 {
		send_to_char( "&wYou are lacking one of the requirements to gain this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats, FRIGHTFUL_PRESENSE);
	send_to_char( "&wYou have gained the &YFrightful Presense&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "gearhead") )
 {
	if( HAS_FEAT(ch, GEARHEAD_FEAT) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	ch->skill_level[REPAIR_SKILL] += 2;
	ch->skill_level[COMPUTER_SKILL] += 2;
	SET_BIT(ch->feats, GEARHEAD_FEAT);
	send_to_char( "&wYou have gained the &YGearhead&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "great fortitude") )
 {
	if( HAS_FEAT(ch, GREAT_FORTITUDE) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->fortitude += 2;
	SET_BIT(ch->feats, GREAT_FORTITUDE);
	ch->unused_feats -= 1;
	send_to_char( "&wYou have gained the &YGreat Fortitude&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "headstrong" ) )
 {
	if( HAS_FEAT(ch, HEADSTRONG_FEAT) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	ch->willpower += 1;
	ch->skill_level[INTIMIDATE_SKILL] += 2;
	SET_BIT(ch->feats, HEADSTRONG_FEAT);
	send_to_char( "&wYou have gained the &YHeadstrong&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "improved disarm") )
 {
	if( HAS_FEAT(ch, IMPROVED_DISARM) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	if( get_curr_dex(ch) < 13 )
	 {
	 	send_to_char( "&wYou lack one of the requirements to gain this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats, IMPROVED_DISARM);
	send_to_char( "&wYou have gained the &YImproved Disarm&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "improved trip") )
 {
	if( HAS_FEAT(ch, IMPROVED_TRIP) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	if( get_curr_dex(ch) < 13 )
	 {
		send_to_char( "&wYou lack one of the requirements to gain this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats, IMPROVED_TRIP);
	send_to_char( "&wYou have gained the &YImproved Trip&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "improved two weapon fighting" ) )
 {
	if( HAS_FEAT(ch, IMPROVED_TWO_WEAPON) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }	
	if( !HAS_FEAT(ch, TWO_WEAP_FIGHTING) || !HAS_FEAT(ch, AMBIDEXTERITY_FEAT) || ch->top_level < 9 )
	 {
	 	send_to_char( "&wYou lack one of the requirements for this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats, IMPROVED_TWO_WEAPON);
	send_to_char( "&wYou have gained the &YImproved Two Weapon Fighting&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "infamy" ) )
 {
	if( HAS_FEAT(ch, INFAMY_FEAT) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->reputation += 3;
	ch->unused_feats -= 1;
	SET_BIT(ch->feats, INFAMY_FEAT);
	send_to_char( "&wYou have gained the &YInfamy&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "influence" ) )
 {
	if( HAS_FEAT(ch, INFLUENCE_FEAT) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->reputation += 2;
	ch->unused_feats -= 1;
	SET_BIT(ch->feats, INFLUENCE_FEAT);
	send_to_char( "&wYou have gained the &YInfluence&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "iron will" ) )
 {
	if( HAS_FEAT(ch, IRON_WILL) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->willpower += 2;
	ch->unused_feats -= 1;
	SET_BIT(ch->feats, IRON_WILL );
	send_to_char( "&wYou have gained the &YIron Will&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "lightning reflexes") )
 {
	if( HAS_FEAT(ch, LIGHTNING_REFLEXES) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->reflexes += 2;
	ch->unused_feats -= 1;
	SET_BIT(ch->feats, LIGHTNING_REFLEXES);
	send_to_char( "&wYou have gained the &YLightning Reflexes&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "low profile") )
 {
	if( HAS_FEAT(ch, LOW_PROFILE) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->reputation -= 2;
	ch->unused_feats -= 1;
	SET_BIT(ch->feats, LOW_PROFILE);
	send_to_char( "&wYou have gained the &YLow Profile&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "nimble") )
 {
	if( HAS_FEAT(ch, NIMBLE_FEAT) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	ch->skill_level[ESCAPE_ARTIST] += 2;
	ch->skill_level[SLEIGHT_OF_HAND] += 2;
	SET_BIT(ch->feats, NIMBLE_FEAT);
	send_to_char( "&wYou have gained the &YNimble&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "quickness") )
 {
	ch->unused_feats -= 1;
	ch->max_hit += 5;
	ch->hit += 5;
	send_to_char( "&wYou have gained the &YQuickness&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "rugged") )
 {
	if( HAS_FEAT(ch, RUGGED_FEAT) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	ch->fortitude += 1;
	ch->skill_level[SURVIVAL_SKILL] += 2;
	SET_BIT(ch->feats, RUGGED_FEAT);
	send_to_char( "&wYou have gained the &YRugged&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "sharp-eyed") || !str_cmp(argument, "sharp eyed") )
 {
	if( HAS_FEAT(ch, SHARP_EYED) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	ch->skill_level[SEARCH_SKILL] += 2;
	ch->skill_level[SPOT_SKILL] += 2;
	SET_BIT(ch->feats, SHARP_EYED);
	send_to_char( "&wYou have gained the &YSharp-Eyed&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "skill emphasis") )
 {
	ch->unused_feats -= 1;
	ch->skillpoints += 5;
	send_to_char( "&wYou have gained the &YSkill Emphasis&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "spacer") )
 {
	if( HAS_FEAT(ch, SPACER_FEAT) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	ch->skill_level[ASTROGATE_SKILL] += 2;
	ch->skill_level[PILOT_SKILL] += 2;
	SET_BIT(ch->feats, SPACER_FEAT);
	send_to_char( "&wYou have gained the &YSpacer&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "starship dodge") )
 {
	if( HAS_FEAT(ch, STARSHIP_DODGE) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	if( get_curr_dex(ch) < 13 || ch->skill_level[PILOT_SKILL] < 6 )
	 {
		send_to_char( "&wYou lack one of the requirements to take this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats, STARSHIP_DODGE);
	send_to_char( "&wYou have gained the &YStarship Dodge&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "starfighter operations") )
 {
	if( HAS_FEAT(ch, FIGHTER_OPS) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	if( ch->skill_level[PILOT_SKILL] < 2 )
	 {
		send_to_char( "&wYou lack the requirement to take this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats, FIGHTER_OPS);
	send_to_char( "&wYou have gained the &YStarfighter Operations&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "midship operations") )
 {
	if( HAS_FEAT(ch, MIDSHIP_OPS) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	if( ch->skill_level[PILOT_SKILL] < 2 )
	 {
		send_to_char( "&wYou lack the requirement to take this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats, MIDSHIP_OPS);
	send_to_char( "&wYou have gained the &YMidship Operations&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "capital operations") )
 {
	if( HAS_FEAT(ch, CAPITAL_OPS) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	if( ch->skill_level[PILOT_SKILL] < 2 )
	 {
		send_to_char( "&wYou lack the requirement to take this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats, CAPITAL_OPS);
	send_to_char( "&wYou have gained the &YCapital Operations&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "steady") )
 {
	if( HAS_FEAT(ch, STEADY_FEAT) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	ch->reflexes += 1;
	ch->skill_level[BALANCE_SKILL] += 2;
	SET_BIT(ch->feats, STEADY_FEAT);
	send_to_char( "&wYou have gained the &YSteady&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "stealthy") )
 {
	if( HAS_FEAT(ch, STEALTHY_FEAT) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	ch->skill_level[HIDE_SKILL] += 2;
	ch->skill_level[MOVE_SILENTLY] += 2;
	SET_BIT(ch->feats, STEALTHY_FEAT);
	send_to_char( "&wYou have gained the &YStealthy&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "track") )
 {
	if( HAS_FEAT2(ch, TRACK_FEAT) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats2, TRACK_FEAT);
	send_to_char( "&wYou have gained the &YTrack&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "two weapon fighting") )
 {
	if( HAS_FEAT2(ch, TWO_WEAP_FIGHTING) )
	 {
		send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats2, TWO_WEAP_FIGHTING);
	send_to_char( "&wYou have gained the &YTwo Weapon Fighting&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "pistol") || !str_cmp(argument, "pistols") || !str_cmp( argument, "blaster pistols") || !str_cmp(argument, "blaster pistol"))
 {
	if( HAS_FEAT2(ch, WEAP_PROF_PISTOLS) )
	 {
	  if( HAS_FEAT2(ch, IMP_CRITICAL_PISTOLS) )
	   {
		send_to_char( "&wYou already are a master with &bBlaster Pistols&w.\n\r", ch );
		return;
	   }
	  ch->unused_feats -= 1;
	  SET_BIT(ch->feats2, IMP_CRITICAL_PISTOLS);
	  send_to_char( "&wYou have gained the &YImproved Critical Blaster Pistol&w feat.\n\r", ch );
	  return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats2, WEAP_PROF_PISTOLS);
	send_to_char( "&wYou have gained the &YWeapon Proficiency Blaster Pistol&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "force pike") )
 {
	if( HAS_FEAT2(ch, WEAP_PROF_FORCEPIKE) )
	 {
	  if( HAS_FEAT2(ch, IMP_CRITICAL_FORCEPIKE) )
	   {
		send_to_char( "&wYou already area  master with &bForce Pikes&w.\n\r", ch );
		return;
	   }
	  ch->unused_feats -= 1;
	  SET_BIT(ch->feats2, IMP_CRITICAL_FORCEPIKE);
	  send_to_char( "&wYou have gained the &YImproved Critical Force Pikes&w feat.\n\r", ch );
	  return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats2, WEAP_PROF_FORCEPIKE);
	send_to_char( "&wYou gained the &YWeapon Proficiency Force Pikes&w.\n\r", ch);
	return;
 }
 if( !str_cmp(argument, "rifle") || !str_cmp(argument, "rifles") || !str_cmp(argument, "blaster rifles") || !str_cmp(argument, "blaster rifle"))
 {
	if( HAS_FEAT2(ch, WEAP_PROF_RIFLES) )
	 {
	  if( HAS_FEAT2(ch, IMP_CRITICAL_RIFLES) )
	   {
		send_to_char( "&wYou already are a master with &bBlaster Rifles&w.\n\r", ch );
		return;
	   }
	  ch->unused_feats -= 1;
	  SET_BIT(ch->feats2, IMP_CRITICAL_RIFLES);
	  send_to_char( "&wYou have gained the &YImproved Critical Blaster Rifle&w feat.\n\r", ch );
	  return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats2, WEAP_PROF_RIFLES);
	send_to_char( "&wYou have gained the &YWeapon Proficiency Blaster Rifle&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "heavy") || !str_cmp(argument, "heavy weapon") || !str_cmp(argument, "heavy weapons") )
 {
	if( HAS_FEAT2(ch, WEAP_PROF_HEAVY) )
	 {
	  if( HAS_FEAT2(ch, IMP_CRITICAL_HEAVY) )
	   {
		send_to_char( "&wYou already are a master with &bHeavy Weapons&w.\n\r", ch );
		return;
	   }
	  ch->unused_feats -= 1;
	  SET_BIT(ch->feats2, IMP_CRITICAL_HEAVY);
	  send_to_char( "&wYou have gained the &YImproved Critical Heavy Weapon&w feat.\n\r", ch );
	  return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats2, WEAP_PROF_HEAVY);
	send_to_char( "&wYou have gained the &YWeapon Proficiency Heavy Weapons&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "primitive") )
 {
	if( HAS_FEAT2(ch, WEAP_PROF_PRIMITIVE) )
	 {
	  if( HAS_FEAT2(ch, IMP_CRITICAL_PRIMITIVE) )
	   {
		send_to_char( "&wYou already are a master with &bPrimitive Weapons&w.\n\r", ch );
		return;
	   }
	  ch->unused_feats -= 1;
	  SET_BIT(ch->feats2, IMP_CRITICAL_PRIMITIVE);
	  send_to_char( "&wYou have gained the &YImproved Critical Primitive Weapon&w feat.\n\r", ch );
	  return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats2, WEAP_PROF_PRIMITIVE);
	send_to_char( "&wYou have gained the &YWeapon Proficiency Primitive Weapon&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "simple") )
 {
	if( HAS_FEAT2(ch, WEAP_PROF_SIMPLE) )
	 {
	  if( HAS_FEAT2(ch, IMP_CRITICAL_SIMPLE) )
	   {
		send_to_char( "&wYou already are a master with &bSimple Weapons&w.\n\r", ch );
		return;
	   }
	  ch->unused_feats -= 1;
	  SET_BIT(ch->feats2, IMP_CRITICAL_SIMPLE);
	  send_to_char( "&wYou have gained the &YImproved Critical Simple Weapon&w feat.\n\r", ch );
	  return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats2, WEAP_PROF_SIMPLE);
	send_to_char( "&wYou have gained the &YWeapon Proficiency Simple Weapons&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "vibro") || !str_cmp(argument, "vibros"))
 {
	if( HAS_FEAT2(ch, WEAP_PROF_VIBRO) )
	 {
	  if( HAS_FEAT2(ch, IMP_CRITICAL_VIBRO) )
	   {
		send_to_char( "&wYou already are a master with &bVibro Weapons&w.\n\r", ch );
		return;
	   }
	  ch->unused_feats -= 1;
	  SET_BIT(ch->feats2, IMP_CRITICAL_VIBRO);
	  send_to_char( "&wYou have gained the &YImproved Critical Vibro Weapon&w feat.\n\r", ch );
	  return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats2, WEAP_PROF_VIBRO);
	send_to_char( "&wYou have gained the &YWeapon Proficiency Vibro Weapons&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "lightsaber") )
 {
	if( HAS_FEAT2(ch, WEAP_PROF_LIGHTSABER) )
	 {
	  if( HAS_FEAT2(ch, IMP_CRITICAL_LIGHTSABER) )
	   {
		send_to_char( "&wYou already are a master with &bLightsabers&w.\n\r", ch );
		return;
	   }
	  ch->unused_feats -= 1;
	  SET_BIT(ch->feats2, IMP_CRITICAL_LIGHTSABER);
	  send_to_char( "&wYou have gained the &YImproved Critical Lightsabers&w feat.\n\r", ch );
	  return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats2, WEAP_PROF_LIGHTSABER);
	send_to_char( "&wYou have gained the &YWeapon Proficiency Lightsabers&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "bowcaster") || !str_cmp( argument, "bowcasters" ))
 {
	if( HAS_FEAT2(ch, WEAP_PROF_BOWCASTER) )
	 {
	  if( HAS_FEAT2(ch, IMP_CRITICAL_BOWCASTER) )
	   {
		send_to_char( "&wYou already are a master with &bBowcasters&w.\n\r", ch );
		return;
	   }
	  ch->unused_feats -= 1;
	  SET_BIT(ch->feats2, IMP_CRITICAL_BOWCASTER);
	  send_to_char( "&wYou have gained the &YImproved Critical Bowcasters&w feat.\n\r", ch );
	  return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats2, WEAP_PROF_BOWCASTER);
	send_to_char( "&wYou have gained the &YWeapon Proficiency Bowcaster&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "light armor") )
 {
	if( HAS_FEAT2(ch, ARMOR_LIGHT) )
	 {
		send_to_char( "&wYou already have that fead.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats2, ARMOR_LIGHT);
	send_to_char( "&wYou have gained the &YLight Armor&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "medium armor") )
 {
	if( HAS_FEAT2(ch, ARMOR_MEDIUM) )
	 {
		send_to_char( "&wYou already have that fead.\n\r", ch );
		return;
	 }
	if( !HAS_FEAT2(ch, ARMOR_LIGHT) )
	 {
		send_to_char( "&wYou lack a requirement for this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats2, ARMOR_MEDIUM);
	send_to_char( "&wYou have gained the &YMedium Armor&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "heavy armor") )
 {
	if( HAS_FEAT2(ch, ARMOR_HEAVY) )
	 {
		send_to_char( "&wYou already have that fead.\n\r", ch );
		return;
	 }
	if( HAS_FEAT2(ch, ARMOR_MEDIUM) )
	 {
		send_to_char( "&wYou lack a requirement for this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats2, ARMOR_HEAVY);
	send_to_char( "&wYou have gained the &YHeavy Armor&w feat.\n\r", ch );
	return;
 }
 if( !str_cmp(argument, "powered armor") )
 {
	if( HAS_FEAT2(ch, ARMOR_POWERED) )
	 {
		send_to_char( "&wYou already have that fead.\n\r", ch );
		return;
	 }
	if( HAS_FEAT2(ch, ARMOR_MEDIUM) )
	 {
		send_to_char( "&wYou lack a requirement for this feat.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->feats2, ARMOR_POWERED);
	send_to_char( "&wYou have gained the &YPowered Armor&w feat.\n\r", ch );
	return;
 }

 send_to_char( "&wThat isn't a feat.\n\r", ch );
 return;
}

void do_ffeats( CHAR_DATA *ch, char *argument )
{
  if( IS_NPC(ch) )
	return;

  if( !HAS_FEAT(ch, FORCE_SENSITIVE) && !IS_IMMORTAL(ch) )
   {
	send_to_char( "Huh?\n\r", ch );
	return;
   }

  if( argument[0] == '\0' )
   {
     send_to_char( "&wAlter ", ch );
       if( HAS_FFEAT(ch, ALTER_FEAT) )
	send_to_char( "&r+&w\n\r", ch );
       else
	send_to_char( "\n\r", ch );
     if( IS_IMMORTAL(ch) || HAS_FFEAT(ch, ALTER_FEAT) )
      {
       if( IS_IMMORTAL(ch) || HAS_FFEAT(ch, CONTROL_FEAT) )
	{
	send_to_char( " &wFocus ", ch );
	 if( HAS_FFEAT(ch, FOCUS_FEAT) )
	  send_to_char( "&r+&w\n\r", ch );
	 else
	  send_to_char( "\n\r", ch );
	}
	send_to_char( " &wForce Flight ", ch );
	 if( HAS_FFEAT(ch, FORCE_FLIGHT) )
          send_to_char( "&r+&w\n\r", ch );
         else
          send_to_char( "\n\r", ch );
	send_to_char( " &wForce Whirlwind ", ch );
	 if( HAS_FFEAT(ch, FORCE_WHIRLWIND) )
          send_to_char( "&r+&w\n\r", ch );
         else
          send_to_char( "\n\r", ch );
	if( IS_IMMORTAL(ch) || ch->darkpoints >= 2 )
	 {
	  send_to_char( " &wHatred ", ch );
	   if( HAS_FFEAT(ch, HATRED_FEAT) )
	    send_to_char( "&r+&w\n\r", ch );
	   else
	    send_to_char( "\n\r", ch );
         }
	send_to_char( " &wMind Trick ", ch );
	 if( HAS_FFEAT(ch, MIND_TRICK) )
          send_to_char( "&r+&w\n\r", ch );
         else
          send_to_char( "\n\r", ch );
	send_to_char( "\n\r", ch );
       }
      send_to_char( "&wControl ", ch );
       if( HAS_FFEAT(ch, CONTROL_FEAT) )
	send_to_char( "&r+&w\n\r", ch );
       else
	send_to_char( "\n\r", ch );
      if( IS_IMMORTAL(ch) || HAS_FFEAT(ch, CONTROL_FEAT) )
       {
	send_to_char( " &wAttuned ", ch );
	 if( HAS_FFEAT(ch, ATTUNED_FEAT) )
          send_to_char( "&r+&w\n\r", ch );
         else
          send_to_char( "\n\r", ch );
	send_to_char( " &wDissipate Energy ", ch );
	 if( HAS_FFEAT(ch, DISSIPATE_ENERGY) )
          send_to_char( "&r+&w\n\r", ch );
         else
          send_to_char( "\n\r", ch );
	send_to_char( " &wLightsaber Defense ", ch );
	 if( HAS_FFEAT(ch, LIGHTSABER_DEFENSE) )
          send_to_char( "&r+&w\n\r", ch );
         else
          send_to_char( "\n\r", ch );
	send_to_char( " &wKnight Defense ", ch );
	 if( HAS_FFEAT(ch, KNIGHT_DEFENSE) )
          send_to_char( "&r+&w\n\r", ch );
         else
          send_to_char( "\n\r", ch );
	send_to_char( " &wMaster Defense ", ch );
	 if( HAS_FFEAT(ch, MASTER_DEFENSE) )
          send_to_char( "&r+&w\n\r", ch );
         else
          send_to_char( "\n\r", ch );
	send_to_char( " &wMettle ", ch );
	 if( HAS_FFEAT(ch, METTLE_FEAT) )
          send_to_char( "&r+&w\n\r", ch );
         else
          send_to_char( "\n\r", ch );
	send_to_char( " &wRage ", ch );
	 if( HAS_FFEAT(ch, RAGE_FEAT) )
          send_to_char( "&r+&w\n\r", ch );
         else
          send_to_char( "\n\r", ch );
	send_to_char( "\n\r", ch );
       }
      send_to_char( "&wSense ", ch );
       if( HAS_FFEAT(ch, SENSE_FEAT) )
	send_to_char( "&r+&w\n\r", ch );
       else
	send_to_char( "\n\r", ch );
      if( IS_IMMORTAL(ch) || HAS_FFEAT(ch, SENSE_FEAT) )
       {
	send_to_char( " &wAware ", ch );
	 if( HAS_FFEAT( ch, AWARE_FEAT) )
          send_to_char( "&r+&w\n\r", ch );
         else
          send_to_char( "\n\r", ch );
	send_to_char( " &wForce Mind ", ch );
	 if( HAS_FFEAT( ch, FORCE_MIND) )
          send_to_char( "&r+&w\n\r", ch );
         else
          send_to_char( "\n\r", ch );
	send_to_char( " &wImproved Force Mind ", ch );
	 if( HAS_FFEAT( ch, IMP_FORCE_MIND) )
	  send_to_char( "&r+&w\n\r", ch );
	 else
	  send_to_char( "\n\r", ch );
	send_to_char( " &wKnight Mind ", ch );
	 if( HAS_FFEAT( ch, KNIGHT_MIND) )
          send_to_char( "&r+&w\n\r", ch );
         else
          send_to_char( "\n\r", ch );
	send_to_char( " &wMaster Mind ", ch );
	 if( HAS_FFEAT( ch, MASTER_MIND) )
          send_to_char( "&r+&w\n\r", ch );
         else
          send_to_char( "\n\r", ch );
	send_to_char( " &wLink ", ch );
	 if( HAS_FFEAT( ch, LINK_FEAT) )
          send_to_char( "&r+&w\n\r", ch );
         else
          send_to_char( "\n\r", ch );
	if( IS_IMMORTAL(ch) || ch->darkpoints >= 6 )
	 {
	  send_to_char( " &wSith Sorcery ", ch );
	   if( HAS_FFEAT(ch, SITH_SORCERY) )
	    send_to_char( "&r+&w\n\r", ch );
	   else
	    send_to_char( "\n\r", ch );
	 }
	send_to_char( "\n\r", ch );
       }
    if( IS_IMMORTAL(ch) || ( HAS_FFEAT(ch, SENSE_FEAT) && HAS_FFEAT(ch, ALTER_FEAT) ) )
     {
	send_to_char( "&wMalevolent ", ch );
	 if( HAS_FFEAT( ch, MALEVOLENT_FEAT ) )
          send_to_char( "&r+&w\n\r", ch );
         else
          send_to_char( "\n\r", ch );
     }
    if( IS_IMMORTAL(ch) || ( HAS_FFEAT(ch, ALTER_FEAT) && HAS_FEAT(ch, CONTROL_FEAT) && HAS_FFEAT(ch, SITH_SORCERY) ) )
     {
	send_to_char( "&wDrain Force ", ch );
	 if( HAS_FFEAT(ch, DRAIN_FORCE ) )
	  send_to_char( "&r+&w\n\r", ch );
	 else
	  send_to_char( "\n\r", ch );
     }
    send_to_char( "\n\r", ch );
    ch_printf( ch, "&wYou have &b%d&w free feats.\n\r", ch->unused_feats );
    return;
   }

  if( ch->unused_feats < 1 )
   {
	send_to_char( "&wYou don't have any free feats.\n\r", ch );
	return;
   }

  if( !str_cmp(argument, "alter") )
   {
	if( HAS_FFEAT(ch, ALTER_FEAT) )
	 {
	  	send_to_char( "&wYou already possess this feat.\n\r", ch );
		return;
	 }
	if( !IS_FORCER(ch) )
	 {
		send_to_char( "&wOnly &YForcers&w can take Force feats.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->force_feats, ALTER_FEAT);
	send_to_char( "&wYou have gained the Force feat of &bAlter&w.\n\r", ch );
	return;
  }
 if( !str_cmp(argument, "focus") )
  {
	if( HAS_FFEAT(ch, FOCUS_FEAT) )
	 {
		send_to_char( "&wYou already possess that feat.\n\r", ch );
		return;
	 }
	if( !HAS_FFEAT(ch, ALTER_FEAT) || !HAS_FFEAT(ch, CONTROL_FEAT) )
	 {
		send_to_char( "&wYou lack one of the requirements.\n\r", ch );
		return;
	 }
	ch->unused_feats -= 1;
	SET_BIT(ch->force_feats, ALTER_FEAT);
	ch->force_level[FORCE_STRIKE] += 2;
	ch->force_level[FORCE_STEALTH] += 2;
	send_to_char( "&wYou have gained the Force feat &bFocus&w.\n\r", ch );
	return;
   }
  if( !str_cmp(argument, "force flight") )
   {
        if( HAS_FFEAT(ch, FORCE_FLIGHT) )
         {
                send_to_char( "&wYou already possess that feat.\n\r", ch );
                return;
         }
        if( !HAS_FFEAT(ch, ALTER_FEAT) || ch->force_level[MOVE_OBJECT] < 6 || ch->top_level < 7 )
         {
                send_to_char( "&wYou lack one of the requirements.\n\r", ch );
                return;
         }
	ch->unused_feats -= 1;
	SET_BIT(ch->force_feats, FORCE_FLIGHT);
	send_to_char( "&wYou have gained the Force feat &bForce Flight&w.\n\r", ch );
	return;
   }
  if( !str_cmp( argument, "force whirlwind" ) )
   {
        if( HAS_FFEAT(ch, FORCE_WHIRLWIND) )
         {
                send_to_char( "&wYou already possess that feat.\n\r", ch );
                return;
         }
        if( !HAS_FFEAT(ch, ALTER_FEAT) || get_curr_int(ch) < 13 || ch->force_level[MOVE_OBJECT] < 5 || ch->top_level < 6 )
         {
                send_to_char( "&wYou lack one of the requirements.\n\r", ch );
                return;
         }
	ch->unused_feats -= 1;
	SET_BIT(ch->force_feats, FORCE_WHIRLWIND);
	send_to_char( "&wYou have gained the Force feat &bForce Whirlwind&w.\n\r", ch );
	return;
   }
  if( !str_cmp( argument, "mind trick" ) )
   {
        if( HAS_FFEAT(ch, MIND_TRICK) )
         {
                send_to_char( "&wYou already possess that feat.\n\r", ch );
                return;
         }
        if( !HAS_FFEAT(ch, ALTER_FEAT) )
         {
                send_to_char( "&wYou lack one of the requirements.\n\r", ch );
                return;
         }
	ch->unused_feats -= 1;
	SET_BIT(ch->force_feats, MIND_TRICK);
	ch->force_level[AFFECT_MIND] += 2;
	ch->force_level[ILLUSION_SKILL] += 2;
	send_to_char( "&wYou gain the Force feat &bMind Trick&w.\n\r", ch );
	return;
   }
  if( !str_cmp(argument, "control") )
   {
        if( HAS_FFEAT(ch, CONTROL_FEAT) )
         {
                send_to_char( "&wYou already possess that feat.\n\r", ch );
                return;
         }
        if( !HAS_FEAT(ch, FORCE_SENSITIVE) || !IS_FORCER(ch) )
         {
                send_to_char( "&wYou lack one of the requirements.\n\r", ch );
                return;
         }
	ch->unused_feats -= 1;
	SET_BIT(ch->force_feats, CONTROL_FEAT);
	send_to_char( "&wYou gain the Force feat &bControl&w.\n\r", ch );
	return;
   }
  if( !str_cmp(argument, "attunded" ) )
   {
        if( HAS_FFEAT(ch, ATTUNED_FEAT) )
         {
                send_to_char( "&wYou already possess that feat.\n\r", ch );
                return;
         }
        if( !HAS_FFEAT(ch, CONTROL_FEAT) )
         {
                send_to_char( "&wYou lack one of the requirements.\n\r", ch );
                return;
         }
	ch->unused_feats -= 1;
	SET_BIT(ch->force_feats, ATTUNED_FEAT);
	ch->force_level[HEAL_SELF] += 2;
	ch->force_level[ENHANCE_ABILITY] += 2;
	send_to_char( "&wYou gain the Force feat &bAttuned&w.\n\r", ch );
	return;
   }
  if( !str_cmp(argument, "dissipate energy") )
   {
        if( HAS_FFEAT(ch, DISSIPATE_ENERGY) )
         {
                send_to_char( "&wYou already possess that feat.\n\r", ch );
                return;
         }
        if( !HAS_FFEAT(ch, CONTROL_FEAT) || ch->top_level < 4 )
         {
                send_to_char( "&wYou lack one of the requirements.\n\r", ch );
                return;
         }
	ch->unused_feats -= 1;
	SET_BIT(ch->force_feats, DISSIPATE_ENERGY);
	send_to_char( "&wYou gain the Force feat &bDissipate Energy&w.\n\r", ch );
	return;
   }
  if( !str_cmp(argument, "lightsaber defense") )
   {
        if( HAS_FFEAT(ch, LIGHTSABER_DEFENSE) )
         {
                send_to_char( "&wYou already possess that feat.\n\r", ch );
                return;
         }
        if( !HAS_FFEAT(ch, CONTROL_FEAT) || get_curr_dex(ch) < 13 || ch->top_level < 3
	 || !HAS_FEAT2(ch, WEAP_PROF_LIGHTSABER) )
         {
                send_to_char( "&wYou lack one of the requirements.\n\r", ch );
                return;
         }
	ch->unused_feats -= 1;
	SET_BIT(ch->force_feats, LIGHTSABER_DEFENSE);
	ch->lightsaber_defense += 2;
	send_to_char( "&wYou gain the Force feat &bLightsaber Defense&w.\n\r", ch );
	return;
   }
  if( !str_cmp(argument, "knight defense" ) )
   {
        if( HAS_FFEAT(ch, KNIGHT_DEFENSE) )
         {
                send_to_char( "&wYou already possess that feat.\n\r", ch );
                return;
         }
        if( !HAS_FFEAT(ch, LIGHTSABER_DEFENSE) || ch->top_level < 7)
         {
                send_to_char( "&wYou lack one of the requirements.\n\r", ch );
                return;
         }
	ch->unused_feats -= 1;
	SET_BIT(ch->force_feats, KNIGHT_DEFENSE);
	ch->lightsaber_defense += 2;
	send_to_char( "&wYou gain the Force feat &bKnight Defense&w.\n\r", ch );
	return;
   }
  if( !str_cmp(argument, "master defense") )
   {
        if( HAS_FFEAT(ch, MASTER_DEFENSE) )
         {
                send_to_char( "&wYou already possess that feat.\n\r", ch );
                return;
         }
        if( !HAS_FFEAT(ch, LIGHTSABER_DEFENSE) || ch->top_level < 11 )
         {
                send_to_char( "&wYou lack one of the requirements.\n\r", ch );
                return;
         }
	ch->unused_feats -= 1;
	ch->lightsaber_defense += 2;
	SET_BIT(ch->force_feats, MASTER_DEFENSE);
	send_to_char( "&wYou gain the Force feat &bMaster Defense&w.\n\r", ch );
	return;
   }
  if( !str_cmp(argument, "mettle") )
   {
        if( HAS_FFEAT(ch, METTLE_FEAT) )
         {
                send_to_char( "&wYou already possess that feat.\n\r", ch );
                return;
         }
        if( !HAS_FFEAT(ch, CONTROL_FEAT) )
         {
                send_to_char( "&wYou lack one of the requirements.\n\r", ch );
                return;
         }
	ch->unused_feats -= 1;
	SET_BIT(ch->force_feats, METTLE_FEAT);
	ch->force_level[FORCE_DEFENSE] += 2;
	ch->force_level[BATTLEMIND_SKILL] += 2;
	send_to_char( "&wYou gain the Force feat &bMettle&w.\n\r", ch );
	return;
   }
  if( !str_cmp(argument, "rage") )
   {
        if( HAS_FFEAT(ch, RAGE_FEAT) )
         {
                send_to_char( "&wYou already possess that feat.\n\r", ch );
                return;
         }
        if( !HAS_FFEAT(ch, CONTROL_FEAT) || ch->darkpoints < 2 )
         {
                send_to_char( "&wYou lack one of the requirements.\n\r", ch );
                return;
         }
	ch->unused_feats -= 1;
	SET_BIT(ch->force_feats, RAGE_FEAT);
	send_to_char( "&wYou gain the Force feat &bRage&w.\n\r", ch );
	return;
   }
  if( !str_cmp(argument, "sense") )
   {
        if( HAS_FFEAT(ch, SENSE_FEAT) )
         {
                send_to_char( "&wYou already possess that feat.\n\r", ch );
                return;
         }
        if( !HAS_FEAT(ch, FORCE_SENSITIVE) || !IS_FORCER(ch) )
         {
                send_to_char( "&wYou lack one of the requirements.\n\r", ch );
                return;
         }
	ch->unused_feats -= 1;	
	SET_BIT(ch->force_feats, SENSE_FEAT);
	send_to_char( "&wYou gain the Force feat &bSense&w.\n\r", ch );
	return;
   }
  if( !str_cmp(argument, "aware") )
   {
        if( HAS_FFEAT(ch, AWARE_FEAT) )
         {
                send_to_char( "&wYou already possess that feat.\n\r", ch );
                return;
         }
        if( !HAS_FFEAT(ch, SENSE_FEAT) )
         {
                send_to_char( "&wYou lack one of the requirements.\n\r", ch );
                return;
         }
	ch->unused_feats -= 1;
	ch->force_level[ENHANCE_SENSES] += 2;
	ch->force_level[SEE_FORCE] += 2;
	SET_BIT(ch->force_feats, AWARE_FEAT);
	send_to_char( "&wYou gain the Force feat &bAware&w.\n\r", ch );
	return;
   }
  if( !str_cmp(argument, "force mind") )
   {
        if( HAS_FFEAT(ch, FORCE_MIND) )
         {
                send_to_char( "&wYou already possess that feat.\n\r", ch );
                return;
         }
        if( !HAS_FFEAT(ch, SENSE_FEAT) || get_curr_wis(ch) < 15 || ch->top_level < 3 )
         {
                send_to_char( "&wYou lack one of the requirements.\n\r", ch );
                return;
         }
	ch->unused_feats -= 1;
	SET_BIT(ch->force_feats, FORCE_MIND);
	send_to_char( "&wYou gain the Force feat &bForce Mind&w.\n\r", ch );
	return;
   }
  if( !str_cmp( argument, "improved force mind" ) )
   {
        if( HAS_FFEAT(ch, IMP_FORCE_MIND) )
         {
                send_to_char( "&wYou already possess that feat.\n\r", ch );
                return;
         }
        if( !HAS_FFEAT(ch, SENSE_FEAT) || get_curr_wis(ch) < 15 || ch->top_level < 5 )
         {
                send_to_char( "&wYou lack one of the requirements.\n\r", ch );
                return;
         }
	ch->unused_feats -= 1;
	SET_BIT(ch->force_feats, IMP_FORCE_MIND);
	send_to_char( "&wYou gained the Force feat &bImproved Force Mind&w.\n\r", ch );
	return;
   }
  if( !str_cmp(argument, "knight mind") )
   {
        if( HAS_FFEAT(ch, KNIGHT_MIND) )
         {
                send_to_char( "&wYou already possess that feat.\n\r", ch );
                return;
         }
        if( !HAS_FFEAT(ch, FORCE_MIND) || ch->top_level < 7 )
         {
                send_to_char( "&wYou lack one of the requirements.\n\r", ch );
                return;
         }
	ch->unused_feats -= 1;
	SET_BIT(ch->force_feats, KNIGHT_MIND );
	send_to_char( "&wYou gained the Force feat &bKnight Mind&w.\n\r", ch );
	return;
   }
  if( !str_cmp( argument, "master mind") )
   {
        if( HAS_FFEAT(ch, MASTER_MIND) )
         {
                send_to_char( "&wYou already possess that feat.\n\r", ch );
                return;
         }
        if( !HAS_FFEAT(ch, FORCE_MIND) || ch->top_level < 11 )
         {
                send_to_char( "&wYou lack one of the requirements.\n\r", ch );
                return;
         }
	ch->unused_feats -= 1;
	SET_BIT(ch->force_feats, MASTER_MIND);
	send_to_char( "&wYou gained the Force feat &bMaster Mind&w.\n\r", ch );
	return;
   }
  if( !str_cmp( argument, "link" ) )
   {
        if( HAS_FFEAT(ch, LINK_FEAT) )
         {
                send_to_char( "&wYou already possess that feat.\n\r", ch );
                return;
         }
        if( !HAS_FFEAT(ch, SENSE_FEAT) )
         {
                send_to_char( "&wYou lack one of the requirements.\n\r", ch );
                return;
         }
	ch->unused_feats -= 1;
	SET_BIT(ch->force_feats, LINK_FEAT);
	ch->force_level[TELEPATHY_SKILL] += 2;
	ch->force_level[FARSEEING_SKILL] += 2;
	send_to_char( "&wYou gained the Force feat &bLink&w.\n\r", ch );
	return;
   }
  if( !str_cmp( argument, "malevolent" ) )
   {
        if( HAS_FFEAT(ch, MALEVOLENT_FEAT) )
         {
                send_to_char( "&wYou already possess that feat.\n\r", ch );
                return;
         }
        if( !HAS_FFEAT(ch, ALTER_FEAT) || !HAS_FFEAT(ch, SENSE_FEAT) )
         {
                send_to_char( "&wYou lack one of the requirements.\n\r", ch );
                return;
         }
	ch->unused_feats -= 1;
	SET_BIT(ch->force_feats, MALEVOLENT_FEAT);
	ch->force_level[FEAR_SKILL] += 2;
	ch->force_level[FORCE_GRIP] += 2;
	send_to_char( "&wYou gained the Force feat &bMalevolent&w.\n\r", ch );
	return;
   }
  send_to_char( "&wThat isn't a feat.\n\r", ch );
  return;
}

void level_class( CHAR_DATA *ch, int ability )
{
  int level, gain, skill;

  if( IS_NPC(ch) )
     return;

  if( ability < 0 || ability >= MAX_ABILITY )
   {
	bug( "&rlevel_class: ability out of range&w\n\r", 0);
	return;
   }
  if( ability == AEROBAT_ABILITY )
   {
     ch->class_level[AEROBAT_ABILITY] += 1;
     level = ch->class_level[AEROBAT_ABILITY];
     gain = number_range(1, 8);
     gain += stat_table[get_curr_con(ch)].mod;
     if( gain < 1 )
        gain = 1;
     skill = 4 + stat_table[get_curr_int(ch)].mod;
     ch->skillpoints += skill;
     if( level != 1 && level != level != 5  && level != 9 )
        ch->hitroll += 1;
     if( level == 1 )
      {
	ch->reflexes += 3;
	ch->aerial_defense += 2;
      }
     if( level == 2 )
      {
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->armor += 1;
      }
     if( level == 3 )
	ch->reputation += 1;
     if( level == 4 )
      {
	ch->reflexes += 1;
	ch->armor += 1;
	SET_BIT(ch->feats3, AERIAL_EVASION);
      }
     if( level == 5 )
      {
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->unused_feats += 1;
      }
     if( level == 6 )
	ch->reflexes += 1;
     if( level == 7 )
      {
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 8 )
      {
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
      }
     if( level == 9 )
      {
	ch->armor += 1;
	ch->aerial_defense += 2;
      }
     if( level == 10 )
      {
	ch->reflexes += 1;
	ch->unused_feats += 1;
      }
     return;
    }
  if( ability == MYSTICAGENT_ABILITY )
   {
     ch->class_level[MYSTICAGENT_ABILITY] += 1;
     level = ch->class_level[MYSTICAGENT_ABILITY];
     gain = number_range(1, 6);
     gain += stat_table[get_curr_con(ch)].mod;
     if( gain < 1 )
        gain = 1;
     skill = 6 + stat_table[get_curr_int(ch)].mod;
     ch->skillpoints += skill;
     if( level != 1 && level != level != 5 && level != 9 )
        ch->hitroll += 1;
     if( level == 1 )
      {
	ch->willpower += 3;
	ch->reflexes += 1;
	ch->armor += 1;
      }
     if( level == 2 )
      {
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->armor += 1;
      }
     if( level == 3 )
	ch->willpower += 2;
     if( level == 4 )
      {
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->unused_feats += 1;
	ch->unused_feats += 1;
	ch->armor += 1;
      }
     if( level == 5 )
      {
	ch->fortitude += 1;
	ch->willpower += 2;
	ch->reputation += 1;
      }
     if( level == 6 )
      {
	ch->armor += 1;
	ch->willpower += 1;
      }
     if( level == 7 )
      {
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->unused_feats += 1;
      }
     if( level == 8 )
      {
	ch->fortitude += 1;
	ch->willpower += 2;
	ch->armor += 1;
      }
     if( level == 9 )
      {
	ch->willpower += 1;
	ch->reputation += 1;
      }
     if( level == 10 )
      {
	ch->reflexes += 1;
	ch->willpower += 2;
	ch->unused_feats += 1;
	ch->armor += 1;
      }
     return;
    }
  if( ability == ESPIONAGE_ABILITY )
   {
     ch->class_level[ESPIONAGE_ABILITY] += 1;
     level = ch->class_level[ESPIONAGE_ABILITY];
     gain = number_range(1, 6);
     gain += stat_table[get_curr_con(ch)].mod;
     if( gain < 1 )
        gain = 1;
     skill = 6 + stat_table[get_curr_int(ch)].mod;
     ch->skillpoints += skill;
     if( level != 1 && level != level != 5 )
	ch->hitroll += 1;
     if( level == 1 )
      {
	ch->fortitude += 1;
	ch->willpower += 2;
	ch->reflexes += 1;
	if( !HAS_FEAT2(ch, WEAP_PROF_SIMPLE) )
	 SET_BIT(ch->feats2, WEAP_PROF_SIMPLE);
	if( !HAS_FEAT2(ch, WEAP_PROF_PISTOLS) )
	 SET_BIT(ch->feats2, WEAP_PROF_PISTOLS);
	ch->armor += 1;
      }
     if( level == 2 )
      {
	ch->reflexes += 1;
	ch->armor += 1;
      }
     if( level == 3 )
      {
	ch->fortitude += 1;
	ch->willpower += 1;
      }
     if( level == 4 )
	ch->reputation += 1;
     if( level == 5 )
      {
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->reflexes += 1;
	ch->armor += 1;
      }
     return;
   }
  if( ability == BERSERKER_ABILITY )
   {
     ch->class_level[BERSERKER_ABILITY] += 1;
     level = ch->class_level[BERSERKER_ABILITY];
     gain = number_range(1, 8);
     gain += stat_table[get_curr_con(ch)].mod;
     if( gain < 1 )
        gain = 1;
     skill = 6 + stat_table[get_curr_int(ch)].mod;
     ch->skillpoints += skill;
     if( level != 1 && level != 5 )
	ch->hitroll += 1;
     if( level == 1 )
      {
	ch->fortitude += 1;
	ch->reflexes += 2;
	ch->willpower += 1;
	ch->armor += 2;
	if( !HAS_FEAT2(ch, WEAP_PROF_PISTOLS) )
	 SET_BIT(ch->feats2, WEAP_PROF_PISTOLS);
	if( !HAS_FEAT2(ch, WEAP_PROF_RIFLES) )
	 SET_BIT(ch->feats2, WEAP_PROF_RIFLES);
	if( !HAS_FEAT2(ch, WEAP_PROF_SIMPLE) )
	 SET_BIT(ch->feats2, WEAP_PROF_SIMPLE);
     }
    if( level == 2 )
     {
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->unused_feats += 1;
	ch->armor += 1;
	ch->reputation += 1;
     }
    if( level == 3 )
	ch->sneak_attack += 2;
    if( level == 4 )
     {
	ch->reflexes += 1;
	ch->unused_feats += 1;
	ch->armor += 1;
     }
    if( level == 5 )
     {
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->reputation += 1;
     }
    return;
   }
  if( ability == FRINGER_ABILITY )
   {
     ch->class_level[FRINGER_ABILITY] += 1;
     level = ch->class_level[FRINGER_ABILITY];
     if( level == 1 )
    	gain = 8;
     else
	gain = number_range(1, 8);
     gain += stat_table[get_curr_con(ch)].mod;
     if( gain < 1 )
	gain = 1;
     ch->hit += gain;
     ch->max_hit += gain;
     skill = (6 + stat_table[get_curr_int(ch)].mod);
     if( level == 1 )
	skill *= 4;
     ch->skillpoints += skill;
     if( level == 1 )
      {
	SET_BIT(ch->feats2, WEAP_PROF_PRIMITIVE);
	SET_BIT(ch->feats2, WEAP_PROF_SIMPLE);
	ch->fortitude += 2;
	ch->reflexes += 1;
	ch->unused_feats += 1;
	ch->armor += 3;
      }
     if( level == 2 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->armor += 1;
	SET_BIT(ch->feats2, BARTER_FEAT);
      }
     if( level == 3 )
      {
	ch->hitroll += 1;
	ch->willpower += 1;
	ch->jury_rig += 2;
      }
     if( level == 4 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
      }
     if( level == 5 )
      {
	ch->reflexes += 1;
	ch->skill_level[SURVIVAL_SKILL] += 2;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 6 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->jury_rig += 2;
      }
     if( level == 7 )
      {
	ch->hitroll += 1;
	ch->reflexes += 1;
	ch->unused_feats += 1;
	ch->armor += 1;
      }
     if( level == 8 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
      }
     if( level == 9 )
      {
	ch->willpower += 1;
	ch->jury_rig += 2;
	ch->reputation += 1;
      }
     if( level == 10 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->skill_level[SURVIVAL_SKILL] += 2;
	ch->armor += 1;
      }
     if( level == 11 )
	ch->hitroll += 1;
     if( level == 12 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->armor += 1;
      }
     if( level == 13 )
      {
	ch->reputation += 1;
	ch->jury_rig += 2;
      }
     if( level == 14 )
      {
	ch->hitroll += 1;
	ch->unused_feats += 1;
      }
     if( level == 15 )
      {
	ch->hitroll += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->armor += 1;
      }
     if( level == 16 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
      }
     if( level == 17 )
      {
	ch->reflexes += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 18 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->skill_level[SURVIVAL_SKILL] += 2;
      }
     if( level == 19 )
	ch->hitroll += 1;
     if( level == 20 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->unused_feats += 1;
	ch->armor += 1;
      }
     return;
    }
   if( ability == NOBLE_ABILITY )
    {
     ch->class_level[NOBLE_ABILITY] += 1;
     level = ch->class_level[NOBLE_ABILITY];
     if( level == 1 )
        gain = 6;
     else
        gain = number_range(1, 6);
     gain += stat_table[get_curr_con(ch)].mod;
     if( gain < 1 )
        gain = 1;
     ch->hit += gain;
     ch->max_hit += gain;
     skill = (6 + stat_table[get_curr_int(ch)].mod);
     if( level == 1 )
        skill *= 4;
     ch->skillpoints += skill;
     if( level == 1 )
      {
	SET_BIT(ch->feats2, WEAP_PROF_SIMPLE);
	SET_BIT(ch->feats2, WEAP_PROF_PISTOLS);
	ch->reflexes += 1;
	ch->willpower += 2;
	ch->armor += 2;
	ch->reputation += 1;
      }
     if( level == 2 )
      {
	ch->hitroll += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->armor += 1;
      }
     if( level == 3 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
      }
     if( level == 4 )
      {
	ch->hitroll += 1;
	ch->willpower += 1;
	ch->coordinate += 1;
	ch->reputation += 1;
      }
     if( level == 5 )
      {
	ch->reflexes += 1;
	ch->armor += 1;
      }
     if( level == 6 )
      {
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->unused_feats += 1;	
      }
     if( level == 7 )
      {
	ch->hitroll += 1;
	ch->reflexes += 1;
	ch->armor += 1;
      }
     if( level == 8 )
      {
	ch->hitroll += 1;
	ch->willpower += 1;
	ch->coordinate += 1;
	ch->reputation += 1;
      }
     if( level == 9 )
      {
	ch->fortitude += 1;
	ch->unused_feats += 1;
	ch->unused_feats += 1;
      }
     if( level == 10 )
      {
	ch->hitroll += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->armor += 1;
      }
     if( level == 11 )
	ch->hitroll += 1;
     if( level == 12 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 13 )
	ch->coordinate += 1;
     if( level == 14 )
      {
	ch->hitroll += 1;
	ch->willpower += 1;
	ch->unused_feats += 1;
      }
     if( level == 15 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->armor += 1;
      }
     if( level == 16 )
      {
	ch->hitroll += 1;
	ch->willpower += 1;
	ch->reputation += 1;
      }
     if( level == 17 )
      {
	ch->reflexes += 1;
	ch->armor += 1;
      }
     if( level == 18 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->coordinate += 1;
      }
     if( level == 19 )
      {
	ch->hitroll += 1;
	ch->unused_feats += 1;
      }
     if( level == 20 )
      {
	ch->hitroll += 1;
	ch->willpower += 1;
	ch->coordinate += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     return;
   }
  if( ability == SCOUNDREL_ABILITY )
   {
     ch->class_level[SCOUNDREL_ABILITY] += 1;
     level = ch->class_level[SCOUNDREL_ABILITY];
     if( level == 1 )
        gain = 6;
     else
        gain = number_range(1, 6);
     gain += stat_table[get_curr_con(ch)].mod;
     if( gain < 1 )
        gain = 1;
     ch->hit += gain;
     ch->max_hit += gain;
     skill = (8 + stat_table[get_curr_int(ch)].mod);
     if( level == 1 )
        skill *= 4;
     ch->skillpoints += skill;
     if( level == 1 )
      {
	SET_BIT(ch->feats2, WEAP_PROF_SIMPLE);
	SET_BIT(ch->feats2, WEAP_PROF_PISTOLS);
	ch->reflexes += 2;
	SET_BIT(ch->feats2, ILLICIT_BARTER);
	ch->armor += 2;
      }
     if( level == 2 )
      {
	ch->hitroll += 1;
	ch->reflexes += 1;
      }
     if( level == 3 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->precise_attack += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 4 )
      {
	ch->hitroll += 1;
	ch->reflexes += 1;
	ch->skillpoints += 5;
      }
     if( level == 5 )
      {
	ch->unused_feats += 1;
	ch->armor += 1;
      }
     if( level == 6 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->reflexes += 1;
      }
     if( level == 7 )
      {
	ch->hitroll += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 8 )
      {
	ch->hitroll += 1;
	ch->reflexes += 1;
	ch->skillpoints += 5;
      }
     if( level == 9 )
      {
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->precise_attack += 1;
	ch->armor += 1;
      }
     if( level == 10 )
      {
	ch->hitroll += 1;
	ch->reflexes += 1;
	ch->unused_feats += 1;
      }
     if( level == 11 )
      {
	ch->hitroll += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 12 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->skillpoints += 5;
      }
     if( level == 13 )
	ch->armor += 1;
     if( level == 14 )
      {
	ch->hitroll += 1;
	ch->reflexes += 1;
	ch->precise_attack += 1;
      }
     if( level == 15 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->unused_feats += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 16 )
      {
	ch->hitroll += 1;
	ch->reflexes += 1;
	ch->skillpoints += 5;
      }
     if( level == 17 )
	ch->armor += 1;
     if( level == 18 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->willpower += 1;
      }
     if( level == 19 )
      {
	ch->hitroll += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 20 )
      {
	ch->hitroll += 1;
	ch->reflexes += 1;
	ch->skillpoints += 5;
      }
     return;
    }
   if( ability == SCOUT_ABILITY )
    {
     ch->class_level[SCOUT_ABILITY] += 1;
     level = ch->class_level[SCOUT_ABILITY];
     if( level == 1 )
        gain = 8;
     else
        gain = number_range(1, 8);
     gain += stat_table[get_curr_con(ch)].mod;
     if( gain < 1 )
        gain = 1;
     ch->hit += gain;
     ch->max_hit += gain;
     skill = (6 + stat_table[get_curr_int(ch)].mod);
     if( level == 1 )
        skill *= 4;
     ch->skillpoints += skill;
     if( level == 1 )
      {
	SET_BIT(ch->feats2, WEAP_PROF_PISTOLS);
	SET_BIT(ch->feats2, WEAP_PROF_RIFLES);
	SET_BIT(ch->feats2, WEAP_PROF_SIMPLE);
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;	
	ch->unused_feats += 1;
	ch->armor += 2;
      }
     if( level == 2 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	SET_BIT(ch->feats2, TRAILBLAZING_FEAT);
      }
     if( level == 3 )
      {
	ch->hitroll += 1;
	ch->armor += 1;
	ch->heart += 1;
      }
     if( level == 4 )
      {
	ch->hitroll += 1;
	ch->reputation += 1;
	SET_BIT(ch->feats2, UNCANNY_DODGE);
      }
     if( level == 5 )
      {
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->armor += 1;
      }
     if( level == 6 )
	ch->hitroll += 1;
     if( level == 7 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;	
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->armor += 1;
      }
     if( level == 8 )
      {
	ch->hitroll += 1;
	ch->unused_feats += 1;
	ch->reputation += 1;
      }
     if( level == 9 )
	ch->armor += 1;
     if( level == 10 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
      }
     if( level == 11 )
      {
	ch->hitroll += 1;
	ch->heart += 1;
	ch->armor += 1;
      }
     if( level == 12 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->unused_feats += 1;
	ch->reputation += 1;
      }
     if( level == 13 )
	ch->armor += 1;
     if( level == 14 )
      {
	ch->hitroll += 1;
	ch->heart += 1;
      }
     if( level == 15 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->reflexes += 1;
	ch->armor += 1;
      }
     if( level == 16 )
      {
	ch->hitroll += 1;
	ch->unused_feats += 1;
	ch->reputation += 1;
      }
     if( level == 17 )
      {
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->armor += 1;
      }
     if( level == 18 )
      {
	ch->hitroll += 1;
	ch->heart += 1;
      }
     if( level == 19 )
      {
	ch->hitroll += 1;
	ch->armor += 1;
      }
     if( level == 20 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->reputation += 1;
      }
     return;
    }
   if( ability == SOLDIER_ABILITY )
    {
     ch->class_level[SOLDIER_ABILITY] += 1;
     level = ch->class_level[SOLDIER_ABILITY];
     if( level == 1 )
        gain = 10;
     else
        gain = number_range(1, 10);
     gain += stat_table[get_curr_con(ch)].mod;
     if( gain < 1 )
        gain = 1;
     ch->hit += gain;
     ch->max_hit += gain;
     skill = (4 + stat_table[get_curr_int(ch)].mod);
     if( level == 1 )
        skill *= 4;
     ch->skillpoints += skill;
     ch->hitroll += 1;
     if( level == 1 )
      {
	SET_BIT(ch->feats2, WEAP_PROF_PISTOLS);
	SET_BIT(ch->feats2, WEAP_PROF_RIFLES);
	SET_BIT(ch->feats2, WEAP_PROF_HEAVY);
	SET_BIT(ch->feats2, WEAP_PROF_SIMPLE);
	SET_BIT(ch->feats2, WEAP_PROF_VIBRO);
	ch->fortitude += 2;
	ch->armor += 3;
      }
     if( level == 2 )
      {
	ch->fortitude += 1;
	ch->unused_feats += 1;
	ch->reputation += 1;
      }
     if( level == 3 )
      {
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->unused_feats += 1;
	ch->armor += 1;
      }
     if( level == 4 )
      {
	ch->fortitude += 1;
	ch->unused_feats += 1;
      }
     if( level == 5 )
	ch->armor += 1;
     if( level == 6 )
      {
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->unused_feats += 1;
	ch->reputation += 1;
      }
     if( level == 7 )
	ch->armor += 1;
     if( level == 8 )
      {
	ch->fortitude += 1;
	ch->unused_feats += 1;
      }
     if( level == 9 )
      {
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->armor += 1;
      }
     if( level == 10 )
      {
	ch->fortitude += 1;
	ch->unused_feats += 1;
	ch->reputation += 1;
      }
     if( level == 11 )
	ch->armor += 1;
     if( level == 12 )
      {
	ch->fortitude += 1;
	ch->unused_feats += 1;
      }
     if( level == 13 )
	ch->armor += 1;
     if( level == 14 )
      {
	ch->fortitude += 1;
	ch->unused_feats += 1;
	ch->reputation += 1;
      }
     if( level == 15 )
      {
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->armor += 1;
      }
     if( level == 16 )
      {
	ch->fortitude += 1;
	ch->unused_feats += 1;
      }
     if( level == 17 )
	ch->armor += 1;
     if( level == 18 )
      {
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->unused_feats += 1;
	ch->reputation += 1;
      }
     if( level == 19 )
      	ch->armor += 1;
     if( level == 20 )
      {
	ch->fortitude += 1;
	ch->unused_feats += 1;
      }
     return;
    }
   if( ability == TECH_SPEC_ABILITY )
    {
     ch->class_level[TECH_SPEC_ABILITY] += 1;
     level = ch->class_level[TECH_SPEC_ABILITY];
     if( level == 1 )
        gain = 6;
     else
        gain = number_range(1, 6);
     gain += stat_table[get_curr_con(ch)].mod;
     if( gain < 1 )
        gain = 1;
     ch->hit += gain;
     ch->max_hit += gain;
     skill = (4 + stat_table[get_curr_int(ch)].mod);
     if( level == 1 )
        skill *= 4;
     ch->skillpoints += skill;
     if( level == 1 )
      {
	SET_BIT(ch->feats2, WEAP_PROF_SIMPLE);
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->skillpoints += 5;
	ch->armor += 2;
      }
     if( level == 2 )
      {
	ch->hitroll += 1;
	ch->armor += 1;
      }
     if( level == 3 )
      {
	ch->hitroll += 1;
	ch->willpower += 1;
	ch->skillpoints += 5;
	ch->reputation += 1;
      }
     if( level == 4 )
      {
	ch->hitroll += 1;
	ch->reflexes += 1;
	ch->specialty += 1;
      }
     if( level == 5 )
	ch->armor += 1;
     if( level == 6 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
      }
     if( level == 7 )
      {
	ch->hitroll += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 8 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->specialty += 1;
      }
     if( level == 9 )
       	ch->reflexes += 1;
     if( level == 10 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->armor += 1;
      }
     if( level == 11 )
      {
	ch->hitroll += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->specialty += 1;
	ch->reputation += 1;
      }
     if( level == 12 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->armor += 1;
      }
     if( level == 13 )
	ch->willpower += 1;
     if( level == 14 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->specialty += 1;
      }
     if( level == 15 )
      {
	ch->hitroll += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 16 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->skillpoints += 5;
      }
     if( level == 17 )
      {
	ch->specialty += 1;
	ch->armor += 1;
      }
     if( level == 18 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->willpower += 1;
      }
     if( level == 19 )
      {
	ch->hitroll += 1;
	ch->reflexes += 1;
	ch->specialty += 1;
	ch->reputation += 1;
      }
     if( level == 20 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->armor += 1;
      }
     return;
    }
   if( ability == FORCE_ADEPT_ABILITY )
    {
     ch->class_level[FORCE_ADEPT_ABILITY] += 1;
     level = ch->class_level[FORCE_ADEPT_ABILITY];
     if( level == 1 )
        gain = 8;
     else
        gain = number_range(1, 8);
     gain += stat_table[get_curr_con(ch)].mod;
     if( gain < 1 )
        gain = 1;
     ch->hit += gain;
     ch->max_hit += gain;
     skill = (6 + stat_table[get_curr_int(ch)].mod);
     if( level == 1 )
        skill *= 4;
     ch->skillpoints += skill;
     if( level == 1 )
      {
	SET_BIT(ch->feats2, WEAP_PROF_SIMPLE);
	SET_BIT(ch->feats2, WEAP_PROF_PRIMITIVE);
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 2;
	ch->armor += 3;
	ch->unused_feats += 1;
      }
     if( level == 2 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->reflexes += 1;
	ch->unused_feats += 1;
	ch->armor += 1;
      }
     if( level == 3 )
      {
	ch->hitroll += 1;
	ch->unused_feats += 1;
      }
     if( level == 4 )
      {
	ch->hitroll += 1;
	ch->willpower += 1;
	ch->unused_feats += 1;
      }
     if( level == 5 )
      {
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->force_weapon += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 6 )
      {
	ch->hitroll += 1;
	ch->willpower += 1;
	ch->skillpoints += 5;
      }
     if( level == 7 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->armor += 1;
      }
     if( level == 8 )
      {
	ch->hitroll += 1;
	ch->willpower += 1;
	ch->talisman += 2;
      }
     if( level == 9 )
      {
	ch->unused_feats += 1;
	ch->reputation += 1;
      }
     if( level == 10 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->armor += 1;
      }
     if( level == 11 )
      {
	ch->hitroll += 1;
	ch->secret += 1;
      }
     if( level == 12 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->reflexes += 1;
	ch->armor += 1;
	ch->skillpoints += 5;
      }
     if( level == 13 )
      {
	ch->force_weapon += 1;
	ch->reputation += 1;
      }
     if( level == 14 )
      {
	ch->hitroll += 1;
	ch->willpower += 1;
	ch->unused_feats += 1;
      }
     if( level == 15 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->talisman += 2;
	ch->armor += 1;
      }
     if( level == 16 )
      {
	ch->hitroll += 1;
	ch->willpower += 1;
	ch->secret += 1;
      }
     if( level == 17 )
      {
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 18 )
      {
	ch->hitroll += 1;
	ch->willpower += 1;
	ch->skillpoints += 5;
      }
     if( level == 19 )
	ch->hitroll += 1;
     if( level == 20 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->unused_feats += 1;
	ch->armor += 1;
      }
     return;
    }
   if( ability == JEDICONSULAR_ABILITY )
    {
     ch->class_level[JEDICONSULAR_ABILITY] += 1;
     level = ch->class_level[JEDICONSULAR_ABILITY];
     if( level == 1 )
        gain = 8;
     else
        gain = number_range(1, 8);
     gain += stat_table[get_curr_con(ch)].mod;
     if( gain < 1 )
        gain = 1;
     ch->hit += gain;
     ch->max_hit += gain;
     skill = (6 + stat_table[get_curr_int(ch)].mod);
     if( level == 1 )
        skill *= 4;
     ch->skillpoints += skill;
     if( level == 1 )
      {
	SET_BIT(ch->feats2, WEAP_PROF_LIGHTSABER);
	SET_BIT(ch->feats2, WEAP_PROF_PISTOLS);
	SET_BIT(ch->feats2, WEAP_PROF_SIMPLE);
	SET_BIT(ch->feats, FORCE_SENSITIVE);
	ch->fortitude += 2;
	ch->reflexes += 1;
	ch->willpower += 2;
	ch->unused_feats += 1;
	ch->deflect_defense += 1;
	ch->armor += 3;
	ch->reputation += 1;
      }
     if( level == 2 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->unused_feats += 1;
	ch->armor += 1;
      }
     if( level == 3 )
      {
	ch->hitroll += 1;
	ch->unused_feats += 1;
	ch->deflect_attack += 4;
      }
     if( level == 4 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->unused_feats += 1;
	ch->reputation += 1;
      }
     if( level == 5 )
      {
	ch->reflexes += 1;
	ch->armor += 1;
      }
     if( level == 6 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->force_weapon += 1;
      }
     if( level == 7 )
      {
	ch->hitroll += 1;
	ch->reflexes += 1;
	ch->armor += 1;
	ch->unused_feats += 1;
      }
     if( level == 8 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->reputation += 1;
      }
     if( level == 9 )
	ch->skillpoints += 5;
     if( level == 10 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->reflexes += 1;	
	ch->willpower += 1;
	ch->deflect_defense += 1;
	ch->armor += 1;
      }
     if( level == 11 )
      {
	ch->hitroll += 1;
	ch->unused_feats += 1;
      }
     if( level == 12 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->force_weapon += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 13 )
     	ch->deflect_attack -= 1;
     if( level == 14 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->skillpoints += 5;
      }
     if( level == 15 )
      {
	ch->hitroll += 1;
	ch->reflexes += 1;
	ch->deflect_defense += 1;
	ch->armor += 1;
      }
     if( level == 16 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->unused_feats += 1;
	ch->reputation += 1;
      }
     if( level == 17 )
      {
	ch->reflexes += 1;
	ch->deflect_attack -= 1;
	ch->armor += 1;
      }
     if( level == 18 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->force_weapon += 1;
      }
     if( level == 19 )
      {
	ch->hitroll += 1;
	ch->skillpoints += 5;
      }
     if( level == 20 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     return;
    }
   if( ability == JEDIGUARDIAN_ABILITY )
    {
     ch->class_level[JEDIGUARDIAN_ABILITY] += 1;
     level = ch->class_level[JEDIGUARDIAN_ABILITY];
     if( level == 1 )
        gain = 10;
     else
        gain = number_range(1, 10);
     gain += stat_table[get_curr_con(ch)].mod;
     if( gain < 1 )
        gain = 1;
     ch->hit += gain;
     ch->max_hit += gain;
     skill = (4 + stat_table[get_curr_int(ch)].mod);
     if( level == 1 )
        skill *= 4;
     ch->skillpoints += skill;
     ch->hitroll += 1;
     if( level == 1 )
      {
	SET_BIT(ch->feats2, WEAP_PROF_LIGHTSABER);
	SET_BIT(ch->feats2, WEAP_PROF_PISTOLS);
	SET_BIT(ch->feats2, WEAP_PROF_SIMPLE);
	SET_BIT(ch->feats, FORCE_SENSITIVE);
	ch->fortitude += 2;
	ch->reflexes += 2;
	ch->willpower += 1;
	ch->deflect_defense += 1;
	ch->unused_feats += 1;
	ch->armor += 3;
	ch->reputation += 1;
      }
     if( level == 2 )
      {
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->unused_feats += 1;
      }
     if( level == 3 )
      {
	ch->unused_feats += 1;
	ch->deflect_attack += 4;
	ch->armor += 1;
      }
     if( level == 4 )
      {
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->unused_feats += 1;
      }
     if( level == 5 )
      {
	ch->willpower += 1;
	ch->force_weapon += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 6 )
      {
	ch->fortitude += 1;
	ch->reflexes += 1;
      }
     if( level == 7 )
      {
	ch->willpower += 1;
	ch->unused_feats += 1;
	ch->armor += 1;
      }
     if( level == 8 )
      {
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->unused_feats += 1;
      }
     if( level == 9 )
      {
	ch->deflect_defense += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 10 )
      {
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->force_weapon += 1;
      }
     if( level == 11 )
      {
	ch->deflect_attack -= 1;
	ch->armor += 1;
      }
     if( level == 12 )
      {
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->reflexes += 1;
	ch->unused_feats += 1;
      }
     if( level == 13 )
      {
	ch->deflect_defense += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 14 )
      {
	ch->fortitude += 1;
	ch->reflexes += 1;
      }
     if( level == 15 )
      {
	ch->willpower += 1;
	ch->force_weapon += 1;
	ch->armor += 1;
      }
     if( level == 16 )
      {
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->deflect_attack -= 1;
      }
     if( level == 17 )
      {
	ch->willpower += 1;
	ch->deflect_defense += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 18 )
      {
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->unused_feats += 1;
      }
     if( level == 19 )
      {
	ch->deflect_attack -= 1;
	ch->armor += 1;
      }
     if( level == 20 )
      {
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->force_weapon += 1;
      }
     return;
    }
  if( ability == BOUNTYHUNTER_ABILITY )
   {
     ch->class_level[BOUNTYHUNTER_ABILITY] += 1;
     level = ch->class_level[BOUNTYHUNTER_ABILITY];
     gain = number_range(1, 10);
     gain += stat_table[get_curr_con(ch)].mod;
     if( gain < 1 )
        gain = 1;
     ch->hit += gain;
     ch->max_hit += gain;
     skill = (6 + stat_table[get_curr_int(ch)].mod);
     ch->skillpoints += skill;
     ch->hitroll += 1;
     if( level == 1 )
      {
        if( !HAS_FEAT2(ch, WEAP_PROF_PISTOLS) )
	 SET_BIT(ch->feats2, WEAP_PROF_PISTOLS);
	if( !HAS_FEAT2(ch, WEAP_PROF_RIFLES) )
	 SET_BIT(ch->feats2, WEAP_PROF_RIFLES);
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->target += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 2 )
      {
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->sneak_attack += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 3 )
	ch->target += 1;
     if( level == 4 )
      {
	ch->sneak_attack += 1;
	ch->reputation += 1;
      }
     if( level == 5 )
      {
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->reflexes += 1;
	ch->target += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 6 )
	ch->sneak_attack += 1;
     if( level == 7 )
      {
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->target += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 8 )
      {
	ch->sneak_attack += 1;
	ch->reputation += 1;
      }
     if( level == 9 )
     	ch->target += 1;
     if( level == 10 )
      {
	ch->fortitude += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->sneak_attack += 1;
	ch->armor += 1;
	ch->willpower += 1;
      }
     return;
    }
   if( ability == CRIMELORD_ABILITY )
    {
     ch->class_level[CRIMELORD_ABILITY] += 1;
     level = ch->class_level[CRIMELORD_ABILITY];
     gain = number_range(1, 10);
     gain += stat_table[get_curr_con(ch)].mod;
     if( gain < 1 )
        gain = 1;
     ch->hit += gain;
     ch->max_hit += gain;
     skill = (6 + stat_table[get_curr_int(ch)].mod);
     ch->skillpoints += skill;
     if( level == 1 )
      {
	if( !HAS_FEAT2(ch, WEAP_PROF_PISTOLS) )
	 SET_BIT(ch->feats2, WEAP_PROF_PISTOLS);
	ch->reflexes += 1;
	ch->willpower += 2;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 2 )
      {
	ch->hitroll += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 3 )
      {
	ch->fortitude += 1;
	ch->inspire_fear += 2;
      }
     if( level == 4 )
      {
	ch->hitroll += 1;
	ch->willpower += 1;
	ch->reputation += 1;
      }
     if( level == 5 )
      {
	ch->reflexes += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 6 )
      {
	ch->hitroll += 1;
	ch->fortitude += 1;
	ch->willpower += 1;
	ch->inspire_fear += 2;
      }
     if( level == 7 )
      {
	ch->reflexes += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     if( level == 8 )
      {
	ch->hitroll += 1;
	ch->willpower += 1;
	ch->reputation += 1;
      }
     if( level == 9 )
      {
	ch->fortitude += 1;
	ch->inspire_fear += 2;
      }
     if( level == 10 )
      {
	ch->hitroll += 1;
	ch->reflexes += 1;
	ch->willpower += 1;
	ch->armor += 1;
	ch->reputation += 1;
      }
     return;
    }
   if( level == DEVOTEE_ABILITY )
    {
     ch->class_level[DEVOTEE_ABILITY] += 1;
     level = ch->class_level[DEVO

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

Site Stats

Snippets: 1791
Codebases: 571