monk2.c

demise/src/monk2.c · 42.4 KB

From the archive dodbackup-final.tar.gz

Download the archive   « Back to the archive contents

/***************************************************************************
 *  God Wars Mud originally written by KaVir aka Richard Woolcock.         *
 *  Changes done to the code done by Sage aka Walter Howard, this mud is   *
 *  for the public, however if you run this code it means you agree        *
 *  to the license.low, license.gw, and license.merc have fun. :)          *
***************************************************************************/
#if defined(macintosh)
#include <types.h>
#else
#include <sys/types.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "merc.h"

int dambonus args ((CHAR_DATA * ch, CHAR_DATA * victim, int dam, int stance));


int
find_dam (CHAR_DATA * ch, CHAR_DATA * victim, int dam, bool foot)
{
  OBJ_DATA *boots;
  int stance, exdam;
  bool doubledam = FALSE;
  bool halfdam = FALSE;


  if (IS_SET (mudconfig->world_affects, WORLD_DOUBLEDAMCAP))
    doubledam = TRUE;

  if (IS_SET (mudconfig->world_affects, WORLD_HALFDAMCAP))
    halfdam = TRUE;

  dam = number_range (10, 20);

  exdam = char_damroll (ch);

  dam = dam + exdam;

  dam /= 2;

  if (dam <= 0)
    dam = 2;

  if (!IS_AWAKE (victim))
    dam *= 2;



  if (!IS_NPC (ch) && IS_MONK (ch))
    {
      if (ch->chi[CURRENT] > 0 && ch->chi[CURRENT] < 3)
	dam *= 1.2;
      if (ch->chi[CURRENT] > 2)
	dam *= ch->chi[CURRENT] / 2;
    }

  dam *= 2;

  if (!IS_NPC (victim) && IS_WEREWOLF (victim))
    {

      if (foot == TRUE)
	{
	  if ((boots = get_eq_char (ch, WEAR_FEET)) != NULL
	      && IS_SET (boots->spectype, SITEM_SILVER))
	    dam *= 2;
	}
      if (foot == FALSE)
	{
	  if ((boots = get_eq_char (ch, WEAR_HANDS)) != NULL
	      && IS_SET (boots->spectype, SITEM_SILVER))
	    dam *= 2;
	}
    }

  if (!IS_NPC (ch))
    dam = dam + (dam * ((ch->wpn[0]) / 100));

  if (!IS_NPC (ch))
    {
      stance = ch->stance[0];
      if (IS_STANCE (ch, STANCE_NORMAL))
	dam *= 1.25;
      else
	dam = dambonus (ch, victim, dam, stance);
    }


  if (dam <= 0)
    dam = 2;

  if (IS_NPC (victim))
    {
      if (doubledam)
	dam *= 2;
      if (halfdam)
	dam /= 2;
    }
  return dam;

}

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

  char buf[MSL];

  if (IS_NPC (ch))
    return;

  if (!IS_MONK (ch))
    {
      do_huh (ch, "");
      return;
    }

  ban (ch);

  if (ch->monkab[AWARE] > 0)
    {
      stc ("\n\r#GAwareness :#g", ch);
      if (ch->monkab[AWARE] > 0)
	stc ("#g Nightsight", ch);
      if (ch->monkab[AWARE] > 1)
	stc ("#g, Umbral", ch);
      if (ch->monkab[AWARE] > 2)
	stc ("#g, Heighten", ch);
      if (ch->monkab[AWARE] > 3)
	stc ("#g, Scry", ch);
      if (ch->monkab[AWARE] > 4)
	stc ("#g, Astral Projection", ch);
      stc (".#n\n\r\n\r", ch);
    }

  if (ch->monkab[BODY] > 0)
    {
      stc ("\n\r#PBody :", ch);
      if (ch->monkab[BODY] > 0)
	stc ("#p Adamantium", ch);
      if (ch->monkab[BODY] > 1)
	stc ("#p, Toughness (auto)", ch);
      if (ch->monkab[BODY] > 2)
	stc ("#p, Spiritpower#n", ch);
      if (ch->monkab[BODY] > 3)
	stc ("#p, Holyaura (auto)", ch);
      if (ch->monkab[BODY] > 4)
	stc ("#p, Flaminghands", ch);
      stc (".#n\n\r\n\r", ch);
    }

  if (ch->monkab[SPIRIT] > 0)
    {
      stc ("\n\r#ySpirit :#o", ch);
      if (ch->monkab[SPIRIT] > 0)
	stc ("#o Blinding Agony,", ch);
      if (ch->monkab[SPIRIT] > 1)
	stc ("#o, Healingtouch", ch);
      if (ch->monkab[SPIRIT] > 2)
	stc ("#o, Deathtouch", ch);
      if (ch->monkab[SPIRIT] > 3)
	stc ("#o, Celestial", ch);
      if (ch->monkab[SPIRIT] > 4)
	stc ("#o, Godsheal", ch);
      stc (".#n\n\r\n\r", ch);

    }

  if (ch->monkab[HOLY] > 0)
    {
      stc ("\n\r#RHoliness :#r", ch);
      if (ch->monkab[HOLY] > 0)
	stc ("#r Saintform", ch);
      if (ch->monkab[HOLY] > 1)
	stc ("#r, Guardian Angel (auto)", ch);
      if (ch->monkab[HOLY] > 2)
	stc ("#r, Holy Intervention (auto)", ch);
      if (ch->monkab[HOLY] > 3)
	stc ("#r, Ribbons", ch);
      if (ch->monkab[HOLY] > 4)
	stc ("#r, SaintlyMight", ch);
      stc (".#n\n\r\n\r", ch);
    }
  if (ch->monkab[COMBAT] > 0)
    {
      sprintf (buf,
	       "\n\r#CCombat :#c +%d00 damcap, +%d extra attacks, -%d speed, %d00 hit/dam/ac improve.#n\n\r\n\r",
	       ch->monkab[COMBAT], ch->monkab[COMBAT], ch->monkab[COMBAT],
	       (ch->monkab[COMBAT] * 2));
      stc (buf, ch);
    }
  ban (ch);

  return;
}

void
do_deathtouch (CHAR_DATA * ch, char *argument)
{
  CHAR_DATA *victim;
  char arg[MIL];

  argument = one_argument (argument, arg);

  if (IS_NPC (ch))
    return;

  if (!IS_MONK (ch))
    {
      stc ("Huh?\n\r", ch);
      return;
    }

  if (ch->monkab[SPIRIT] < 3)
    {
      stc ("You need to obtain level 3 spirit to use Death touch.\n\r", ch);
      return;
    }

  if (ch->focus[CURRENT] < 20)
    {
      stc ("You need atleast 20 focus points to use this power.\n\r", ch);
      return;
    }
  if ((victim = get_char_room (ch, arg)) == NULL)
    {
      send_to_char ("They are not here.\n\r", ch);
      return;
    }

  if (IS_NPC (victim))
    {
      stc ("Why bother, just kill it.\n\r", ch);
      return;
    }

  if (is_safe (ch, victim))
    return;

  if (victim == ch)
    {
      stc ("That doesn't seem like a good idea.\n\r", ch);
      return;
    }

  waiting (ch, 12);
  act
    ("You place your hands on $N's head and channel negative energy into $m.",
     ch, NULL, victim, TO_CHAR);
  act ("$n places $s hands on your head, and you scream in utter pain.", ch,
       NULL, victim, TO_VICT);
  act ("$n places $s hands on $N's head and $N screams in pain.", ch, NULL,
       victim, TO_ROOM);
  SET_BIT (victim->monkstuff, MONK_DEATH);
  update_pos (victim);
  ch->focus[CURRENT] -= 20;
  ch->fight_timer = 30;
  victim->fight_timer = 30;
  return;
}

void
do_healingtouch (CHAR_DATA * ch, char *argument)
{
  CHAR_DATA *victim;
  char arg[MIL];

  argument = one_argument (argument, arg);

  if (IS_NPC (ch))
    return;

  if (!IS_MONK (ch))
    {
      stc ("Huh?\n\r", ch);
      return;
    }

  if (ch->monkab[SPIRIT] < 2)
    {
      stc ("You need to obtain level 2 spirit to use Healing touch.\n\r", ch);
      return;
    }

  if ((victim = get_char_room (ch, arg)) == NULL)
    {
      send_to_char ("They are not here.\n\r", ch);
      return;
    }

  waiting (ch, 12);
  if (victim == ch)
    {
      stc
	("You focus your energy, and magical sparks leap out of your body.\n\r",
	 ch);
      act ("$n concentrates, and magical sparks leap out of $s body.", ch,
	   NULL, NULL, TO_ROOM);
      SET_BIT (ch->monkstuff, MONK_HEAL);
      return;
    }

  act ("You place your hands on $N's head and focus your energy on $M.", ch,
       NULL, victim, TO_CHAR);
  act ("$n places $s hands on your head and you feel warmer.", ch, NULL,
       victim, TO_VICT);
  act ("$n places $s hands on $N's head and concentrates.", ch, NULL, victim,
       TO_ROOM);
  SET_BIT (victim->monkstuff, MONK_HEAL);
  return;

}


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

  if (IS_NPC (ch))
    return;

  if (!IS_MONK (ch) || ch->monkab[BODY] < 3)
    {
      stc ("Huh?\n\r", ch);
      return;
    }

  if (IS_SET (ch->corbits, COR_NEW_POWER))
    {
      stc ("Your spiritual power fades.\n\r", ch);
      REMOVE_BIT (ch->corbits, COR_NEW_POWER);
      return;
    }

  if (ch->move < 100)
    {
      stc ("You are too exhausted.\n\r", ch);
      return;
    }

  SET_BIT (ch->corbits, COR_NEW_POWER);
  ch->move -= 100;
  stc ("Your body pulses with spiritual energy.\n\r", ch);
  return;

  return;

}

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

  if (!IS_MONK (ch))
    {
      stc ("Huh?\n\r", ch);
      return;
    }

  if (ch->chi[CURRENT] < 1)
    {
      stc ("You are already totally relaxed.\n\r", ch);
      return;
    }

  if (ch->position == POS_FIGHTING)
    {
      stc ("You cannot relax your ch'i while fighting!\n\r", ch);
      return;
    }

  ch->chi[CURRENT]--;
  waiting (ch, 4);
  stc ("You breathe deeply and relax your focus.\n\r", ch);
  act ("$n looks more relaxed.", ch, NULL, NULL, TO_ROOM);
  return;
}

void
do_chi (CHAR_DATA * ch, char *argument)
{
  char buf[MSL];

  if (IS_NPC (ch))
    return;

  if (!IS_MONK (ch))
    {
      stc ("Huh?\n\r", ch);
      return;
    }

  if (ch->fighting == NULL)
    {
      stc ("You must be fighting to focus your chi.\n\r", ch);
      return;
    }

  if (ch->chi[CURRENT] >= ch->chi[MAXIMUM])
    {
      if (ch->chi[MAXIMUM] == 0)
	stc ("You have not gained any control of your chi.\n\r", ch);
      else
	{
	  sprintf (buf, "You cannot focus your chi past a level of %d.\n\r",
		   ch->chi[MAXIMUM]);
	  stc (buf, ch);
	}
      return;
    }

  if (ch->move < 500 + ((ch->chi[CURRENT] + 1) * 20))
    {
      stc ("You are too exhausted.\n\r", ch);
      return;
    }

  if (ch->chi[CURRENT] == 0)
    {
      stc ("#yYour body flickers with energy.#n\n\r", ch);
      act ("#y$n's body flickers with energy.#n", ch, NULL, NULL, TO_ROOM);
    }
  if (ch->chi[CURRENT] == 1)
    {
      stc ("#GYour body pulses with energy.#n\n\r", ch);
      act ("#G$n's body pulses with energy.#n", ch, NULL, NULL, TO_ROOM);
    }
  if (ch->chi[CURRENT] == 2)
    {
      if (ch->class == CLASS_MONK)
	{
	  stc ("#LYour body glows with blue energy.#n\n\r", ch);
	  act ("#L$n's body glows with blue energy.#n", ch, NULL, NULL,
	       TO_ROOM);
	}
      else
	{
	  stc
	    ("#7Your body emits sparks of energy as you fully focus your chi#n.\n\r",
	     ch);
	  act ("#7$n's body emits sparks of energy.#n", ch, NULL, NULL,
	       TO_ROOM);
	}
    }
  if (ch->chi[CURRENT] == 3)
    {
      stc ("#RYour body glows bright red.#n\n\r", ch);
      act ("#R$n's body glows bright red.#n", ch, NULL, NULL, TO_ROOM);
    }
  if (ch->chi[CURRENT] == 4)
    {
      stc ("#CYour body flashes with power.#n\n\r", ch);
      act ("#C$n's body flashes with power.#n", ch, NULL, NULL, TO_ROOM);
    }
  if (ch->chi[CURRENT] == 5)
    {
      stc
	("#7Your body emits sparks of energy as you fully focus your chi#n.\n\r",
	 ch);
      act ("#7$n's body emits sparks of energy.#n", ch, NULL, NULL, TO_ROOM);
    }
  waiting (ch, 4);
  ch->chi[CURRENT]++;
  ch->move -= ((ch->chi[CURRENT] * 20));
  ch->damcap[DAM_CHANGE] = 1;
  return;

}

void
do_shinkick (CHAR_DATA * ch, char *argument)
{
  CHAR_DATA *victim;
  bool foot = TRUE;
  int dam;
  char arg[MIL];

  one_argument (argument, arg);

  if (IS_NPC (ch))
    return;

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

  if (!IS_FS (ch, TECH_SHIN))
    {
      stc ("You haven't learned that technique.\n\r", ch);
      return;
    }

  if (arg[0] == '\0' && ch->fighting == NULL)
    {
      send_to_char ("Who do you wish to use this technique on?\n\r", ch);
      return;
    }

  if ((victim = ch->fighting) == NULL)
    {
      if ((victim = get_char_room (ch, arg)) == NULL)
	{
	  send_to_char ("They aren't here.\n\r", ch);
	  return;
	}
    }

  if (is_safe (ch, victim))
    return;

  if (ch == victim)
    {
      send_to_char ("Use this technique on yourself?\n\r", ch);
      return;
    }

  waiting (ch, 8);
  dam = number_range (1, 6);

  dam = find_dam (ch, victim, dam, foot);

  if (ch->monkcrap == 0)
    {
      stc ("#LYour aura glows light blue for a moment.#n\n\r", ch);
      act ("#L$n's aura glows a light blue for a moment.#n", ch, NULL, victim,
	   TO_VICT);
      SET_BIT (ch->monkcrap, COMB_SHIN);
    }
  else if (ch->monkcrap > 0)
    {
      stc ("#CYour aura fades away.#n\n\r", ch);
      act ("#C$n's aura fades away.#n", ch, NULL, victim, TO_VICT);
      ch->monkcrap = 0;
    }

  act ("You deliver a powerful blow to $N's shin.", ch, NULL, victim,
       TO_CHAR);
  act ("$n delivers a powerful blow to your shin.", ch, NULL, victim,
       TO_VICT);
  act ("$n delivers a powerful blow to $N's shin.", ch, NULL, victim,
       TO_NOTVICT);
  damage (ch, victim, dam, gsn_shinkick, DAM_NORMAL, FALSE, TRUE, TRUE);
  return;
}

void
do_palmstrike (CHAR_DATA * ch, char *argument)
{
  char arg[MIL];
  CHAR_DATA *victim;
  int dam;
  bool foot = FALSE;

  one_argument (argument, arg);

  if (IS_NPC (ch))
    return;

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

  if (!IS_FS (ch, TECH_PALM))
    {
      stc ("You haven't learned that technique.\n\r", ch);
      return;
    }

  if (!IS_COMB (ch, COMB_SWEEP) && ch->fighting != NULL)
    {
      stc ("Not while fighting.\n\r", ch);
      return;
    }

  if (arg[0] == '\0' && ch->fighting == NULL)
    {
      send_to_char ("Who do you wish to use this technique on?\n\r", ch);
      return;
    }

  if ((victim = ch->fighting) == NULL)
    {
      if ((victim = get_char_room (ch, arg)) == NULL)
	{
	  send_to_char ("They aren't here.\n\r", ch);
	  return;
	}
    }

  if (is_safe (ch, victim))
    return;

  if (ch == victim)
    {
      send_to_char ("You cannot palm strike yourself!\n\r", ch);
      return;
    }

  if (is_safe (ch, victim))
    return;

  if (victim->position < POS_FIGHTING)
    {
      send_to_char ("You can only palm strike someone who is standing.\n\r",
		    ch);
      return;
    }

  if (IS_COMB (ch, COMB_ELBOW) && IS_COMB (ch, COMB_BACKFIST)
      && IS_COMB (ch, COMB_SWEEP))
    {
      act
	("#CYour aura turns #0Black#C as you perform the forbidden #c**#rDOKUYAKU#c**#C.#n",
	 ch, NULL, NULL, TO_CHAR);
      act
	("#C$n's aura turns #0Black#C as $s perform's the forbidden #c**#rDOKUYAKU#c**#C#n",
	 ch, NULL, victim, TO_VICT);
      act
	("#C$n's aura turns #0Black#C as $s perform's the forbidden #c**#rDOKUYAKU#c**#C.#n",
	 ch, NULL, victim, TO_NOTVICT);
      ch->monkcrap = 0;
      do_dokuyaku (ch, victim->name);
      return;
    }
  else if (ch->monkcrap != 0)
    {
      stc ("#CYour aura fades.#n\n\r", ch);
      act ("#C$n's aura fades.#n", ch, NULL, victim, TO_VICT);
      act ("#C$n's aura fades.#n", ch, NULL, victim, TO_NOTVICT);
      ch->monkcrap = 0;
    }


  act ("You slam your palm into $N's chest.", ch, NULL, victim, TO_CHAR);
  act ("$n slams $s palm into your chest.", ch, NULL, victim, TO_VICT);
  act ("$n slams $s palm into $N's chest.", ch, NULL, victim, TO_NOTVICT);

  waiting (ch, 8);
  dam = number_range (1, 4);

  dam = find_dam (ch, victim, dam, foot);
  dam /= 2;

  damage (ch, victim, dam, gsn_palmstrike, DAM_NORMAL, FALSE, TRUE, TRUE);
  if (victim == NULL || victim->position == POS_DEAD || dam < 1)
    return;
  if (victim->position == POS_FIGHTING)
    stop_fighting (victim, TRUE);
  act ("You have been knocked on your ass!", victim, NULL, NULL, TO_CHAR);
  act ("$n has been knocked on their ass!", victim, NULL, NULL, TO_ROOM);
  victim->position = POS_STUNNED;
  return;
}

void
do_knee (CHAR_DATA * ch, char *argument)
{
  CHAR_DATA *victim;
  bool foot = TRUE;
  int dam;
  char arg[MIL];

  one_argument (argument, arg);

  if (!IS_MONK (ch))
    return stc ("Huh?\n\r", ch);

  if (!IS_FS (ch, TECH_KNEE))
    {
      stc ("You haven't learned that technique.\n\r", ch);
      return;
    }

  if (arg[0] == '\0' && ch->fighting == NULL)
    {
      send_to_char ("Who do you wish to use this technique on?\n\r", ch);
      return;
    }

  if ((victim = ch->fighting) == NULL)
    {
      if ((victim = get_char_room (ch, arg)) == NULL)
	{
	  send_to_char ("They aren't here.\n\r", ch);
	  return;
	}
    }

  if (is_safe (ch, victim))
    return;

  if (ch == victim)
    {
      send_to_char ("Use this technique on yourself?\n\r", ch);
      return;
    }

  waiting (ch, 8);
  dam = number_range (1, 6);

  dam = find_dam (ch, victim, dam, foot);

  if (IS_SET (ch->monkcrap, COMB_SHIN) && !IS_SET (ch->monkcrap, COMB_KNEE))
    {
      stc ("#lYour aura glows dark blue.#n\n\r", ch);
      act ("#l$n's aura glows dark blue.#n", ch, NULL, victim, TO_VICT);
      SET_BIT (ch->monkcrap, COMB_KNEE);
    }
  else if (ch->monkcrap > 0)
    {
      stc ("#CYour aura slowly fades away.#n\n\r", ch);
      act ("#C$n's aura slowly fades away.#n", ch, NULL, victim, TO_VICT);
      ch->monkcrap = 0;
    }

  act ("You leap up and slam your knee into $N's chin.", ch, NULL, victim,
       TO_CHAR);
  act ("$n leaps up and slams $s knee into your chin.", ch, NULL, victim,
       TO_VICT);
  act ("$n leaps up and slams $s knee into $N's chin.", ch, NULL, victim,
       TO_NOTVICT);
  damage (ch, victim, dam, gsn_kneestrike, DAM_NORMAL, FALSE, TRUE, TRUE);
  return;
}

void
do_sweep (CHAR_DATA * ch, char *argument)
{
  CHAR_DATA *victim;
  bool foot = TRUE;
  int dam;
  char arg[MIL];

  one_argument (argument, arg);

  if (!IS_MONK (ch))
    return stc ("Huh?\n\r", ch);

  if (!IS_FS (ch, TECH_SWEEP))
    {
      stc ("You haven't learned that technique.\n\r", ch);
      return;
    }

  if (arg[0] == '\0' && ch->fighting == NULL)
    {
      send_to_char ("Who do you wish to use this technique on?\n\r", ch);
      return;
    }

  if ((victim = ch->fighting) == NULL)
    {
      if ((victim = get_char_room (ch, arg)) == NULL)
	{
	  send_to_char ("They aren't here.\n\r", ch);
	  return;
	}
    }

  if (is_safe (ch, victim))
    return;

  if (ch == victim)
    {
      send_to_char ("Use this technique on yourself?\n\r", ch);
      return;
    }

  if (IS_COMB (ch, COMB_ELBOW) && IS_COMB (ch, COMB_BACKFIST)
      && !IS_COMB (ch, COMB_SWEEP))
    {
      act ("#RYour aura pulsates violently.#n", ch, NULL, NULL, TO_CHAR);
      act ("#R$n's aura pulsates violently.#n", ch, NULL, victim, TO_VICT);
      act ("#R$n's aura pulsates violently.#n", ch, NULL, victim, TO_NOTVICT);
      SET_BIT (ch->monkcrap, COMB_SWEEP);
    }
  else if (IS_COMB (ch, COMB_SPIN))
    {
      stc ("#GYour aura starts glowing bright green#n\n\r", ch);
      act ("#G$n's aura glows bright green for a few seconds.#n", ch, NULL,
	   victim, TO_VICT);
      act ("#G$n's aura glows bright green for a few seconds.#n", ch, NULL,
	   victim, TO_NOTVICT);
      SET_BIT (ch->monkcrap, COMB_SWEEP);
    }
  else if (ch->monkcrap != 0)
    {
      stc ("#CYour aura fades.#n\n\r", ch);
      act ("#C$n's aura fades.#n", ch, NULL, victim, TO_VICT);
      act ("#C$n's aura fades.#n", ch, NULL, victim, TO_NOTVICT);
      ch->monkcrap = 0;
    }

  waiting (ch, 8);
  dam = number_range (1, 4);

  dam = find_dam (ch, victim, dam, foot);

  act ("You crouch down and sweep $N's legs out from under $M.", ch, NULL,
       victim, TO_CHAR);
  act ("$n crouches down and sweeps your legs out from under you", ch, NULL,
       victim, TO_VICT);
  act ("$n crouches down and sweeps $N's legs out from under $M", ch, NULL,
       victim, TO_NOTVICT);
  damage (ch, victim, dam, gsn_monksweep, DAM_NORMAL, FALSE, TRUE, TRUE);
  return;
}

void
do_elbow (CHAR_DATA * ch, char *argument)
{
  CHAR_DATA *victim;
  bool foot = FALSE;
  int dam;
  char arg[MIL];

  one_argument (argument, arg);

  if (!IS_MONK (ch))
    return stc ("Huh?\n\r", ch);

  if (!IS_FS (ch, TECH_ELBOW))
    {
      stc ("You haven't learned that technique.\n\r", ch);
      return;
    }

  if (arg[0] == '\0' && ch->fighting == NULL)
    {
      send_to_char ("Who do you wish to use this technique on?\n\r", ch);
      return;
    }

  if ((victim = ch->fighting) == NULL)
    {
      if ((victim = get_char_room (ch, arg)) == NULL)
	{
	  send_to_char ("They aren't here.\n\r", ch);
	  return;
	}
    }

  if (is_safe (ch, victim))
    return;

  if (ch == victim)
    {
      send_to_char ("Use this technique on yourself?\n\r", ch);
      return;
    }

  if (ch->monkcrap == 0 && !IS_SET (ch->monkcrap, COMB_ELBOW))
    {
      stc ("#lYour aura glows dark blue for a moment.#n\n\r", ch);
      act ("#l$n's aura glows dark blue for a moment.#n", ch, NULL, victim,
	   TO_VICT);
      act ("#l$n's aura glows dark blue for a moment.#n", ch, NULL, victim,
	   TO_NOTVICT);
      SET_BIT (ch->monkcrap, COMB_ELBOW);
    }
  else if (ch->monkcrap != 0 && IS_SET (ch->monkcrap, COMB_SHIN)
	   && IS_SET (ch->monkcrap, COMB_KNEE) && IS_TAKARRA (ch))
    {
      stc ("#RYour aura goes dark red for a moment.#n\n\r", ch);
      act ("#R$n's aura glows dark red for a moment.#n", ch, NULL, victim,
	   TO_VICT);
      act ("#R$n's aura glows dark red for a moment.#n", ch, NULL, victim,
	   TO_NOTVICT);
      do_nightmaredoll (ch, victim->name);
      ch->monkcrap = 0;
    }
  else if (ch->monkcrap != 0)
    {
      stc ("#CYour aura fades.#n\n\r", ch);
      act ("#C$n's aura fades.#n", ch, NULL, victim, TO_VICT);
      act ("#C$n's aura fades.#n", ch, NULL, victim, TO_NOTVICT);
      ch->monkcrap = 0;
    }

  waiting (ch, 8);
  dam = number_range (1, 6);

  dam = find_dam (ch, victim, dam, foot);

  act ("You ram your elbow into $N's face.", ch, NULL, victim, TO_CHAR);
  act ("$n rams $s elbow into your face.", ch, NULL, victim, TO_VICT);
  act ("$n rams $s elbow into $N's face.", ch, NULL, victim, TO_NOTVICT);
  damage (ch, victim, dam, gsn_elbowstrike, DAM_NORMAL, FALSE, TRUE, TRUE);
  return;
}


void
do_thrustkick (CHAR_DATA * ch, char *argument)
{
  CHAR_DATA *victim;
  bool foot = TRUE;
  int dam;
  char arg[MIL];
  char buf[MSL];

  one_argument (argument, arg);

  if (!IS_MONK (ch))
    return stc ("Huh?\n\r", ch);

  if (!IS_FS (ch, TECH_THRUST))
    {
      stc ("You haven't learned that technique.\n\r", ch);
      return;
    }

  if (arg[0] == '\0' && ch->fighting == NULL)
    {
      send_to_char ("Who do you wish to use this technique on?\n\r", ch);
      return;
    }

  if ((victim = ch->fighting) == NULL)
    {
      if ((victim = get_char_room (ch, arg)) == NULL)
	{
	  send_to_char ("They aren't here.\n\r", ch);
	  return;
	}
    }

  if (is_safe (ch, victim))
    return;

  if (ch == victim)
    {
      send_to_char ("Use this technique on yourself?\n\r", ch);
      return;
    }

  waiting (ch, 8);
  dam = number_range (1, 5);

  dam = find_dam (ch, victim, dam, foot);

  if (IS_COMB (ch, COMB_SPIN) && IS_COMB (ch, COMB_SWEEP))
    {
      act
	("You jump from your crouching position, slaming your foot into $N's chest, knocking $M to the ground.",
	 ch, NULL, victim, TO_CHAR);
      act
	("$n jumps at you from a crouching position, slaming $s foot into your chest, knocking you on to your back.",
	 ch, NULL, victim, TO_VICT);
      act
	("$n jumps at $N from a crouching position, slaming $s foot into $N's chest, knocking $M to the ground.",
	 ch, NULL, victim, TO_NOTVICT);
      dam *= 1.2;
      damage (ch, victim, dam, gsn_vampirekick, DAM_SHADOW, FALSE, TRUE,
	      TRUE);
      if (victim != NULL && victim->position != POS_DEAD)
	{
	  int drain1 = 0;
	  int drain2 = 0;
	  int drain3 = 0;
	  int drain4 = 0;
	  int drain5 = 0;
	  int chi = 0;

	  chi = ch->chi[CURRENT] * 4;
	  if (chi < 1)
	    chi = 1;

	  drain1 = (victim->max_move / 100) * chi;
	  if (drain1 > (2000 * ch->chi[CURRENT]))
	    drain1 = 2000 * ch->chi[CURRENT];
	  drain2 = (victim->max_mana / 100) * chi;
	  if (drain2 > (2000 * ch->chi[CURRENT]))
	    drain2 = 2000 * ch->chi[CURRENT];

	  if (victim->mana > 0)
	    {
	      if (victim->mana < drain2)
		drain2 = victim->mana;

	      victim->mana -= drain2;

	      if (victim->mana < 0)
		victim->mana = 0;
	    }
	  else
	    {
	      drain2 = 0;
	    }

	  if (victim->move > 0)
	    {
	      if (victim->move < drain1)
		drain1 = victim->move;

	      victim->move -= drain1;

	      if (victim->move < 0)
		victim->move = 0;
	    }
	  else
	    {
	      drain1 = 0;
	    }

	  drain3 = drain1 + drain2;
	  drain4 = drain3 / 3;
	  drain5 = drain3 - drain4;

	  if (drain3 > 0)
	    {
	      act
		("Then standing on $S chest a white cloud envelopes you like a shroud, empowering you with $S lifeforce.",
		 ch, NULL, victim, TO_CHAR);
	      act
		("You feel your energy beeing drained from your body as $n standing on your chest is enveloped in a white cloud.",
		 ch, NULL, victim, TO_VICT);
	      act
		("$N looks weaker as $n while standing on $S chest is enveloped in a white cloud.",
		 ch, NULL, victim, TO_NOTVICT);
	      if (!IS_NPC (victim))
		{
		  sprintf (buf,
			   "You drain #y%d#n points of %s's spiritual energy.\n\rChanneling #y%d#n into your life essence and #y%d#n your vitality.\n\r",
			   drain3, victim->name, drain4, drain5);
		  stc (buf, ch);
		  sprintf (buf,
			   "$n drains #y%d#n points from your mystical power and #y%d#n points from your vitality, channeling it into $mself.",
			   drain2, drain1);
		  act (buf, ch, NULL, victim, TO_VICT);
		}
	      else
		{
		  sprintf (buf,
			   "You drain #y%d#n points of %s's spiritual energy.\n\rChanneling #y%d#n into your life essence and #y%d#n your vitality.\n\r",
			   drain3, victim->short_descr, drain4, drain5);
		  stc (buf, ch);
		}
	      ch->move += drain5;
	      ch->hit += drain4;
	      if (ch->hit > ch->max_hit + 10000)
		ch->hit = ch->max_hit + 10000;
	      if (ch->move > ch->max_move * 2)
		ch->move = ch->max_move * 2;
	    }
	  ch->monkcrap = 0;
	  return;
	}
      return;
    }
  else if (ch->monkcrap == 0 && !IS_SET (ch->monkcrap, COMB_THRUST1))
    {
      stc ("#lYour aura glows dark blue for a moment.#n\n\r", ch);
      act ("#l$n's aura glows dark blue for a moment.#n", ch, NULL, victim,
	   TO_VICT);
      act ("#l$n's aura glows dark blue for a moment.#n", ch, NULL, victim,
	   TO_NOTVICT);
      SET_BIT (ch->monkcrap, COMB_THRUST1);
    }
  else if (IS_SET (ch->monkcrap, COMB_THRUST1)
	   && !IS_SET (ch->monkcrap, COMB_THRUST2))
    {
      stc ("#LYour aura flashes bright blue.#n\n\r", ch);
      act ("#L$n's aura flashes bright blue.#n", ch, NULL, victim, TO_VICT);
      act ("#L$n's aura flashes bright blue.#n", ch, NULL, victim,
	   TO_NOTVICT);
      SET_BIT (ch->monkcrap, COMB_THRUST2);
    }
  else if (ch->monkcrap != 0)
    {
      stc ("#CYour aura fades.#n\n\r", ch);
      act ("#C$n's aura fades.#n", ch, NULL, victim, TO_VICT);
      act ("#C$n's aura fades.#n", ch, NULL, victim, TO_NOTVICT);
      ch->monkcrap = 0;
    }

  act ("You deliver a thrust kick to $N's chest.", ch, NULL, victim, TO_CHAR);
  act ("$n delivers a powerful thrust kick to your chest.", ch, NULL, victim,
       TO_VICT);
  act ("$n delivers a powerful thrust kick to $N's chest.", ch, NULL, victim,
       TO_NOTVICT);
  damage (ch, victim, dam, gsn_thrustkick, DAM_NORMAL, FALSE, TRUE, TRUE);
  return;
}

void
do_spinkick (CHAR_DATA * ch, char *argument)
{
  CHAR_DATA *victim;
  bool foot = TRUE;
  int dam;
  char arg[MIL];

  one_argument (argument, arg);

  if (!IS_MONK (ch))
    return stc ("Huh?\n\r", ch);

  if (!IS_FS (ch, TECH_SPIN))
    {
      stc ("You haven't learned that technique.\n\r", ch);
      return;
    }

  if (arg[0] == '\0' && ch->fighting == NULL)
    {
      send_to_char ("Who do you wish to use this technique on?\n\r", ch);
      return;
    }

  if ((victim = ch->fighting) == NULL)
    {
      if ((victim = get_char_room (ch, arg)) == NULL)
	{
	  send_to_char ("They aren't here.\n\r", ch);
	  return;
	}
    }

  if (is_safe (ch, victim))
    return;

  if (ch == victim)
    {
      send_to_char ("Use this technique on yourself?\n\r", ch);
      return;
    }

  waiting (ch, 8);
  dam = number_range (1, 4);

  dam = find_dam (ch, victim, dam, foot);

  if (IS_COMB (ch, COMB_THRUST1) && IS_COMB (ch, COMB_THRUST2))
    {
      act ("#CYour aura pulsates and channels energy into your attack.#n", ch,
	   NULL, NULL, TO_CHAR);
      act ("#C$n's aura pulsates and channels energy into $s attack.#n", ch,
	   NULL, victim, TO_VICT);
      act ("#C$n's aura pulsates and channels energy into $s attack.#n", ch,
	   NULL, victim, TO_NOTVICT);
      ch->monkcrap = 0;
      dam /= 1.2;
      damage (ch, victim, dam, gsn_lightningkick, DAM_SHOCK, FALSE, TRUE,
	      TRUE);
      if (ch->chi[CURRENT] > 1)
	{
	  dam /= 1.2;
	  damage (ch, victim, dam, gsn_lightningkick, DAM_SHOCK, FALSE, TRUE,
		  TRUE);
	}
      if (ch->chi[CURRENT] > 2)
	{
	  dam /= 1.2;
	  damage (ch, victim, dam, gsn_lightningkick, DAM_SHOCK, FALSE, TRUE,
		  TRUE);
	}
      if (ch->chi[CURRENT] > 3)
	{
	  dam /= 1.2;
	  damage (ch, victim, dam, gsn_lightningkick, DAM_SHOCK, FALSE, TRUE,
		  TRUE);
	}
      if (ch->chi[CURRENT] > 4)
	{
	  dam /= 1.2;
	  damage (ch, victim, dam, gsn_lightningkick, DAM_SHOCK, FALSE, TRUE,
		  TRUE);
	}
      if (ch->chi[CURRENT] > 5)
	{
	  dam /= 1.2;
	  damage (ch, victim, dam, gsn_lightningkick, DAM_SHOCK, FALSE, TRUE,
		  TRUE);
	}
      if (IS_COR (ch, COR_RIBBONS))
	{
	  int max, i;

	  max = number_range (1, ch->chi[CURRENT]);

	  for (i = 0; i < max; i++)
	    {
	      damage (ch, victim, dam, gsn_chi_ribbon, DAM_LIGHT, FALSE, TRUE,
		      TRUE);
	    }
	}
      return;
    }
  else if (IS_SET (ch->monkcrap, COMB_SHIN)
	   && IS_SET (ch->monkcrap, COMB_KNEE))
    {
      CHAR_DATA *vch;
      CHAR_DATA *vch_next;
      CHAR_DATA *mount;
      int number_hit = 0;
      int max_hit = ch->chi[CURRENT] * 1.5;
      int max2, ii;
      int i, max;
      max_hit += 1;

      max = ch->chi[CURRENT];

      if (max < 1)
	max = 1;
      max2 = number_range (1, ch->chi[CURRENT]);

      ch->monkcrap = 0;
      stc ("#CYou spin around and around, going berserk.#n\n\r", ch);
      act ("#C$n body speeds up, and $e spins around rapidly.#n", ch, NULL,
	   victim, TO_ROOM);
      for (vch = char_list; vch != NULL; vch = vch_next)
	{
	  vch_next = vch->next;

	  if (number_hit > max_hit)
	    continue;
	  if (vch->in_room == NULL)
	    continue;
	  if (!IS_NPC (vch) && vch->pcdata->chobj != NULL)
	    continue;
	  if (ch == vch)
	    continue;
	  if (!IS_NPC (vch))
	    continue;
	  if (vch->in_room == ch->in_room)
	    {
	      if ((mount = ch->mount) != NULL)
		{
		  if (mount == vch)
		    continue;
		}
	      if (can_see (ch, vch))
		{
		  number_hit++;
		  more_hit (ch, vch, gsn_tornadokick, DAM_WIND, max, FALSE);
		  if (IS_COR (ch, COR_RIBBONS))
		    {
		      more_hit (ch, vch, gsn_chi_ribbon, DAM_LIGHT, max2,
				FALSE);
		    }
		}
	    }
	}
      return;
    }
  else if (ch->monkcrap == 0 && !IS_COMB (ch, COMB_SPIN))
    {
      stc ("#gYour aura starts glowing dark green.\n\r", ch);
      act ("#g$n's aura glows dark green for a moment.#n", ch, NULL, victim,
	   TO_VICT);
      act ("#g$n's aura glows dark green for a moment.#n", ch, NULL, victim,
	   TO_NOTVICT);
      SET_BIT (ch->monkcrap, COMB_SPIN);
    }
  else if (ch->monkcrap != 0)
    {
      stc ("#CYour aura fades.#n\n\r", ch);
      act ("#C$n's aura fades.#n", ch, NULL, victim, TO_VICT);
      act ("#C$n's aura fades.#n", ch, NULL, victim, TO_NOTVICT);
      ch->monkcrap = 0;
    }

  act ("You spin around and deliver a blow to $N's head.", ch, NULL, victim,
       TO_CHAR);
  act ("$n spins around and delivers a blow to your head.", ch, NULL, victim,
       TO_VICT);
  act ("$n spins around and delivers a devastating blow to $N's head.", ch,
       NULL, victim, TO_NOTVICT);
  damage (ch, victim, dam, gsn_spinkick, DAM_NORMAL, FALSE, TRUE, TRUE);
  return;
}

void
do_backfist (CHAR_DATA * ch, char *argument)
{
  CHAR_DATA *victim;
  bool foot = FALSE;
  int dam;
  char arg[MIL];

  one_argument (argument, arg);

  if (!IS_MONK (ch))
    return stc ("Huh?\n\r", ch);

  if (!IS_FS (ch, TECH_BACK))
    {
      stc ("You haven't learned that technique.\n\r", ch);
      return;
    }

  if (arg[0] == '\0' && ch->fighting == NULL)
    {
      send_to_char ("Who do you wish to use this technique on?\n\r", ch);
      return;
    }

  if ((victim = ch->fighting) == NULL)
    {
      if ((victim = get_char_room (ch, arg)) == NULL)
	{
	  send_to_char ("They aren't here.\n\r", ch);
	  return;
	}
    }

  if (is_safe (ch, victim))
    return;

  if (ch == victim)
    {
      send_to_char ("Use this technique on yourself?\n\r", ch);
      return;
    }

  if (IS_SET (ch->monkcrap, COMB_ELBOW)
      && !IS_SET (ch->monkcrap, COMB_BACKFIST))
    {
      stc ("#LYour aura flashes bright blue.#n\n\r", ch);
      act ("#L$n's aura flashes bright blue.#n", ch, NULL, victim, TO_VICT);
      act ("#L$n's aura flashes bright blue.#n", ch, NULL, victim,
	   TO_NOTVICT);
      SET_BIT (ch->monkcrap, COMB_BACKFIST);
    }
  else if (ch->monkcrap != 0)
    {
      stc ("#CYour aura fades.#n\n\r", ch);
      act ("#C$n's aura fades.#n", ch, NULL, victim, TO_VICT);
      act ("#C$n's aura fades.#n", ch, NULL, victim, TO_NOTVICT);
      ch->monkcrap = 0;
    }

  waiting (ch, 8);
  dam = number_range (1, 5);

  dam = find_dam (ch, victim, dam, foot);

  act ("You spin around and slam $N's jaw with your fist.", ch, NULL, victim,
       TO_CHAR);
  act ("$n spins around and slams you in the jaw with $s fist.", ch, NULL,
       victim, TO_VICT);
  act ("$n spins around and slams $N in the jaw with $s fist.", ch, NULL,
       victim, TO_NOTVICT);
  damage (ch, victim, dam, gsn_backfist, DAM_NORMAL, FALSE, TRUE, TRUE);
  return;
}


void
do_learn (CHAR_DATA * ch, char *argument)
{
  char arg[MIL];
  char arg1[MIL];
  char buf[MSL];
  char lin[MSL];
  int inpart = 0;
  int cost = 5000;

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

  if (IS_NPC (ch))
    return;

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


  sprintf (lin,
	   "===============================================================================\n\r");

  if (arg[0] == '\0')
    {
      stc
	("\n\rSyntax: Learn <fight|techniques|abilities|chi> <power|chi>\n\r",
	 ch);
      stc
	("================================| Fight Styles |==============================\n\r",
	 ch);
      sprintf (buf,
	       "       Trip     [%s] Kick      [%s] Bash     [%s] Elbow    [%s] Knee     [%s]   \n\r",
	       IS_FS (ch, FS_TRIP) ? "*" : " ", IS_FS (ch,
						       FS_KICK) ? "*" : " ",
	       IS_FS (ch, FS_BASH) ? "*" : " ", IS_FS (ch,
						       FS_ELBOW) ? "*" : " ",
	       IS_FS (ch, FS_KNEE) ? "*" : " ");
      stc (buf, ch);
      sprintf (buf,
	       "       Disarm   [%s] Bite      [%s] Dirt     [%s] Grapple  [%s] Punch    [%s]   \n\r",
	       IS_FS (ch, FS_DISARM) ? "*" : " ", IS_FS (ch,
							 FS_BITE) ? "*" : " ",
	       IS_FS (ch, FS_DIRT) ? "*" : " ", IS_FS (ch,
						       FS_GRAPPLE) ? "*" :
	       " ", IS_FS (ch, FS_PUNCH) ? "*" : " ");
      stc (buf, ch);
      sprintf (buf,
	       "       Rip      [%s] Stamp     [%s] Backfist [%s] Jumpkick [%s] Spinkick [%s]   \n\r",
	       IS_FS (ch, FS_RIP) ? "*" : " ", IS_FS (ch,
						      FS_STAMP) ? "*" : " ",
	       IS_FS (ch, FS_BACKFIST) ? "*" : " ", IS_FS (ch,
							   FS_JUMPKICK) ? "*"
	       : " ", IS_FS (ch, FS_SPINKICK) ? "*" : " ");
      stc (buf, ch);
      sprintf (buf,
	       "       Sweep    [%s] Charge    [%s] Hurl     [%s] Gouge    [%s] Headbutt [%s]   \n\r",
	       IS_FS (ch, FS_SWEEP) ? "*" : " ", IS_FS (ch,
							FS_CHARGE) ? "*" :
	       " ", IS_FS (ch, FS_HURL) ? "*" : " ", IS_FS (ch,
							    FS_GOUGE) ? "*" :
	       " ", IS_FS (ch, FS_HEADBUTT) ? "*" : " ");
      stc (buf, ch);
      stc
	("===============================================================================\n\r",
	 ch);
      stc
	("                                   Techniques                                  \n\r",
	 ch);
      stc (lin, ch);
      sprintf (buf,
	       "    Thrust Kick [%s]   Spin Kick   [%s]   Backfist    [%s]   Palm Strike [%s]   \n\r",
	       IS_FS (ch, TECH_THRUST) ? "*" : " ", IS_FS (ch,
							   TECH_SPIN) ? "*" :
	       " ", IS_FS (ch, TECH_BACK) ? "*" : " ", IS_FS (ch,
							      TECH_PALM) ? "*"
	       : " ");
      stc (buf, ch);
      sprintf (buf,
	       "    Elbow       [%s]   Sweep       [%s]   Shin Kick   [%s]   Knee        [%s]   \n\r",
	       IS_FS (ch, TECH_ELBOW) ? "*" : " ", IS_FS (ch,
							  TECH_SWEEP) ? "*" :
	       " ", IS_FS (ch, TECH_SHIN) ? "*" : " ", IS_FS (ch,
							      TECH_KNEE) ? "*"
	       : " ");
      stc (buf, ch);
      stc (lin, ch);
      stc
	("                                   Abilities                                   \n\r",
	 ch);
      stc (lin, ch);
      sprintf (buf,
	       "                 Awareness [%s%s%s%s%s]              Body     [%s%s%s%s%s]\n\r",
	       ch->monkab[AWARE] > 0 ? "*" : " ",
	       ch->monkab[AWARE] > 1 ? "*" : " ",
	       ch->monkab[AWARE] > 2 ? "*" : " ",
	       ch->monkab[AWARE] > 3 ? "*" : " ",
	       ch->monkab[AWARE] > 4 ? "*" : " ",
	       ch->monkab[BODY] > 0 ? "*" : " ",
	       ch->monkab[BODY] > 1 ? "*" : " ",
	       ch->monkab[BODY] > 2 ? "*" : " ",
	       ch->monkab[BODY] > 3 ? "*" : " ",
	       ch->monkab[BODY] > 4 ? "*" : " ");
      stc (buf, ch);
      sprintf (buf,
	       "		  Combat   [%s%s%s%s%s]             Spirit    [%s%s%s%s%s]\n\r",
	       ch->monkab[COMBAT] > 0 ? "*" : " ",
	       ch->monkab[COMBAT] > 1 ? "*" : " ",
	       ch->monkab[COMBAT] > 2 ? "*" : " ",
	       ch->monkab[COMBAT] > 3 ? "*" : " ",
	       ch->monkab[COMBAT] > 4 ? "*" : " ",
	       ch->monkab[SPIRIT] > 0 ? "*" : " ",
	       ch->monkab[SPIRIT] > 1 ? "*" : " ",
	       ch->monkab[SPIRIT] > 2 ? "*" : " ",
	       ch->monkab[SPIRIT] > 3 ? "*" : " ",
	       ch->monkab[SPIRIT] > 4 ? "*" : " ");
      stc (buf, ch);
      if (IS_ANGELW (ch))
	{
	  sprintf (buf, "		 Holiness  [%s%s%s%s%s]\n\r",
		   ch->monkab[HOLY] > 0 ? "*" : " ",
		   ch->monkab[HOLY] > 1 ? "*" : " ",
		   ch->monkab[HOLY] > 2 ? "*" : " ",
		   ch->monkab[HOLY] > 3 ? "*" : " ",
		   ch->monkab[HOLY] > 4 ? "*" : " ");
	  stc (buf, ch);
	}
      if (IS_TAKARRA (ch))
	{
	  sprintf (buf, "                Nightmare  [%s%s%s%s%s]\n\r",
		   ch->monkab[NITE] > 0 ? "*" : " ",
		   ch->monkab[NITE] > 1 ? "*" : " ",
		   ch->monkab[NITE] > 2 ? "*" : " ",
		   ch->monkab[NITE] > 3 ? "*" : " ",
		   ch->monkab[NITE] > 4 ? "*" : " ");
	  stc (buf, ch);
	}

      stc (lin, ch);
      stc ("                                      Chi\n\r", ch);
      stc (lin, ch);
      sprintf (buf,
	       "                 You have attained a level %d mastery of your Ch'i.\n\r",
	       ch->chi[MAXIMUM]);
      stc (buf, ch);
      if (ch->chi[CURRENT] > 0)
	{
	  sprintf (buf,
		   "                     Your ch'i is currently active at level %d\n\r",
		   ch->chi[CURRENT]);
	  stc (buf, ch);
	}
      else
	stc (" 	 	    You are currently not focusing your ch'i\n\r",
	     ch);
      stc (lin, ch);
      return;
    }

  if (!str_cmp (arg1, "fight"))
    {
      if (!str_cmp (arg, "trip"))
	inpart = FS_TRIP;
      else if (!str_cmp (arg, "kick"))
	inpart = FS_KICK;
      else if (!str_cmp (arg, "bash"))
	inpart = FS_BASH;
      else if (!str_cmp (arg, "elbow"))
	inpart = FS_ELBOW;
      else if (!str_cmp (arg, "knee"))
	inpart = FS_KNEE;
      else if (!str_cmp (arg, "headbutt"))
	inpart = FS_HEADBUTT;
      else if (!str_cmp (arg, "disarm"))
	inpart = FS_DISARM;
      else if (!str_cmp (arg, "bite"))
	inpart = FS_BITE;
      else if (!str_cmp (arg, "dirt"))
	inpart = FS_DIRT;
      else if (!str_cmp (arg, "grapple"))
	inpart = FS_GRAPPLE;
      else if (!str_cmp (arg, "punch"))
	inpart = FS_PUNCH;
      else if (!str_cmp (arg, "gouge"))
	inpart = FS_GOUGE;
      else if (!str_cmp (arg, "rip"))
	inpart = FS_RIP;
      else if (!str_cmp (arg, "stamp"))
	inpart = FS_STAMP;
      else if (!str_cmp (arg, "backfist"))
	inpart = FS_BACKFIST;
      else if (!str_cmp (arg, "jumpkick"))
	inpart = FS_JUMPKICK;
      else if (!str_cmp (arg, "spinkick"))
	inpart = FS_SPINKICK;
      else if (!str_cmp (arg, "hurl"))
	inpart = FS_HURL;
      else if (!str_cmp (arg, "sweep"))
	inpart = FS_SWEEP;
      else if (!str_cmp (arg, "charge"))
	inpart = FS_CHARGE;
      else
	{
	  do_learn (ch, "");
	  return;
	}
      if (IS_FS (ch, inpart))
	{
	  send_to_char ("You have already got that power.\n\r", ch);
	  return;
	}
      if (ch->pcdata->power[POWER_CURRENT] < cost)
	{
	  sprintf (buf, "You need %d more %s points to learn that power.\n\r",
		   (cost - ch->pcdata->power[POWER_CURRENT]), get_class (ch));
	  stc (buf, ch);
	  return;
	}

      SET_BIT (ch->monkstuff, inpart);
      ch->pcdata->power[POWER_CURRENT] -= cost;
      send_to_char ("Ok.\n\r", ch);
      save_char_obj (ch);
      return;
    }
  else if (!str_cmp (arg1, "techniques"))
    {
      if (!str_cmp (arg, "knee"))
	{
	  inpart = TECH_KNEE;
	  cost = 20000;
	}
      else if (!str_cmp (arg, "spin"))
	{
	  inpart = TECH_SPIN;
	  cost = 20000;
	}
      else if (!str_cmp (arg, "backfist"))
	{
	  inpart = TECH_BACK;
	  cost = 20000;
	}
      else if (!str_cmp (arg, "elbow"))
	{
	  inpart = TECH_ELBOW;
	  cost = 20000;
	}
      else if (!str_cmp (arg, "palm"))
	{
	  inpart = TECH_PALM;
	  cost = 20000;
	}
      else if (!str_cmp (arg, "shin"))
	{
	  inpart = TECH_SHIN;
	  cost = 20000;
	}
      else if (!str_cmp (arg, "sweep"))
	{
	  inpart = TECH_SWEEP;
	  cost = 20000;
	}
      else if (!str_cmp (arg, "thrust"))
	{
	  inpart = TECH_THRUST;
	  cost = 20000;
	}
      else
	{
	  do_learn (ch, "");
	  return;
	}
      if (IS_FS (ch, inpart))
	{
	  send_to_char ("You have already got that power.\n\r", ch);
	  return;
	}
      if (ch->pcdata->power[POWER_CURRENT] < cost)
	{
	  sprintf (buf, "You need %d more %s points to learn that power.\n\r",
		   (cost - ch->pcdata->power[POWER_CURRENT]), get_class (ch));
	  stc (buf, ch);
	  return;
	}

      SET_BIT (ch->monkstuff, inpart);
      ch->pcdata->power[POWER_CURRENT] -= cost;
      send_to_char ("Ok.\n\r", ch);
      save_char_obj (ch);
      return;
    }
  else if (!str_cmp (arg1, "abilities"))
    {
      if (!str_cmp (arg, "body"))
	{
	  inpart = BODY;
	  cost = ch->monkab[inpart] * 5000;
	}
      else if (!str_cmp (arg, "combat"))
	{
	  inpart = COMBAT;
	  cost = ch->monkab[inpart] * 5000;
	}
      else if (!str_cmp (arg, "spirit"))
	{
	  inpart = SPIRIT;
	  cost = ch->monkab[inpart] * 5000;
	}
      else if (!str_cmp (arg, "awareness"))
	{
	  inpart = AWARE;
	  cost = ch->monkab[inpart] * 5000;
	}
      else if (!str_cmp (arg, "holiness") && IS_SAINT (ch))
	{
	  inpart = HOLY;
	  cost = ch->monkab[inpart] * 5000;
	}
      else if (!str_cmp (arg, "nightmare") && IS_TAKARRA (ch))
	{
	  inpart = NITE;
	  cost = ch->monkab[inpart] * 5000;
	}
      else
	{
	  do_learn (ch, "");
	  return;
	}

      if (ch->monkab[inpart] >= 5)
	{
	  stc ("You have already learned all you can in this ability.\n\r",
	       ch);
	  return;
	}

      if (ch->pcdata->power[POWER_CURRENT] < cost)
	{
	  sprintf (buf, "You need %d more %s points to learn that power.\n\r",
		   (cost - ch->pcdata->power[POWER_CURRENT]), get_class (ch));
	  stc (buf, ch);
	  return;
	}

      ch->monkab[inpart]++;
      ch->pcdata->power[POWER_CURRENT] -= cost;
      send_to_char ("Ok.\n\r", ch);
      save_char_obj (ch);
      return;
    }
  else if (!str_cmp (arg1, "chi"))
    {
      inpart = MAXIMUM;
      cost = (ch->chi[inpart] + 1) * 10000;

      if (ch->class == CLASS_MONK)
	{
	  if (ch->chi[inpart] >= 6)
	    {
	      stc ("You have already mastered your ch'i.\n\r", ch);
	      return;
	    }
	}
      else
	{
	  if (ch->chi[inpart] >= 3)
	    {
	      stc ("You have already mastered your ch'i.\n\r", ch);
	      return;
	    }
	}

      if (ch->pcdata->power[POWER_CURRENT] < cost)
	{
	  sprintf (buf, "You need %d more %s points to learn that power.\n\r",
		   (cost - ch->pcdata->power[POWER_CURRENT]), get_class (ch));
	  stc (buf, ch);
	  return;
	}

      ch->pcdata->power[POWER_CURRENT] -= cost;
      ch->chi[inpart]++;
      save_char_obj (ch);
      stc ("You gain more control over your ch'i.\n\r", ch);
      return;
    }
  else
    {
      do_learn (ch, "");
      return;
    }
}

Site Stats

Snippets: 1791
Codebases: 571