skills3.c

FlCodebase3.1/src/skills3.c · 168.2 KB

From the archive FlCodebase3.1.tgz

Download the archive   « Back to the archive contents

/***************************************************************************
 *  Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer,        *
 *  Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe.   *
 *                                                                         *
 *  Merc Diku Mud improvments copyright (C) 1992, 1993 by Michael          *
 *  Chastain, Michael Quan, and Mitchell Tse.                              *
 *                                                                         *
 *  In order to use any part of this Envy Diku Mud, you must comply with   *
 *  the original Diku license in 'license.doc', the Merc license in        *
 *  'license.txt', as well as the Envy license in 'license.nvy'.           *
 *  In particular, you may not remove either of these copyright notices.   *
 *                                                                         *
 *  Much time and thought has gone into this software and you are          *
 *  benefitting.  We hope that you share your changes too.  What goes      *
 *  around, comes around.                                                  * 
 *                                                                         *
 *      ROM 2.4 is copyright 1993-1998 Russ Taylor                         *
 *      ROM has been brought to you by the ROM consortium                  *
 *          Russ Taylor (rtaylor@hypercube.org)                            *
 *          Gabrielle Taylor (gtaylor@hypercube.org)                       *
 *          Brian Moore (zump@rom.org)                                     *
 *      By using this code, you have agreed to follow the terms of the     *
 *      ROM license, in the file Rom24/doc/rom.license                     *
 *                                                                         *
 * Code Adapted and Improved by Abandoned Realms Mud                       *
 * and Aabahran: The Forsaken Lands Mud by Virigoth                        *
 *                                                                         *
 * Continued Production of this code is available at www.flcodebase.com    *
 ***************************************************************************/


#include <sys/types.h>
#include <sys/time.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "merc.h"
#include "magic.h"
#include "recycle.h"
#include "interp.h"
#include "jail.h"

extern int study_range_bonus( int level );
bool is_empowered( CHAR_DATA *ch, int type )
{
  if (type == 1 && ch->class == gcn_blademaster){
    if (is_affected(ch, gsn_deathweaver))
      return TRUE;
    else
      return FALSE;
  }
  else if (ch->class != gcn_monk)
    return TRUE;
  if (is_affected(ch,gsn_empower))
    {
      send_to_char("You are still charging up!\n\r",ch);
      return FALSE;
    }
  if (type == 0 && !is_affected(ch,gsn_offensive))
    {
      send_to_char("You have not empowered your offensive abilities!\n\r",ch);
      return FALSE;
    }
  else if (type == 1 && !is_affected(ch,gsn_defensive))
    {
      send_to_char("You have not empowered your defensive abilities!\n\r",ch);
      return FALSE;
    }
  else if (type == 3 && !is_affected(ch, gsn_defensive) && !is_affected(ch, gsn_offensive)){
    send_to_char("You have not empowered!\n\r",ch);
    return FALSE;
  }
  
  return TRUE;
}

bool is_empowered_quiet( CHAR_DATA *ch, int type )
{
  if (type == 1 && ch->class == gcn_blademaster){
    if (is_affected(ch, gsn_deathweaver))
      return TRUE;
    else
      return FALSE;
  }
  else if (ch->class != gcn_monk)
    return TRUE;
  if (is_affected(ch,gsn_empower))
    return FALSE;
  else if (type == 0 && !is_affected(ch,gsn_offensive))
    return FALSE;
  else if (type == 1 && !is_affected(ch,gsn_defensive))
    return FALSE;
  else if (type == 3 && !is_affected(ch, gsn_defensive) && !is_affected(ch, gsn_offensive))
    return FALSE;
  return TRUE;
}
  
void do_beads( CHAR_DATA *ch, char *argument )
{
    char arg[MIL];
    int mana, chance;
    OBJ_DATA *beads;
    AFFECT_DATA *paf;
    if ((chance = get_skill(ch,gsn_beads)) == 0)
    {
        send_to_char("You don't know how to make prayer beads.\n\r",ch);
        return;
    }
    if (argument[0] == '\0')
    {
	send_to_char("How much power do you want to use?\n\r",ch);
	return;
    }
    argument = one_argument(argument,arg);
    if (!is_number(arg))
    {
	send_to_char("Argument must be numerical.\n\r",ch);
	return;
    }
    mana = atoi(arg);
    if (ch->mana < mana)
    {
        send_to_char("You don't have that much power.\n\r",ch);
        return;
    }
    if (mana < 50 || mana > 500)
    {
        send_to_char("You must use between 50 and 500 mana.\n\r",ch);
        return;
    }
    WAIT_STATE2( ch, skill_table[gsn_beads].beats );
    if( number_percent( ) < chance)
    {
      int level = ch->level;
      beads = create_object( get_obj_index( OBJ_VNUM_PRAYER_BEADS ), 0);
      beads->level = level;
      beads->timer = 168;
      paf = new_affect();

      paf->type       = gsn_beads;
      paf->level      = ch->level;
      paf->duration   = -1;
      paf->location   = APPLY_HITROLL;
      paf->modifier   = mana/50;
      paf->bitvector  = 0;
      paf->next       = beads->affected;
      beads->affected = paf;
      paf = new_affect();
      paf->type       = gsn_beads;
      paf->level      = level;
      paf->duration   = -1;
      paf->location   = APPLY_AC;
      paf->modifier   = 0 - mana/10;
      paf->bitvector  = 0;
      paf->next       = beads->affected;
      beads->affected = paf;
      paf = new_affect();
      paf->type       = gsn_beads;
      paf->level      = level;
      paf->duration   = -1;
      paf->location   = APPLY_SAVING_SPELL;
      paf->modifier   = 0 - mana/100;
      paf->bitvector  = 0;
      paf->next       = beads->affected;
      beads->affected = paf;
      paf = new_affect();
      paf->type       = gsn_beads;
      paf->level      = level;
      paf->duration   = -1;
      paf->location   = APPLY_LUCK;
      paf->modifier   = mana/100;
      paf->bitvector  = 0;
      paf->next       = beads->affected;
      beads->affected = paf;
      obj_to_char(beads, ch); 
      act( "You create $p.", ch, beads, NULL, TO_CHAR );
      act( "$n creates $p.", ch, beads, NULL, TO_ROOM );
      check_improve(ch,gsn_beads,TRUE,1);
      ch->mana -= mana;
      
    }
    else
      {   
        send_to_char("You failed to make prayer beads.\n\r",ch);
        check_improve(ch,gsn_beads,FALSE,2);
        ch->mana -= mana/2;
      }
}

void do_monkey(CHAR_DATA *ch, char *argument)
{
    int chance;
    if ((chance = get_skill(ch,gsn_monkey)) == 0)
    {
        send_to_char("You don't have that kind of control over your body.\n\r",ch);
        return;
    }
    if (!is_empowered(ch,0))
        return;
    if (!monk_good(ch, WEAR_ABOUT) || !monk_good(ch, WEAR_WAIST) || !monk_good(ch, WEAR_LEGS) || !monk_good(ch, WEAR_FEET)
 	|| !monk_good(ch, WEAR_ARMS) || !monk_good(ch, WEAR_HANDS) || !monk_good(ch, WEAR_BODY) || !monk_good(ch, WEAR_HEAD))
    {
        send_to_char("Your heavy equipment hinders your movement.\n\r",ch);
        return;
    }
    if (is_affected(ch,gsn_monkey))
    {
        send_to_char("You are already moving quickly.\n\r",ch);
        return;
    }
    if (is_affected(ch,gsn_tiger) || is_affected(ch,gsn_crane) || is_affected(ch,gsn_horse)
 	|| is_affected(ch,gsn_drunken) || is_affected(ch,gsn_buddha) || is_affected(ch,gsn_dragon))
    {
	send_to_char("You are already doing another stance.\n\r",ch);
	return;
    }
    if (ch->mana < 30) 
    {
        send_to_char("You lack the clarity of mind neccessary.\n\r",ch);
        return;
    }
    WAIT_STATE2( ch, skill_table[gsn_monkey].beats );
    if (number_percent() < chance)
    {
        AFFECT_DATA af;
	af.where	= TO_AFFECTS;
        af.type   = gsn_monkey;
        af.level  = ch->level;
        af.duration = 12;
        af.modifier = 1 + (ch->level >= 40);
        af.location = APPLY_DEX;
        af.bitvector = 0;
        affect_to_char(ch,&af);
        ch->mana -= 30;
        act("You move with the speed and agility of a monkey.",ch,NULL,NULL,TO_CHAR);
        act("$n moves with the speed and agility of a monkey.",ch,NULL,NULL,TO_ROOM);
        check_improve(ch,gsn_monkey,TRUE,1);
    }
    else
    {
        ch->mana -= 15;
        act("You failed to do the stance.",ch,NULL,NULL,TO_CHAR);
        act("$n's moves oddly for a while, then returns back to normal.",ch,NULL,NULL,TO_ROOM);
        check_improve(ch,gsn_monkey,FALSE,2);
    }
}

void do_catalepsy( CHAR_DATA *ch, char *argument )
{
    int chance;
    OBJ_DATA *corpse;
    if ((chance = get_skill(ch,gsn_catalepsy)) == 0)
    {
        send_to_char("You don't have that kind of control over your body.\n\r",ch);
        return;
    }
    if (!is_empowered(ch,1))
        return;
    if (ch->mana < 25)
    {
        send_to_char("You don't have enough power.\n\r",ch);
        return;
    }
    WAIT_STATE2( ch, skill_table[gsn_catalepsy].beats );
    if( number_percent( ) < chance)
    {
	char buf[MSL];
        act( "You induce catalepsy.", ch, NULL, NULL, TO_CHAR );
        act( "$n becomes still.", ch, NULL, NULL, TO_ROOM );
        check_improve(ch,gsn_catalepsy,TRUE,1);
	ch->position = POS_SLEEPING;
	SET_BIT(ch->affected2_by, AFF_CATALEPSY);
        ch->mana -= 25;
	corpse = create_object(get_obj_index(OBJ_VNUM_FAKE_CORPSE), 0);
        sprintf( buf, corpse->short_descr, ch->name );
	free_string( corpse->short_descr );
	corpse->short_descr = str_dup( buf );
	sprintf( buf, corpse->description, ch->name );
	free_string( corpse->description );
	corpse->description = str_dup( buf );
        sprintf( buf, corpse->name, ch->name);
	free_string( corpse->name );
	corpse->name = str_dup( buf );
	corpse->timer = -1;
	obj_to_room( corpse, ch->in_room );
    }
    else
    {   
        send_to_char("You failed to induce catalepsy.\n\r",ch);
        check_improve(ch,gsn_catalepsy,FALSE,2);
        ch->mana -= 12;
    }
}

void do_revive( CHAR_DATA *ch, char *argument )
{
    char buf[MSL];
    OBJ_DATA *corpse;
    if (ch->position == POS_MEDITATE)
    {
	do_sit(ch,"");
	return;
    }
    if (!IS_AFFECTED2(ch, AFF_CATALEPSY))
    {
	send_to_char("You're already alive.\n\r", ch);
	return;
    }
    send_to_char("You wake up from the dead.\n\r", ch);
    ch->position = POS_RESTING;
    REMOVE_BIT(ch->affected2_by, AFF_CATALEPSY);
    sprintf(buf, "%s%s", ch->name, "isdabomb");
    corpse = get_obj_list( ch, buf, ch->in_room->contents );
    if ( corpse != NULL )
    {
	obj_from_room( corpse );
	extract_obj( corpse );
    }
}

void do_throw_monk( CHAR_DATA *ch, char *argument )
{
    char arg[MIL], buf[MSL];
    CHAR_DATA *victim;
    int chance;
    bool surprise = FALSE;
    one_argument(argument,arg);
    if ( (chance = get_skill(ch,gsn_throw)) == 0)
    {
        send_to_char("Throwing?  What's that?\n\r",ch);
        return;
    }
    if (ch->fighting == NULL)
	surprise = TRUE;
    if (arg[0] == '\0')
    {
        victim = ch->fighting; 
        if (victim == NULL)
        {
            send_to_char("But you aren't fighting anyone!\n\r",ch);
            return;
        }
    }
    else if ((victim = get_char_room(ch, NULL, arg)) == NULL)
    {   
        send_to_char("They aren't here.\n\r",ch);
        return;
    }
    if (is_safe(ch,victim))
        return;
    if (IS_NPC(victim) && IS_SET(victim->act,ACT_TOO_BIG) )
    {
	send_to_char("They are too big to be thrown.\n\r", ch);
	return;
    }
    if (!IS_NPC(ch) && ch->pcdata->pStallion != NULL)
    {
      sendf(ch, "You can't throw while on %s.\n\r",ch->pcdata->pStallion->short_descr);
      return;
    }
    if ( victim == ch )
        return;
    if (is_safe(ch,victim))
        return;
    if ( IS_AFFECTED(ch, AFF_CHARM) && ch->master == victim )
    {
        sendf(ch, "%s is your beloved master.\n\r", PERS(victim,ch) );
        return;
    }
    if (!IS_NPC(victim))
        chance += ch->carry_weight/100 - victim->carry_weight/50;
    else
	chance += ch->carry_weight/100 - victim->level/10;
    chance += get_curr_stat(ch,STAT_STR) - get_curr_stat(victim,STAT_STR);
    chance -= get_skill(victim,gsn_counter)/20;
    chance += (ch->level - victim->level);   
    chance += (ch->size - victim->size) * 5;
    chance += (get_curr_stat(ch,STAT_LUCK) - get_curr_stat(victim,STAT_LUCK));
    if (surprise)
	chance *= 1.5;
    a_yell(ch,victim);
    if (number_percent() < chance)
    {
	int diff;
	if (!IS_NPC(victim))
	    diff = victim->size*5 + victim->carry_weight/50 + get_curr_stat(ch, STAT_STR) - 15;
	else
	    diff = victim->size*5 + victim->level/5 + get_curr_stat(ch,STAT_STR) - 15;
	if (surprise)
	    diff *= 1.5;
        if (ch->fighting != victim && victim->fighting != ch)
        {
            sprintf(buf, "Help! %s just threw me!",PERS(ch,victim));
            j_yell(victim,buf);
        }
        if (number_percent() < get_skill(victim, gsn_balance) && is_empowered_quiet(victim,1) && victim->mana > 0)
        {
            act("$n throws you but you land on your feet!",ch,NULL,victim,TO_VICT);
            act("You throw $N but $E lands on $S feet!",ch,NULL,victim,TO_CHAR);
            act("$n throws $N but $E lands on $S feet.",ch,NULL,victim,TO_NOTVICT);
            check_improve(victim,gsn_balance,TRUE,30);  
	    victim->mana -= URANGE(0,40,victim->mana);
        }
	else
	{
            act("$n throws you and you land on your back!",ch,NULL,victim,TO_VICT);
            act("You throw $N and $E lands on $S back!",ch,NULL,victim,TO_CHAR);
            act("$n throws $N and $E lands on $S back.",ch,NULL,victim,TO_NOTVICT);
	    if (!is_affected(victim, gsn_iron_will) || number_percent() < 50 + ch->level - victim->level){
	      WAIT_STATE2(victim, UMIN(2,number_range(victim->size,1)) * PULSE_VIOLENCE);
	      victim->position = POS_RESTING;
	    }
	    else{
	      send_to_char("Through your force of will you remain upright.\n\r", victim);
	      act("$n somehow remains upright.", victim, NULL, NULL, TO_ROOM);
	      victim->mana -= URANGE(0,25,victim->mana);
	    }
	}
        WAIT_STATE2(ch,skill_table[gsn_throw].beats);
        damage(ch,victim,number_range(diff, diff + chance/10 + ch->level/2),gsn_throw,DAM_BASH,TRUE);
        check_improve(ch,gsn_throw,TRUE,1);
    }
    else
    {
        if (ch->fighting != victim && victim->fighting != ch)
        {
            sprintf(buf, "Help! %s tried to throw me!",PERS(ch,victim));
            j_yell(victim,buf);
        }
        damage(ch,victim,0,gsn_throw,DAM_BASH,TRUE);
        check_improve(ch,gsn_throw,FALSE,1);
        WAIT_STATE2(ch,skill_table[gsn_throw].beats*2/3);
    }       
}

void do_sense_motion(CHAR_DATA *ch, char *argument)
{
    int chance;
    if ((chance = get_skill(ch,gsn_sense_motion)) == 0)
    {
        send_to_char("You lack the concentration.\n\r",ch);
        return;
    }
    if (!monk_good(ch, WEAR_HEAD))
    {
        send_to_char("Your heavy equipment hinders your senses.\n\r",ch);
        return;
    }
    if (is_affected(ch,gsn_sense_motion))
    {
        send_to_char("You are already as aware as you can get.\n\r",ch);
        return;
    }
    if (ch->mana < 25) 
    {
        send_to_char("You don't have enough power.\n\r",ch);
        return;
    }
    WAIT_STATE2( ch, skill_table[gsn_sense_motion].beats );
    if (number_percent() < chance)
    {
        AFFECT_DATA af;
	af.where	= TO_AFFECTS;
        af.type   = gsn_sense_motion;
        af.level  = ch->level;
        af.duration = ch->level / 2;
        af.modifier = 0;
        af.location = 0;
        af.bitvector = 0;
        affect_to_char(ch,&af);
        ch->mana -= 25;
        act("You become more aware of what's around you.",ch,NULL,NULL,TO_CHAR);
        check_improve(ch,gsn_sense_motion,TRUE,1);
    }
    else
    {
        ch->mana -= 12;
        act("Your concentration is disturbed.",ch,NULL,NULL,TO_CHAR);
        check_improve(ch,gsn_sense_motion,FALSE,1);
    }
}

void do_horse(CHAR_DATA *ch, char *argument)
{
    int chance;
    if ((chance = get_skill(ch,gsn_horse)) == 0)
    {
        send_to_char("You lack the control.\n\r",ch);
        return;
    }
    if (!is_empowered(ch,1))
        return;
    if (!monk_good(ch, WEAR_HEAD))
    {
        send_to_char("Your heavy equipment hinders your control.\n\r",ch);
        return;
    }
    if (is_affected(ch,gsn_horse))
    {
        send_to_char("You are already in the horse stance.\n\r",ch);
        return;
    }
    if (is_affected(ch,gsn_tiger) || is_affected(ch,gsn_crane) || is_affected(ch,gsn_monkey)
 	|| is_affected(ch,gsn_drunken) || is_affected(ch,gsn_buddha) || is_affected(ch,gsn_dragon))
    {
	send_to_char("You are already doing another stance.\n\r",ch);
	return;
    }
    if (ch->mana < 30) 
    {
        send_to_char("You don't have enough power.\n\r",ch);
        return;
    }
    WAIT_STATE2( ch, skill_table[gsn_horse].beats );
    if (number_percent() < chance)
    {
        AFFECT_DATA af;
	af.where	= TO_AFFECTS;
        af.type   = gsn_horse;
        af.level  = ch->level;
        af.duration = 12;
        af.modifier = ch->level / 15;
        af.location = APPLY_CON;
        af.bitvector = 0;
        affect_to_char(ch,&af);
        ch->mana -= 30;
        act("You position yourself with the stability and endurance of a horse.",ch,NULL,NULL,TO_CHAR);
        check_improve(ch,gsn_horse,TRUE,1);
    }
    else
    {
        ch->mana -= 15;
        act("You failed to do the stance.",ch,NULL,NULL,TO_CHAR);
        check_improve(ch,gsn_horse,FALSE,1);
    }
}

void do_aura(CHAR_DATA *ch, char *argument)
{
    int chance;
    if ((chance = get_skill(ch,gsn_aura)) == 0)
    {
        send_to_char("You lack the concentration.\n\r",ch);
        return;
    }
    if (!is_empowered(ch,1))
        return;
    if (is_affected(ch,gsn_aura))
    {
        send_to_char("There is already an aura surrounding you.\n\r",ch);
        return;
    }
    if (ch->mana < 50) 
    {
        send_to_char("You don't have enough power.\n\r",ch);
        return;
    }
    WAIT_STATE2( ch, skill_table[gsn_aura].beats );
    if (number_percent() < chance)
    {
        AFFECT_DATA af;
	af.where	= TO_AFFECTS;
        af.type   = gsn_aura;
        af.level  = ch->level;
        af.duration = ch->level / 2;
        af.modifier = 0 - ch->level;
        af.location = APPLY_AC;
        af.bitvector = 0;
        affect_to_char(ch,&af);
        ch->mana -= 50;
        act_new( "An aura surrounds you in a blanket of warmth and safety.", ch, NULL, NULL, TO_CHAR, POS_DEAD );
        act( "A blindingly bright aura surrounds $n.", ch, NULL, NULL, TO_ROOM );
        check_improve(ch,gsn_aura,TRUE,1);
    }
    else
    {
        ch->mana -= 25;
        act("Your concentration is disturbed.",ch,NULL,NULL,TO_CHAR);
        check_improve(ch,gsn_aura,FALSE,1);
    }
}

void do_healing(CHAR_DATA *ch, char *argument)
{
    int chance;
    CHAR_DATA* victim = ch;
    int level = victim->level;

    if ((chance = get_skill(ch,gsn_healing)) == 0)
    {
        send_to_char("You lack the knowledge.\n\r",ch);
        return;
    }
    if (is_affected(ch,gsn_healing))
    {
        send_to_char("You cannot sustain another healing session at this time.\n\r",ch);
        return;
    }
    if (ch->mana < 50) 
    {
        send_to_char("You don't have enough power.\n\r",ch);
        return;
    }
    WAIT_STATE( ch, skill_table[gsn_healing].beats );
//Embrace check.
    if (is_affected(victim, gsn_embrace_poison))
      {
	if (embrace_heal_check(gsn_heal, level, ch, ch,  0))
	  affect_strip(victim, gsn_embrace_poison);
	else
	  return;
      }
    if (number_percent() < chance && !is_affected(ch, gen_unlife))
    {
        AFFECT_DATA af;
	af.where	= TO_AFFECTS;
        af.type   = gsn_healing;
        af.level  = ch->level;
        af.duration = 24;
        af.modifier = 0;
        af.location = 0;
        af.bitvector = 0;
        affect_to_char(ch,&af);
        act("A warm feeling floods your body and you feel much better.",ch,NULL,NULL,TO_CHAR);
        act("$n starts glowing and then $e fades.",ch,NULL,NULL,TO_ROOM);
        ch->hit = UMIN(ch->max_hit, ch->hit + (ch->max_hit - ch->hit) / 3 + ch->level );
        ch->mana -= 50;
        affect_strip(ch,gsn_death_grasp);
	if (IS_AFFECTED(ch, AFF_BLIND)){
	  check_dispel(level,ch,gsn_blindness);
	}	
	if (IS_AFFECTED(ch,AFF_POISON)){
	  check_dispel(level,victim,gsn_poison);
	}
	if (IS_AFFECTED(ch, AFF_PLAGUE)){
	  check_dispel(level,victim,gsn_plague);
	}
	if (IS_AFFECTED(ch, AFF_CURSE)){
	  check_dispel(level,victim,gsn_curse);
	}
        check_improve(ch,gsn_healing,TRUE,1);
        ch->pcdata->condition[COND_HUNGER] = UMIN( ch->pcdata->condition[COND_HUNGER], 5);
        ch->pcdata->condition[COND_THIRST] = UMIN( ch->pcdata->condition[COND_THIRST], 5);
    }
    else
    {
        ch->mana -= 25;
        act("Your concentration is disturbed.",ch,NULL,NULL,TO_CHAR);
        check_improve(ch,gsn_healing,FALSE,1);
    }
}

void do_empower(CHAR_DATA *ch, char *argument)
{
    char arg[MIL];
    AFFECT_DATA af, *paf;
    int times = 100;
    if (ch->class != class_lookup("monk"))
    {
	send_to_char("Huh?\n\r",ch);
	return;
    }
    for ( paf = ch->affected; paf != NULL; paf = paf->next )
        if (paf->type == gsn_offensive || paf->type == gsn_defensive)
	{
            times = 26 - paf->duration;
	    break;
	}
    if ((is_affected(ch,gsn_empower) || times < 8) && !IS_IMMORTAL(ch))
    {
	send_to_char("You are not ready to empower another ability yet.\n\r",ch);
	return;
    }
    if (argument[0] == '\0')
    {
	send_to_char("What do you want to empower?\n\r",ch);
	return;
    }
    argument = one_argument(argument,arg);
    if (!str_prefix(arg, "offense"))
    {
	if (is_affected(ch,gsn_offensive))
	{
	    send_to_char("You are still under offensive empowerment.\n\r",ch);
	    return;
	}
	if (is_affected(ch,gsn_defensive))
	    affect_strip(ch,gsn_defensive);
	if (is_affected(ch,gsn_sneak))
	    affect_strip(ch,gsn_sneak);
	if (is_affected(ch,gsn_horse))
	    affect_strip(ch,gsn_horse);
	if (is_affected(ch,gsn_buddha))
	    affect_strip(ch,gsn_buddha);
	if (is_affected(ch,gsn_mantis))
	    affect_strip(ch,gsn_mantis);
	if (is_affected(ch,gsn_drunken))
	    affect_strip(ch,gsn_drunken);
	if (is_affected(ch,gsn_aura))
	    affect_strip(ch,gsn_aura);
	af.where	= TO_AFFECTS;
        af.type   = gsn_offensive;
        af.level  = ch->level;
        af.duration = 26;
        af.modifier = 0;
        af.location = 0;
        af.bitvector = 0;
        affect_to_char(ch,&af);
	act("You begin empowering your offensive skills.",ch,NULL,NULL,TO_CHAR);	
	act("$n starts emitting a red battle aura.",ch,NULL,NULL,TO_ROOM);
    }
    else if (!str_prefix(arg, "defense"))
    {
	if (is_affected(ch,gsn_defensive))
	{
	    send_to_char("You are still under defensive empowerment.\n\r",ch);
	    return;
	}
	if (is_affected(ch,gsn_offensive))
	    affect_strip(ch,gsn_offensive);
	if (is_affected(ch,gsn_monkey))
	    affect_strip(ch,gsn_monkey);
	if (is_affected(ch,gsn_dragon))
	    affect_strip(ch,gsn_dragon);
	if (is_affected(ch,gsn_tiger))
	    affect_strip(ch,gsn_tiger);
	if (is_affected(ch,gsn_crane))
	    affect_strip(ch,gsn_crane);
	if (is_affected(ch,gsn_chii_bolt))
	    affect_strip(ch,gsn_chii_bolt);
	af.where	= TO_AFFECTS;
        af.type   = gsn_defensive;
        af.level  = ch->level;
        af.duration = 26;
        af.modifier = 0;
        af.location = 0;
        af.bitvector = 0;
        affect_to_char(ch,&af);
	act("You begin empowering your defensive skills.",ch,NULL,NULL,TO_CHAR);	
	act("$n starts emitting a blue peaceful aura.",ch,NULL,NULL,TO_ROOM);
    }
    else
    {
	send_to_char("You can't empower that.\n\r",ch);
	return;
    }
    if (!IS_IMMORTAL(ch))
    {
    af.where	= TO_AFFECTS;
    af.type   = gsn_empower;
    af.level  = ch->level;
    af.duration = 1;
    af.modifier = 0;
    af.location = 0;
    af.bitvector = 0;
    affect_to_char(ch,&af);
    }
}

void do_thrash(CHAR_DATA *ch, char *argument)
{
    char arg[MIL];
    AFFECT_DATA af;
    CHAR_DATA *victim;
    int chance;   
    bool fMount = FALSE;

    argument = one_argument(argument,arg);
    if ( (chance = get_skill(ch,gsn_thrash)) == 0)
    {
        send_to_char("You don't know how to air thrash.\n\r",ch);
        return;
    }
    if (!is_empowered(ch,0))
        return;
    if (arg[0] == '\0')
    {
        victim = ch->fighting;
        if (victim == NULL)
        {
            send_to_char("But you aren't fighting anyone!\n\r",ch);
            return;
        }
    }
    else if ((victim = get_char_room(ch, NULL, arg)) == NULL)
    {
        send_to_char("They aren't here.\n\r",ch);
        return;
    }
    if (is_safe(ch,victim))
        return;
    if ( IS_AFFECTED(ch, AFF_CHARM) && ch->master == victim )
    {
        sendf(ch, "%s is your beloved master.\n\r", PERS(victim,ch) );
        return;
    }
    if (!IS_NPC(victim) && victim->pcdata->pStallion != NULL && get_skill(victim, gsn_mounted) > 2)
      fMount = TRUE;
    if ((!IS_AFFECTED(victim,AFF_FLYING) && !fMount)
	|| is_affected(victim,gsn_thrash))
      {
        act("$E isn't flying.",ch,NULL,victim,TO_CHAR);
        return;
      }

    WAIT_STATE2(ch, skill_table[gsn_thrash].beats);
    chance = 4 * chance / 5;
    chance += (get_curr_stat(ch,STAT_STR) - get_curr_stat(victim, STAT_STR)) *2;
    chance += (get_curr_stat(ch,STAT_DEX) - get_curr_stat(victim,STAT_DEX)) *2;
    chance -= get_skill(victim,gsn_dodge)/5;
    chance += (ch->level - victim->level);
    chance += affect_by_size(ch,victim);
    chance += get_curr_stat(ch,STAT_LUCK) - get_curr_stat(victim,STAT_LUCK);

    a_yell(ch,victim);
    //predict interdict
    if (predictCheck(ch, victim, "thrash", skill_table[gsn_thrash].name))
      return;

    if (number_percent() < chance )
    {
      if (fMount)
	victim->pcdata->pStallion = NULL;

      if (ch->fighting != victim && victim->fighting != ch){
	char buf[MIL];
	sprintf(buf, "Help! %s just sent me to the ground!",PERS(ch,victim));
	j_yell(victim,buf);
      }
      if (is_affected(victim,gsn_mantis) && !IS_AFFECTED(victim,AFF_FLYING) && !is_affected(victim,gsn_thrash))
	{
	  act("You reversed $n's air thrash, and thrash $m to the ground!",ch,NULL,victim,TO_VICT);
	  act("$N reverses your air thrash, and thrashes you to the ground!",ch,NULL,victim,TO_CHAR);
	  act("$N reversed $n's air thrash, and thrashes $m to the ground.",ch,NULL,victim,TO_NOTVICT);
	  if (!(is_affected(ch, gsn_iron_will)  && ch->mana > 0) || number_percent() < 50 + victim->level - ch->level){
	    WAIT_STATE2(ch,24);
            ch->position = POS_RESTING;
	  }
	  else{
	    send_to_char("Through your force of will you remain upright.\n\r", ch);
	    act("$n somehow remains upright.", ch, NULL, NULL, TO_ROOM);
	    ch->mana -= URANGE(0,25,ch->mana);
	  }
    	    WAIT_STATE2(victim, 12);
    	    damage(victim,ch,number_range(10 + victim->level/2,5 * victim->size + chance/10 + (2 * victim->level /3)),gsn_thrash,DAM_BASH,TRUE);
            affect_strip(victim,gsn_mantis);
	    return;
	}
      if (number_percent() < get_skill(victim, gsn_balance) - chance/2 && is_empowered_quiet(victim,1) && victim->mana > 0)
        {
	  act("$n jumps in the air and thrashes you to the ground, but you keep your balance!",ch,NULL,victim,TO_VICT);
	  act("You jump in the air and thrash $N to the ground, but $E keeps $S balance!",ch,NULL,victim,TO_CHAR);
	  act("$n jumps in the air and thrashes $N to the ground, and $E keeps $S balance.",ch,NULL,victim,TO_NOTVICT);
	  check_improve(victim,gsn_balance,TRUE,50); 
	  victim->mana -= URANGE(0,30,victim->mana);
        }
      else
        {
	  act("$n jumps in the air and thrashes you to the ground!",ch,NULL,victim,TO_VICT);
	  act("You jump in the air and thrash $N to the ground!",ch,NULL,victim,TO_CHAR);
	  act("$n jumps in the air and thrashes $N to the ground!",ch,NULL,victim,TO_NOTVICT);
	  if (!(is_affected(victim, gsn_iron_will)  && victim->mana > 0) || number_percent() < 50 + ch->level - victim->level){
	    WAIT_STATE2(victim, 12);
	    victim->position = POS_RESTING;
	  }
	  else{
	    send_to_char("Through your force of will you remain upright.\n\r", victim);
	    act("$n somehow remains upright.", victim, NULL, NULL, TO_ROOM);
	    victim->mana -= URANGE(0,25,victim->mana);
	  }
        }
      damage(ch,victim,number_range(10 + ch->level/2,5 * ch->size + chance/10 + (2 * ch->level /3)),gsn_thrash,DAM_BASH,TRUE);
      if (number_percent() < chance/4 + ch->level/2)
	{
	  af.where	= TO_AFFECTS;
	  af.type   = gsn_thrash;
	  af.level  = ch->level;
	  af.duration = 0;
	  af.modifier = 0;
	  af.location = 0;
	  af.bitvector = 0;
	  affect_to_char(victim,&af);
	  act("You can't seem to get back into the air",victim,NULL,NULL,TO_CHAR);
	  act("$n can't seem to get back into the air",victim,NULL,NULL,TO_ROOM);
	}
      check_improve(ch,gsn_thrash,TRUE,1);
    }
    else
    {
      if (ch->fighting != victim && victim->fighting != ch){
	char buf[MIL];
	sprintf(buf, "Help! %s just tried to send me to the ground!",PERS(ch,victim));
	j_yell(victim,buf);
      }
      
      act("$N manages to evade your air thrash.", ch,NULL,victim,TO_CHAR);
      act("$N manages to evade $n's air thrash.", ch,NULL,victim,TO_NOTVICT);
      act("You manage to evade $n's air thrash.",ch,NULL,victim,TO_VICT);
      damage(ch,victim,0,gsn_thrash,DAM_BASH,TRUE);
      check_improve(ch,gsn_thrash,FALSE,1);
    }
}

void do_chii_bolt(CHAR_DATA *ch, char *argument)
{
    char arg[MIL];
    char buf[MIL];
    AFFECT_DATA *paf;
    CHAR_DATA *victim;
    int chance, level = 0;
    argument = one_argument(argument,arg);
    if ( (chance = get_skill(ch,gsn_chii_bolt)) == 0)
    {
        send_to_char("You don't know how to chii bolt.\n\r",ch);
        return;
    }
    if (!is_empowered(ch,0))
        return;
    if (!is_affected(ch,gsn_chii_bolt))
    {
	send_to_char("You have no chii stored up.\n\r",ch);
	return;
    }
    for ( paf = ch->affected; paf != NULL; paf = paf->next )
        if (paf->type == gsn_chii_bolt)
	{
            level = paf->modifier;
	    break;
	}
    if (arg[0] == '\0')
    {
        victim = ch->fighting;
        if (victim == NULL)
        {
            send_to_char("But you aren't fighting anyone!\n\r",ch);
            return;
        }
    }
    else if ((victim = get_char_room(ch, NULL, arg)) == NULL)
    {
        send_to_char("They aren't here.\n\r",ch);
        return;
    }
    if (is_safe(ch,victim))
        return;
    if ( IS_AFFECTED(ch, AFF_CHARM) && ch->master == victim )
    {
        sendf(ch, "%s is your beloved master.\n\r", PERS(victim,ch) );
        return;
    }
    if (number_percent() > chance)
    {
	send_to_char("You failed to control your chii and it diffuses from your body.\n\r",ch);
    	damage(ch,victim,0,gsn_chii_bolt,DAM_BASH,TRUE);
    	check_improve(ch,gsn_chii_bolt,FALSE,1);
	return;
    }
    WAIT_STATE2(ch, PULSE_VIOLENCE);
    act("You release your stored chii at $N!",ch,NULL,victim,TO_CHAR);
    act("$n releases $s stored chii at $N!",ch,NULL,victim,TO_NOTVICT);
    act("$n release $s stored chii at you!",ch,NULL,victim,TO_VICT);

    a_yell(ch,victim);
    //predict interdict
    if (predictCheck(ch, victim, "bolt", skill_table[gsn_chii_bolt].name))
      return;

    if (ch->fighting != victim && victim->fighting != ch){
    
      sprintf(buf, "Help! %s released chii into me!",PERS(ch,victim));
      j_yell(victim,buf);
    }
    switch(level)
    {
	case (1) :
	    act("Your chii bolt knocks the wind out of $N.",ch,NULL,victim,TO_CHAR);
	    act("$n's chii bolt knocks the wind out of $N.",ch,NULL,victim,TO_NOTVICT);
	    act("$n's chii bolt knocks the wind out of you.",ch,NULL,victim,TO_VICT);
	    WAIT_STATE2(victim, 2 * PULSE_VIOLENCE);
	    damage(ch,victim,number_range(1,ch->level/4),gsn_chii_bolt,DAM_BASH,TRUE);
	    break;
	case (2) :
	    act("Your chii bolt knocks $N staggering backwards!",ch,NULL,victim,TO_CHAR);
	    act("$n's chii bolt knocks $N staggering backwards!",ch,NULL,victim,TO_NOTVICT);
	    act("$n's chii bolt knocks you staggering backwards!",ch,NULL,victim,TO_VICT);
	    WAIT_STATE2(victim, 3 * PULSE_VIOLENCE);
	    damage(ch,victim,number_range(ch->level/2,ch->level),gsn_chii_bolt,DAM_BASH,TRUE);
	    break;
	case (3) :
	  if (is_affected(victim, skill_lookup("armor")))
	    {
	      act("Your chii bolt collides into $N's armor and neutralizes it.",ch,NULL,victim,TO_CHAR);
	      act("$n's chii bolt collides into $N's armor and neutralizes it.",ch,NULL,victim,TO_NOTVICT);
	      act("$n's chii bolt collides into your armor and neutralizes it.",ch,NULL,victim,TO_VICT);
	      affect_strip(victim, skill_lookup("armor"));
	    }
	  if (is_affected(victim, skill_lookup("shield")))
	    {
	      act("Your chii bolt collides into $N's shield and neutralizes it.",ch,NULL,victim,TO_CHAR);
	      act("$n's chii bolt collides into $N's shield and neutralizes it.",ch,NULL,victim,TO_NOTVICT);
	      act("$n's chii bolt collides into your shield and neutralizes it.",ch,NULL,victim,TO_VICT);
	      affect_strip(victim, skill_lookup("shield"));
	    }
	  if (is_affected(victim, skill_lookup("protective shield")))
	    {
	      act("Your chii bolt collides into $N's protective shield and neutralizes it.",ch,NULL,victim,TO_CHAR);
	      act("$n's chii bolt collides into $N's protective shield and neutralizes it.",ch,NULL,victim,TO_NOTVICT);
	      act("$n's chii bolt collides into your protective shield and neutralizes it.",ch,NULL,victim,TO_VICT);
	      affect_strip(victim, gsn_protective_shield);
	    }
	  if (is_affected(victim, skill_lookup("barrier")))
	    {
	      act("Your chii bolt collides into $N's barrier and neutralizes it.",ch,NULL,victim,TO_CHAR);
	      act("$n's chii bolt collides into $N's barrier and neutralizes it.",ch,NULL,victim,TO_NOTVICT);
	      act("$n's chii bolt collides into your barrier and neutralizes it.",ch,NULL,victim,TO_VICT);
	      affect_strip(victim, skill_lookup("barrier"));
	    }
	  if (is_affected(victim, skill_lookup("force field"))){
	      act("Your chii bolt collides into $N's force field and collapses it.",ch,NULL,victim,TO_CHAR);
	      act("$n's chii bolt collides into $N's force field and collapses it.",ch,NULL,victim,TO_NOTVICT);
	      act("$n's chii bolt collides into your force field and collapses it.",ch,NULL,victim,TO_VICT);
	      affect_strip(victim, skill_lookup("force field"));
	  }
	  if (is_affected(victim, skill_lookup("reflective shield"))){
	      act("Your chii bolt collides into $N's reflective field and collapses it.",ch,NULL,victim,TO_CHAR);
	      act("$n's chii bolt collides into $N's reflective field and collapses it.",ch,NULL,victim,TO_NOTVICT);
	      act("$n's chii bolt collides into your reflective field and collapses it.",ch,NULL,victim,TO_VICT);
	      affect_strip(victim, skill_lookup("reflective shield"));
	  }
	  if (is_affected(victim, skill_lookup("spell turning"))){
	      act("Your chii bolt collides into $N's spell shield and cancells it.",ch,NULL,victim,TO_CHAR);
	      act("$n's chii bolt collides into $N's spell shield and cancells it.",ch,NULL,victim,TO_NOTVICT);
	      act("$n's chii bolt collides into your spell shield and cancells it.",ch,NULL,victim,TO_VICT);
	      affect_strip(victim, skill_lookup("spell turning"));
	  }
	  WAIT_STATE2(victim, number_range(1,3) * PULSE_VIOLENCE);
	  damage(ch,victim,number_range(1,ch->level/2),gsn_chii_bolt,DAM_BASH,TRUE);
	    break;
	default:
	    send_to_char("Nothing happens...\n\r",ch);
	    break;
    }
    check_improve(ch,gsn_chii_bolt,TRUE,1);
    affect_strip(ch,gsn_chii_bolt);    

}

void do_store_chii(CHAR_DATA *ch, char *argument)
{
    AFFECT_DATA af, *paf;
    int chance, level = 0;
    if ( (chance = get_skill(ch,gsn_chii_bolt)) == 0)
    {
        send_to_char("You don't know how to store chii.\n\r",ch);
        return;
    }
    if (!is_empowered(ch,0))
        return;
    if (!is_affected(ch,gsn_chii))
    {
	send_to_char("You are not circulating your chii.\n\r",ch);
	return;
    }
    for ( paf = ch->affected; paf != NULL; paf = paf->next )
        if (paf->type == gsn_chii_bolt)
	{
            level = paf->modifier;
	    break;
	}
    if (level >= 3)
    {
	send_to_char("You are not able to store anymore chii.\n\r",ch);
	return;
    }
    if (paf != NULL && paf->duration < 2)
    {
	send_to_char("There is not enough duration in your chii.\n\r",ch);
	return;
    }
    affect_strip(ch,gsn_chii);
    if (number_percent() > chance)
    {
	send_to_char("You failed to store your chii.\n\r",ch);
    	check_improve(ch,gsn_chii_bolt,FALSE,1);
	return;
    }
    if (level > 0)
    {
	level++;
	sendf(ch,"You have increased your chii bolt to level %d.\n\r",level);
	act("$n increases $s chii bolt's level.",ch,NULL,NULL,TO_ROOM);
        paf->modifier++;
    }
    else
    {
	act("You create a chii bolt from your chii.",ch,NULL,NULL,TO_CHAR);
	act("$n creates a chii bolt from $s chii.",ch,NULL,NULL,TO_ROOM);
	af.where	= TO_AFFECTS;
    	af.type   = gsn_chii_bolt;
    	af.level  = ch->level;
    	af.duration = ch->level / 4;
    	af.modifier = 1;
    	af.location = 0;
    	af.bitvector = 0;
    	affect_to_char(ch,&af);
    }
    if (level == 2)
	send_to_char("Your chii forms a magical aura about your hands.\n\r",ch);
    check_improve(ch,gsn_chii_bolt,TRUE,1);
    WAIT_STATE2(ch,12);
}

void do_mantis(CHAR_DATA *ch, char *argument)
{
    AFFECT_DATA af;
    int chance;
    if ( (chance = get_skill(ch,gsn_mantis)) == 0)
    {
        send_to_char("You don't know how to do a reversal.\n\r",ch);
        return;
    }
    if (!is_empowered(ch,1))
        return;
    if (is_affected(ch,gsn_mantis))
    {
	send_to_char("You are already waiting for a victim to make its move.\n\r",ch);
	return;
    }
    if (ch->mana < 15)
    {
        send_to_char("You lack the clarity of mind neccessary.\n\r",ch);
	return;
    }
    WAIT_STATE2(ch,skill_table[gsn_mantis].beats);
    if (number_percent() > chance)
    {
    	ch->mana -= 7;
	send_to_char("You were not able to prepare for a counter move.\n\r",ch);
        act("$n's moves oddly for a while, then returns back to normal.",ch,NULL,NULL,TO_ROOM);
    	check_improve(ch,gsn_mantis,FALSE,2);
	return;
    }
    ch->mana -= 15;
    act("You prepare for a counter move like a preying mantis waits for its prey.",ch,NULL,NULL,TO_CHAR);
    act("$n prepares to counter a move.",ch,NULL,NULL,TO_ROOM);
    af.where	= TO_AFFECTS;
    af.type   = gsn_mantis;
    af.level  = ch->level;
    af.duration = ch->level/3;
    af.modifier = 0;
    af.location = 0;
    af.bitvector = 0;
    affect_to_char(ch,&af);
    check_improve(ch,gsn_mantis,TRUE,1);
    WAIT_STATE2(ch,12);
}

void entomb( CHAR_DATA* ch, CHAR_DATA* victim ){
  AFFECT_DATA af;

  if (is_affected(victim,gsn_entomb))
    return;

  if (!IS_NPC(victim) || !IS_UNDEAD(victim) || victim->master != ch)
    return;

  if (ch->mana < 50)
    return;

  ch->mana -= 50;

  act("You order $N to enter $S tomb.",ch,NULL,victim,TO_CHAR);
  act("$n orders $N to enter $S tomb.",ch,NULL,victim,TO_ROOM);
  do_sleep(victim,"");

  af.where		= TO_AFFECTS;
  af.type             = gsn_entomb;
  af.level            = ch->level;
  af.duration         = -1;
  af.location         = 0;
  af.modifier         = 0;
  af.bitvector        = AFF_SLEEP;
  affect_to_char(victim,&af);
}

void do_entomb(CHAR_DATA *ch, char *argument)
{
    CHAR_DATA *victim = NULL;
    int chance;
    bool fAll = FALSE;

    if ( (chance = get_skill(ch,gsn_entomb)) == 0)
    {
        send_to_char("You don't know how to entomb.\n\r",ch);
        return;
    }
    if (!str_cmp(argument, "all")){
      fAll = TRUE;
    }
    else{
      if ((victim = get_char_room(ch, NULL, argument)) == NULL){
	send_to_char("They aren't here.\n\r",ch);
	return;
      }
      if (is_affected(victim,gsn_entomb)){
	send_to_char("They are already entombed.\n\r",ch);
	return;
      }
      if (!IS_NPC(victim) || !IS_UNDEAD(victim) || victim->master != ch){
	send_to_char("You cannot entomb that.\n\r",ch);
	return;
      }
    }

    if (ch->mana < 50){
      send_to_char("You don't have enough energy to entomb your minions.\n\r",ch);
      return;
    }
    ch-> mana -= 50;
    WAIT_STATE2(ch,skill_table[gsn_entomb].beats );

    if (chance < number_percent())
    {
	send_to_char("You failed to entomb your minions.\n\r",ch);
	act("$n failed to entomb $s minions.",ch,NULL,NULL,TO_ROOM);
        check_improve(ch,gsn_entomb,FALSE,1);	
	return; 
    }

    if (!fAll && victim)
      entomb(ch, victim);
    else{
      CHAR_DATA* vch, *vch_next;

      for (vch = ch->in_room->people; vch; vch = vch_next){
	vch_next = vch->next_in_room;

	entomb(ch, vch);
      }
    }
}

void do_untomb(CHAR_DATA *ch, char *argument)
{
    CHAR_DATA *victim;
    char arg[MIL];
    if ( get_skill(ch,gsn_entomb) == 0)
    {
        send_to_char("You don't know how to untomb.\n\r",ch);
        return;
    }
    if (!str_cmp(argument, "all")){
      CHAR_DATA* vch, *vch_next;
      for (vch = ch->in_room->people; vch; vch = vch_next){
	vch_next = vch->next_in_room;
	if (vch->master == ch && is_affected(vch, gsn_entomb)){
	  affect_strip(vch,gsn_entomb);
	  act("$n rises from $s tomb.",vch,NULL,NULL,TO_ROOM);
	  do_stand(vch,"");
	  WAIT_STATE2(ch,skill_table[gsn_entomb].beats );
	}
      }
    }
    else{
      if ((victim = get_char_room(ch, NULL, arg)) == NULL)
	{
	  send_to_char("They aren't here.\n\r",ch);
	  return;
	}
      if (!IS_NPC(victim) || victim->master != ch)
	{
	  send_to_char("You cannot untomb that.\n\r",ch);
	  return;
	}
      if (!is_affected(victim,gsn_entomb))
	{
	  send_to_char("They are not entombed.\n\r",ch);
	  return;
	}
      WAIT_STATE2(ch,skill_table[gsn_entomb].beats );
      affect_strip(victim,gsn_entomb);
      act("$n rises from $s tomb.",victim,NULL,NULL,TO_ROOM);
      do_stand(victim,"");
    }
}

void do_tiger(CHAR_DATA *ch, char *argument)
{
    AFFECT_DATA af;
    int chance;
    if ((chance = get_skill(ch,gsn_tiger)) == 0)
    {
        send_to_char("You don't don't know to do that stance",ch);
        return;
    }
    if (!is_empowered(ch,0))
        return;
    if( !monk_good(ch, WEAR_LEGS) || !monk_good(ch, WEAR_WIELD) || !monk_good(ch, WEAR_ARMS) || !monk_good(ch, WEAR_BODY))
    {
        send_to_char("Your heavy equipment hinders your movement.\n\r",ch);
        return;
    }
    if (is_affected(ch,gsn_tiger))
    {
        send_to_char("You are already moving like a tiger.\n\r",ch);
        return;
    }
    if (is_affected(ch,gsn_monkey) || is_affected(ch,gsn_crane) || is_affected(ch,gsn_horse)
 	|| is_affected(ch,gsn_drunken) || is_affected(ch,gsn_buddha) || is_affected(ch,gsn_dragon))
    {
	send_to_char("You are already doing another stance.\n\r",ch);
	return;
    }
    if (ch->mana < 30)
    {
        send_to_char("You lack the clarity of mind neccessary.\n\r",ch);
	return;
    }
    WAIT_STATE2(ch,skill_table[gsn_tiger].beats);
    if (number_percent() > chance)
    {
    	ch->mana -= 15;
	send_to_char("You failed to do the stance.\n\r",ch);
        act("$n's moves oddly for a while, then returns back to normal.",ch,NULL,NULL,TO_ROOM);
        check_improve(ch,gsn_tiger,FALSE,2);
	return;
    }
    ch->mana -= 30;
    af.where	= TO_AFFECTS;
    af.type   = gsn_tiger;
    af.level  = ch->level;
    af.duration = 12;
    af.modifier = ch->level;
    af.location = APPLY_AC;
    af.bitvector = 0;
    affect_to_char(ch,&af);    
    af.modifier = ch->level/3;
    af.location = APPLY_DAMROLL;
    affect_to_char(ch,&af);    
    af.modifier = - ch->level/10;
    af.location = APPLY_HITROLL;
    affect_to_char(ch,&af);    
    af.modifier = ch->level/12;
    af.location = APPLY_STR;
    affect_to_char(ch,&af);
    act("You roar with the strength of the tiger!",ch,NULL,NULL,TO_CHAR);    
    act("$n roars with the strength of the tiger!",ch,NULL,NULL,TO_ROOM);    
    check_improve(ch,gsn_tiger,TRUE,1);
}

void do_crane(CHAR_DATA *ch, char *argument)
{
    AFFECT_DATA af;
    int chance;
    if ((chance = get_skill(ch,gsn_crane)) == 0)
    {
        send_to_char("You don't know how to do that stance",ch);
        return;
    }
    if (!is_empowered(ch,0))
        return;
    if (!monk_good(ch, WEAR_ARMS) || !monk_good(ch, WEAR_LEGS) || !monk_good(ch, WEAR_HANDS) || !monk_good(ch, WEAR_FEET))
    {
        send_to_char("Your heavy equipment hinders your movement.\n\r",ch);
        return;
    }
    if (is_affected(ch,gsn_crane))
    {
        send_to_char("You are already moving like a crane.\n\r",ch);
        return;
    }
    if (is_affected(ch,gsn_tiger) || is_affected(ch,gsn_monkey) || is_affected(ch,gsn_horse)
 	|| is_affected(ch,gsn_drunken) || is_affected(ch,gsn_buddha) || is_affected(ch,gsn_dragon))
    {
	send_to_char("You are already doing another stance.\n\r",ch);
	return;
    }
    if (ch->mana < 30)
    {
        send_to_char("You lack the clarity of mind neccessary.\n\r",ch);
	return;
    }
    WAIT_STATE2(ch,skill_table[gsn_crane].beats);
    if (number_percent() > chance)
    {
    	ch->mana -= 15;
	send_to_char("You failed to do the stance.\n\r",ch);
        act("$n's moves oddly for a while, then returns back to normal.",ch,NULL,NULL,TO_ROOM);
        check_improve(ch,gsn_crane,FALSE,2);
	return;
    }
    ch->mana -= 30;
    af.where	= TO_AFFECTS;
    af.type   = gsn_crane;
    af.level  = ch->level;
    af.duration = 12;
    af.modifier = 0 - ch->level/10;
    af.location = APPLY_DAMROLL;
    af.bitvector = 0;
    affect_to_char(ch,&af);  
    af.modifier = 5 + ch->level / 5;
    af.location = APPLY_HITROLL;
    affect_to_char(ch,&af);  
    act("You move with the swiftness and the accuracy of the crane.",ch,NULL,NULL,TO_CHAR);  
    act("$n moves with the swiftness and the accuracy of the crane.",ch,NULL,NULL,TO_ROOM);  
    check_improve(ch,gsn_crane,TRUE,1);
}

void do_drunken(CHAR_DATA *ch, char *argument)
{
    AFFECT_DATA af;
    int chance;
    if ((chance = get_skill(ch,gsn_drunken)) == 0)
    {
        send_to_char("You don't know how to do that stance",ch);
        return;
    }
    if (!is_empowered(ch,1))
        return;
    if (!monk_good(ch, WEAR_ABOUT) || !monk_good(ch, WEAR_WAIST) || !monk_good(ch, WEAR_LEGS) || !monk_good(ch, WEAR_FEET)
 	|| !monk_good(ch, WEAR_ARMS) || !monk_good(ch, WEAR_HANDS) || !monk_good(ch, WEAR_BODY) || !monk_good(ch, WEAR_HEAD))

    {
        send_to_char("Your heavy equipment hinders your movement.\n\r",ch);
        return;
    }
    if (is_affected(ch,gsn_drunken))
    {
        send_to_char("You are already moving like a drunk.\n\r",ch);
        return;
    }
    if (is_affected(ch,gsn_tiger) || is_affected(ch,gsn_crane) || is_affected(ch,gsn_horse)
 	|| is_affected(ch,gsn_monkey) || is_affected(ch,gsn_buddha) || is_affected(ch,gsn_dragon))
    {
	send_to_char("You are already doing another stance.\n\r",ch);
	return;
    }
    if (ch->mana < 30)
    {
        send_to_char("You lack the clarity of mind neccessary.\n\r",ch);
	return;
    }
    WAIT_STATE2(ch,skill_table[gsn_drunken].beats);
    if (number_percent() > chance)
    {
    	ch->mana -= 15;
	send_to_char("You failed to do the stance.\n\r",ch);
        act("$n's moves oddly for a while, then returns back to normal.",ch,NULL,NULL,TO_ROOM);
        check_improve(ch,gsn_drunken,FALSE,2);
	return;
    }
    ch->mana -= 30;
    af.where	= TO_AFFECTS;
    af.type   = gsn_drunken;
    af.level  = ch->level;
    af.duration = 12;
    af.modifier = 0 - ch->level/2;
    af.location = APPLY_AC;
    af.bitvector = 0;
    affect_to_char(ch,&af);
    act("You start staggering around like a drunk.",ch,NULL,NULL,TO_CHAR);
    act("$n starts staggering around like a drunk.",ch,NULL,NULL,TO_ROOM);
    check_improve(ch,gsn_drunken,TRUE,1);
}

void do_dragon(CHAR_DATA *ch, char *argument)
{
    AFFECT_DATA af;
    int chance;
    if ((chance = get_skill(ch,gsn_dragon)) == 0)
    {
        send_to_char("You don't know how to do that stance",ch);
        return;
    }
    if (!is_empowered(ch,0))
        return;
    if (!monk_good(ch, WEAR_ABOUT) || !monk_good(ch, WEAR_WAIST) || !monk_good(ch, WEAR_LEGS) || !monk_good(ch, WEAR_FEET)
 	|| !monk_good(ch, WEAR_ARMS) || !monk_good(ch, WEAR_HANDS) || !monk_good(ch, WEAR_BODY) || !monk_good(ch, WEAR_HEAD))

    {
        send_to_char("Your heavy equipment hinders your movement.\n\r",ch);
        return;
    }
    if (is_affected(ch,gsn_dragon))
    {
        send_to_char("You already possess the spirit of the dragon.\n\r",ch);
        return;
    }
    if (is_affected(ch,gsn_tiger) || is_affected(ch,gsn_crane) || is_affected(ch,gsn_horse)
 	|| is_affected(ch,gsn_drunken) || is_affected(ch,gsn_monkey) || is_affected(ch,gsn_buddha))
    {
	send_to_char("You are already doing another stance.\n\r",ch);
	return;
    }
    if (ch->mana < 30)
    {
        send_to_char("You lack the clarity of mind neccessary.\n\r",ch);
	return;
    }
    WAIT_STATE2(ch,skill_table[gsn_dragon].beats);
    if (number_percent() > chance)
    {
    	ch->mana -= 15;
	send_to_char("You failed to do the stance.\n\r",ch);
        act("$n's moves oddly for a while, then returns back to normal.",ch,NULL,NULL,TO_ROOM);
        check_improve(ch,gsn_dragon,FALSE,2);
	return;
    }
    ch->mana -= 30;
    af.where	= TO_AFFECTS;
    af.type   = gsn_dragon;
    af.level  = ch->level;
    af.duration = 12;
    af.modifier = ch->level * 2;
    af.location = APPLY_HIT;
    af.bitvector = 0;
    affect_to_char(ch,&af);
    //apply hp
    ch->hit += ch->level * 2;
    af.modifier = 1;
    af.location = APPLY_SIZE;
    affect_to_char(ch,&af);
    act("Your body enlarges as you possess the spirit of the dragon.",ch,NULL,NULL,TO_CHAR);
    act("$n's body starts to enlarge into the image of a dragon.",ch,NULL,NULL,TO_ROOM);
    check_improve(ch,gsn_dragon,TRUE,1);
}

void do_buddha(CHAR_DATA *ch, char *argument)
{
    AFFECT_DATA af;
    int chance;
    if ((chance = get_skill(ch,gsn_buddha)) == 0)
    {
        send_to_char("You don't know how to do that stance",ch);
        return;
    }
    if (!is_empowered(ch,1))
        return;
    if (!monk_good(ch, WEAR_HEAD))
    {
        send_to_char("Your heavy equipment hinders your movement.\n\r",ch);
        return;
    }
    if (is_affected(ch,gsn_buddha))
    {
      send_to_char("You already possess the peace and tranquility of a buddha.\n\r",ch);
        return;
    }
    if (is_affected(ch,gsn_tiger) || is_affected(ch,gsn_crane) || is_affected(ch,gsn_horse)
 	|| is_affected(ch,gsn_drunken) || is_affected(ch,gsn_monkey) || is_affected(ch,gsn_dragon))
    {
	send_to_char("You are already doing another stance.\n\r",ch);
	return;
    }
    if (ch->mana < 30)
    {
        send_to_char("You lack the clarity of mind neccessary.\n\r",ch);
	return;
    }
    WAIT_STATE2(ch,skill_table[gsn_buddha].beats);
    if (number_percent() > chance)
    {
    	ch->mana -= 15;
	send_to_char("You failed to do the stance.\n\r",ch);
        act("$n's moves oddly for a while, then returns back to normal.",ch,NULL,NULL,TO_ROOM);
        check_improve(ch,gsn_buddha,FALSE,2);
	return;
    }
    ch->mana -= 30;
    af.where	= TO_RESIST;
    af.type   = gsn_buddha;
    af.level  = ch->level;
    af.duration = 12;
    af.modifier = 0 - ch->level/2;
    af.location = APPLY_SAVING_SPELL;
    af.bitvector = RES_MAGIC;
    affect_to_char(ch,&af);
    act("You are in full control of your mind.",ch,NULL,NULL,TO_CHAR);
    act("$n takes full control of $s mind.",ch,NULL,NULL,TO_ROOM);
    check_improve(ch,gsn_buddha,TRUE,1);
}

void do_double_grip(CHAR_DATA *ch, char *argument)
{
    int chance;
    OBJ_DATA *wield = NULL;
    AFFECT_DATA af;
    bool towear = FALSE;
    char arg[MIL];
    one_argument(argument,arg);
    if ((chance = get_skill(ch,gsn_double_grip)) == 0)
    {
        send_to_char("You are not skilled enough to double grip",ch);
        return;
    }
    if ( arg[0] != '\0' )
    {
	if ((wield = get_obj_carry( ch, arg, ch )) == NULL)
	{
	    send_to_char("You can't find it.\n\r",ch);
	    return;
	}
    	if (wield->item_type != ITEM_WEAPON)
    	{
	    send_to_char("You can't use that as a weapon!\n\r",ch);
	    return;
    	}
	towear = TRUE;
    }
    if (is_affected(ch,gsn_double_grip))
    {
        send_to_char("You already have both your hands tightly around your weapon.\n\r",ch);
        return;
    }
    if (get_eq_char(ch,WEAR_SHIELD) != NULL || get_eq_char(ch,WEAR_HOLD) != NULL
	|| get_eq_char(ch,WEAR_SECONDARY) != NULL)
    {
        send_to_char("Your hands are tied up!\n\r",ch);
        return;
    }
    af.where	= TO_AFFECTS;
    af.type   = gsn_double_grip;
    af.level  = ch->level;
    af.duration = 12;
    af.modifier = 0;
    af.location = 0;
    af.bitvector = 0;
    affect_to_char(ch,&af);
    if (towear && wield != NULL)
	wear_obj(ch,wield,TRUE,TRUE);
    wield = get_eq_char(ch,WEAR_WIELD);
    if ( wield == NULL )
    {
        send_to_char( "You can't do that.\n\r", ch );
	affect_strip(ch,gsn_double_grip);
        return;
    }
    if (!IS_WEAPON_STAT(wield,WEAPON_TWO_HANDS) && wield->value[0] != WEAPON_SWORD && wield->value[0] != WEAPON_STAFF
	&& wield->value[0] != WEAPON_POLEARM && wield->value[0] != WEAPON_AXE && wield->value[0] != WEAPON_SPEAR && wield->value[0] != WEAPON_MACE)
    {
	send_to_char("You cannot double grip that weapon.\n\r",ch);
	if (towear)
	    unequip_char(ch,wield);
	affect_strip(ch,gsn_double_grip);
	return;
    }
    act("You tighten your grip around $p.",ch,wield,NULL,TO_CHAR);
    act("$n tightens $s grip around $p.",ch,wield,NULL,TO_ROOM);
}

void do_cone(CHAR_DATA *ch, char *argument)
{
    CHAR_DATA *vch, *vch_next;
    AFFECT_DATA af, *paf;
    char buf[MSL];
    int skill = get_skill( ch, gsn_cone );
    const int cost = skill_table[gsn_cone].min_mana;

    if (skill < 2){
      send_to_char("Huh?\n\r", ch);
      return;
    }
    else
      skill = 4 * skill / 5;

    if (ch->level < 15){
      send_to_char("Your mind is not powerfull enough yet.\n\r", ch);
      return;
    }
    if ( (paf = affect_find(ch->affected,gsn_cone)) != NULL && paf->modifier >= (ch->level / 10) - 1)
      {
	send_to_char("You are not ready to use this ability again.\n\r",ch);
	return;
      }
    if (ch->mana < cost)
      {
	send_to_char("You don't have enough mana.\n\r",ch);
	return;
      }
    ch->mana -= cost;
    WAIT_STATE2(ch, skill_table[gsn_cone].beats);
    if (number_percent() < skill){
      send_to_char("You failed.\n\r", ch);
      return;
    }

    if (paf)
      paf->modifier ++;
    else{
      af.where	= TO_AFFECTS;
      af.type   = gsn_cone;
      af.level  = ch->level;
      af.duration = 24;
      af.location = APPLY_NONE;
      af.modifier = 1;
      af.bitvector = 0;
      affect_to_char(ch,&af);
    }
    act("You send a surge of mental energy through the room.",ch,NULL,NULL,TO_CHAR);
    act("A wave of mental energy surges through the room.",ch,NULL,NULL,TO_ROOM);
    for (vch = ch->in_room->people; vch != NULL; vch = vch_next)
    {
        vch_next = vch->next_in_room;
	if ( vch != ch && !is_area_safe(ch, vch) )
	{
            if ( ch->fighting != vch && vch->fighting != ch)
            {
	      a_yell(ch, vch);
	      //predict interdict
	      if (predictCheck(ch, vch, "coneofforce", skill_table[gsn_cone].name))
		continue;
               
                sprintf(buf, "Help! %s is blasting my brains!",PERS(ch,vch));
                j_yell(vch,buf);
		damage(ch,vch,number_range(ch->level,ch->level*2),gsn_cone,DAM_MENTAL,TRUE);
		if (!saves_spell(ch->level + 5,vch,DAM_MENTAL,SPELL_MENTAL)){
		  act("You are paralized by $n's cone of mental force!", ch, NULL, vch, TO_VICT);
		  act("$N is paralized by your cone of mental force!", ch, NULL, vch, TO_CHAR);
		  act("$N is paralized by $n's cone of mental force!", ch, NULL, vch, TO_NOTVICT);
		  WAIT_STATE2(vch,36);
		}
		else{
		  act("$N is resist your cone of mental force!", ch, NULL, vch, TO_CHAR);
		  WAIT_STATE2(vch,12);
		}
	    }
	}
    }
}		    

void do_unburrow(CHAR_DATA *ch, char *argument)
{
  //EFFECT data for unburrow.
  AFFECT_DATA* af;

    if (IS_NPC(ch))
	return;
    if (!is_affected(ch,gsn_burrow))
    {
	send_to_char("You are not burrowed underground!\n\r",ch);
	return;
    }
    WAIT_STATE2(ch,12);
    //quick check as we get the effect.
    if ( (af = affect_find(ch->affected, gsn_burrow)) == NULL)
      return;

//orgin room vnum is store in modifier.
    char_from_room(ch);
    char_to_room(ch, get_room_index(af->modifier));

    send_to_char("You seep backup to the surface.\n\r",ch);
    act("A cloud of mist begins to seep out of underground suddenly.", ch, NULL, NULL, TO_ROOM);

//and we strip
    affect_strip(ch,gsn_burrow);
    REMOVE_BIT(ch->comm,COMM_QUIET);
//and we revert so they dont keep mist form.
    affect_strip(ch, gsn_mist_form);
    free_string( ch->short_descr );
    ch->short_descr = str_dup ( "" );
    ch->dam_type = 17;
}

void do_burrow(CHAR_DATA *ch, char *argument)
{
    AFFECT_DATA af;
    if (ch->in_room == NULL)
	return;
    if (IS_NPC(ch))
    {
	send_to_char("Mobs can't burrow!\n\r",ch);
	return;
    }

    if (ch->class != class_lookup("vampire"))
    {
	send_to_char("You dig in the ground with a stick a little and feel silly.\n\r",ch);
        act("$n digs in a ground with a small stick.  Doesn't $e just look silly?", ch, NULL, NULL, TO_ROOM);
	return;
    }

    if (is_affected(ch, gsn_covenant))
      {
	send_to_char("You have not been blessed by Covenant to sleep!\n\r", ch);
	  return;
      }

    //vamps can only do this atday
    if (mud_data.time_info.hour < 6 || mud_data.time_info.hour > 18)
    {
	send_to_char("Vampires do not rest at night!\n\r",ch);
	return;
    }

    if( (is_affected(ch, gsn_bat_form)) || (is_affected(ch, gsn_wolf_form)) )
   {
     send_to_char("Not in your current form!\n\r", ch);
     return;
   }

    if (ch->pcdata->pStallion != NULL)
    {
      sendf(ch, "You can't burrow while on %s.\n\r",ch->pcdata->pStallion->short_descr);
      return;
    }

    if ( IS_AFFECTED(ch, AFF_FAERIE_FOG) || IS_AFFECTED(ch, AFF_FAERIE_FIRE))
    {
        send_to_char( "The glowing aura seem to interfere with the process.\n\r", ch);
        return;
    }
    if (ch->in_room->sector_type == SECT_AIR)
    {
        send_to_char("You can't burrow in the air!\n\r",ch);
        return;
    }
    if (ch->in_room->sector_type == SECT_WATER_SWIM || ch->in_room->sector_type == SECT_WATER_NOSWIM)
    {
        send_to_char("You can't burrow in the water!\n\r",ch);
        return;
    }
    if (ch->in_room->sector_type == SECT_CITY
	|| IS_SET(ch->in_room->room_flags2, ROOM_JAILCELL))
    {
        send_to_char("The ground is too hard for even your mist form to seep into.\n\r",ch);
        return;
    }
    /* Only if not attacked recently */
    if (is_fight_delay(ch, 30)){
      act("With the air of violence still about you, your concentration fails.", ch, NULL, NULL, TO_CHAR);
      return;
    }
    if (is_affected(ch,gsn_burrow))
    {
	send_to_char("You have already burrowed underground!\n\r",ch);
	return;
    }
    if (ch->mana < skill_table[gsn_burrow].min_mana)
    {
        send_to_char("You don't have enough mana.\n\r",ch);
        return;
    }

    affect_strip(ch, gen_conceal);
    WAIT_STATE2(ch, skill_table[gsn_burrow].beats);
    ch->mana -= skill_table[gsn_burrow].min_mana;
    if (number_percent() > ch->level*2)
    {
if (is_affected(ch, gsn_mist_form))
{
	send_to_char("You can't seem to find a suitable place underground.\n\r",ch);
        act("$n swirls and billows near the ground.", ch, NULL, NULL, TO_ROOM);
        return;
}//end if mist form
else
{
	send_to_char("You take on the mist form but can't seem to find a suitable place underground.\n\r",ch);
        act("$n form grows transparent as $e turns into a cloud of mist.  Moments later $e takes human form once again.", ch, NULL, NULL, TO_ROOM);
	return;
}//end regular.
}//end failed burrowed.


if (is_affected(ch, gsn_mist_form))
{
    send_to_char("You seep into an underground pocket..\n\r",ch);
    act("$n hovers near the ground billowing in the breeze and then it's gone.",ch,NULL,NULL,TO_ROOM);
}//end if mist
else
{
    send_to_char("You take on mist form and seep into an underground pocket..\n\r",ch);
    act("$n evaporates into a fine cloud of mist.",ch,NULL,NULL,TO_ROOM);
    //we turn into a mist
    //this is hardcoded as we dont want the vamp faling mist.  if he passed the check for burrow then that is good enough.
    	af.where     = TO_AFFECTS;
    	af.type      = gsn_mist_form;
    	af.level     = ch->level;
    	af.duration  = 11;
    	af.modifier  = 0;  
    	af.location  = APPLY_NONE;
    	af.bitvector = AFF_PASS_DOOR;
    	affect_to_char( ch, &af );
    	af.bitvector = 0;
    	af.location  = APPLY_DAMROLL;
    	af.modifier  = -30;  
    	affect_to_char( ch, &af );
    	af.location  = APPLY_HITROLL;
    	af.modifier  = -30;  
    	affect_to_char( ch, &af );
    	af.location  = APPLY_CON;
    	af.modifier  = -5;  
    	affect_to_char( ch, &af );
    	af.location  = APPLY_DEX;
    	af.modifier  = -5;  
    	affect_to_char( ch, &af );
    	af.location  = APPLY_STR;
    	af.modifier  = -10;  
    	affect_to_char( ch, &af );
	ch->short_descr = str_dup("a cloud of mist");
	check_improve(ch,gsn_mist_form,TRUE,1);
//end of turning into mist.
    act("A cloud of mist hovers near the ground billowing in the breeze and then it's gone.",ch,NULL,NULL,TO_ROOM);
}//end if else.

    af.where	= TO_AFFECTS;
    af.type   = gsn_burrow;
    af.level  = ch->level;
    af.duration = 11;
    af.modifier = ch->in_room->vnum;
    af.location = 0;
    af.bitvector = 0;
    affect_to_char(ch,&af);


    SET_BIT(ch->comm,COMM_QUIET);
    char_from_room(ch);
    char_to_room(ch, get_room_index(ROOM_VNUM_BURROW));
}

void do_dark_ritual(CHAR_DATA *ch, char *argument)
{
    int chance;
    AFFECT_DATA af;
    bool fElder = get_skill(ch, gsn_unholy_gift) > 1;
    const int cost = fElder ? 50 : 100;

    if ((chance = get_skill(ch,gsn_dark_ritual)) == 0)
    {
        send_to_char("You don't know how to perform a dark ritual.\n\r",ch);
        return;
    }
    if (is_affected(ch,gsn_dark_ritual))
    {
	send_to_char("You are not ready to perform another dark ritual.\n\r",ch);
	return;
    }
    if (ch->mana < cost)
    {
	send_to_char("You don't have enough mana.\n\r",ch);
	return;
    }
    WAIT_STATE2( ch, skill_table[gsn_dark_ritual].beats );
    if (number_percent() > chance)
    {
	send_to_char("You failed to perform a dark ritual.\n\r",ch);
	check_improve(ch,gsn_dark_ritual,FALSE,2);
	ch->mana -= cost / 2;
	return;
    }
    act("You perform an ancient ritual to the Covenant of Blood.",ch,NULL,NULL,TO_CHAR);
    act("$n performs an ancient ritual to the Covenant of Blood.",ch,NULL,NULL,TO_ROOM);
    ch->mana -= cost;
    af.where	= TO_AFFECTS;
    af.type   = gsn_dark_ritual;
    af.level  = ch->level;
    af.duration = fElder ? 18 : 30;
    af.modifier = 0;
    af.location = 0;
    af.bitvector = 0;
    affect_to_char(ch,&af);
    af.type   = gsn_covenant;
    af.duration = 12;
    affect_to_char(ch,&af);
    send_to_char("The Covenant of Blood has given you their dark blessings.\n\r",ch);
    check_improve(ch,gsn_dark_ritual,TRUE,1);
}

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

  /*
Insect Swarm:
- Ranger summons and directs a swarm of insects upon a single target.
- The target is hit, and keeps getting hit each tick afterwards.
- THe swarm has a chance to do any of:poison or plauge or drain.
- All the effects are done through gen_insect_swarm
the skill only sets the effect.
  */

  char arg[MIL];
  char buf[MIL];
  CHAR_DATA* victim;

  AFFECT_DATA af;
  AFFECT_DATA* paf;  
//const
  const int skill_med = 75;
  const int skill_mod = 2;
  const int base_chance = 40;
  const int duration_gsn = number_fuzzy (56 - ch->level);
  const int min_mana = skill_table[gsn_insect_swarm].min_mana;
  
//data
  int chance = base_chance;
  int skill = 0;
  int duration_gen = 0;

 
//flags
  bool fAutoFail = FALSE;

//EZ
  if (ch == NULL)
    return;

//skill check
  if ((skill = get_skill(ch,gsn_insect_swarm)) == 0)
    {
      send_to_char("You don't know how to summon insects.\n\r",ch);
      return;
    }
  
//arg check
  argument = one_argument(argument,arg);
  if (arg[0] == '\0')
    {
      send_to_char("Whom would you like to plauge with the swarm?\n\r", ch);
      return;
    }

//check if we can see target
    if ((victim = get_char_room(ch, NULL, arg)) == NULL)
      {
        send_to_char("They aren't here.\n\r",ch);
        return;
      }
    
//check self.
    if (victim == ch)
      {
	send_to_char("Why not just sit on an anthill?\n\r", ch);
	return;
      }

//pk check
    if (is_safe(ch,victim))
      return;

//Check min mama
    if (ch->mana < min_mana)
      {
	send_to_char("You lack the strength.\n\r", ch);
	return;
      }
    else
      ch->mana -= min_mana;

//message
    act("$n tosses a small handfull of thick pollen at $N.", ch, NULL, victim, TO_ROOM);
    act("You toss a small handfull of thick pollen at $N.", ch, NULL, victim, TO_CHAR);

    a_yell(ch,victim);
    //predict interdict
    if (predictCheck(ch, victim, "insectswarm", skill_table[gsn_insect_swarm].name))
      return;

    //yell and attack.
    sprintf(buf, "Help! %s just tried to send a swarm after me!", PERS(ch, victim));
    j_yell(victim,buf);

//end we attack.
    damage(ch, victim, 1, gsn_insect_swarm, DAM_PIERCE, TRUE);





//check for auto fails.
    if ( (is_affected(ch, gsn_insect_swarm)) 
	 || (ch->in_room->sector_type == SECT_CITY
	     || ch->in_room->sector_type == SECT_INSIDE
	     || ch->in_room->sector_type == SECT_WATER_SWIM
	     || ch->in_room->sector_type == SECT_WATER_NOSWIM) )
      fAutoFail = TRUE;




    WAIT_STATE2( ch, skill_table[gsn_insect_swarm].beats );

//check for misc. failures.
    if (fAutoFail){
	send_to_char("You attempt to summon the insects but only few bumble bees fly by.\n\r", ch);
	check_improve(ch,gsn_insect_swarm,FALSE,1);
	return;
      }

//get chance of success.
    chance += (skill - skill_med) * skill_mod;

//set waitstate


    
//set effect for another use.
    if (number_percent() > chance)
      {
	send_to_char("You summon a swarm but without adequate skill it disperses quicly.\n\r",ch);
	act("A swarm of insects hovers above $N and then quickly disperses.", ch, NULL, victim, TO_NOTVICT);
	act("A swarm of insects hovers above you and then quickly disperses.", ch, NULL, NULL, TO_NOTVICT);
	check_improve(ch,gsn_insect_swarm,FALSE,2);
	return;
      }
    check_improve(ch,gsn_insect_swarm,TRUE,1);
    

    af.type = gsn_insect_swarm;
    af.where = TO_AFFECTS;
    af.level = ch->level;
    af.duration = duration_gsn;
    af.location = APPLY_NONE;
    af.modifier = 0;
    af.bitvector = 0;
    affect_to_char(ch, &af);

//begin the gen.
    //if already paluged we just extend dur.
    if ( (paf = affect_find(ch->affected, gen_insect_swarm)) == NULL)
      {
	//duration is dependant on skill.
	duration_gen += number_fuzzy((skill - skill_med) / 8);
	af.type = gen_insect_swarm;
	af.where = TO_AFFECTS;
	af.level = ch->level;
	af.duration = UMAX(0, duration_gen);
	af.location = APPLY_NONE;
	af.modifier = 0;
	af.bitvector = 0;
	affect_to_char(victim, &af);
      }
    else
      paf->duration +=1;
//now we apply the name of caster as gen needs it.
    paf = affect_find(victim->affected, gen_insect_swarm);
    string_to_affect(paf, ch->name);

//now that the name is in there we run the  damage part of 
//insect swarm, mainly update_tick
run_effect_update(victim, ch, NULL, gen_insect_swarm, NULL, NULL, TRUE, EFF_UPDATE_TICK);
}//end do_insect swarm

void do_cutpurse(CHAR_DATA *ch, char *argument)
{
    char arg[MIL];
    int chance;
    AFFECT_DATA af;
    CHAR_DATA *victim;
    argument = one_argument(argument,arg);
    if ((chance = 3*get_skill(ch,gsn_cutpurse)/4) == 0)
    {
        send_to_char("Cutpurse? What's what?\n\r",ch);
        return;
    }
    if (arg[0] == '\0')
    {
        victim = ch->fighting;
        if (victim == NULL)
        {
            send_to_char("But you aren't fighting anyone!\n\r",ch);
            return;
        }
    }
    else if ((victim = get_char_room(ch, NULL, arg)) == NULL)
    {
        send_to_char("They aren't here.\n\r",ch);
        return;
    }
    if (is_safe(ch,victim))
        return;
    if (is_affected(victim,gen_gold_loss))
    {
	act("$S purse is already slashed.",ch,NULL,victim,TO_CHAR);
	return;
    }
    if ( IS_AFFECTED(ch, AFF_CHARM) && ch->master == victim )
    {
        sendf(ch, "%s is your beloved master.\n\r", PERS(victim,ch) );
        return;
    }
/* THEFT CRIME CHECK */
    if (ch->in_room && is_crime(victim->in_room, CRIME_THEFT, victim)){
      set_crime(ch, victim, ch->in_room->area, CRIME_THEFT);
    }
    WAIT_STATE2( ch, skill_table[gsn_cutpurse].beats );

    a_yell(ch,victim);
    //predict interdict
    if (predictCheck(ch, victim, "cutpurse", skill_table[gsn_cutpurse].name))
      return;

    if (IS_AWAKE(victim)){
      damage(ch,victim,1,gsn_cutpurse,DAM_SLASH,TRUE);
      
      if ( ch->fighting != victim && victim->fighting != ch){
	char buf[MIL];
	
	sprintf(buf, "Help! %s just cut my purse apart!",PERS(ch,victim));
	j_yell(victim,buf);
      }

      if (!can_see(victim,ch))
	chance += 20;

      if (number_percent() > chance)
	{
	  act("You failed to slash $S purse.",ch,NULL,victim,TO_CHAR);
	  check_improve(ch,gsn_cutpurse,FALSE,2);
	  return;
	}
    }
    act("You slash a hole in $N's purse!",ch,NULL,victim,TO_CHAR);
    af.where	= TO_NONE;
    af.type   = gen_gold_loss;
    af.level  = ch->level;
    af.duration = 6;
    af.modifier = 0;
    af.location = 0;
    af.bitvector = 0;
    affect_to_char(victim,&af);
    check_improve(ch,gsn_cutpurse,TRUE,1);
}

void power_tiger( CHAR_DATA* ch, bool fSuccess ){
  CHAR_DATA* victim;

  if ( (victim = ch->fighting) == NULL){
    send_to_char("But you're not fighting!\n\r", ch);
    return;
  }

  one_hit(ch, victim, attack_lookup("charge") + TYPE_NOBLOCKHIT, FALSE);  
  if (!fSuccess || ch->fighting == NULL || ch->fighting != victim)
    return;

  one_hit(ch, victim, attack_lookup("bite") + TYPE_HIT, FALSE);  
  if (ch->fighting == NULL || ch->fighting != victim)
    return;

  one_hit(ch, victim, attack_lookup("claw") + TYPE_HIT, FALSE);  
}

void power_wolf(CHAR_DATA* ch, bool fSuccess ){
  const int mag_att = attack_lookup("tainted");
  const int nor_att = attack_lookup("bite");

  if (ch->dam_type == mag_att){
    send_to_char("You retract your claws.\n\r", ch);
    act("With a soft hiss $n retracts $s claws.", ch, NULL, NULL, TO_ROOM);
    ch->dam_type = nor_att;
    affect_strip(ch, gsn_werepower );
  }
  else{
    AFFECT_DATA* paf, af;

    paf = affect_find(ch->affected, gsn_werewolf );

    af.type = gsn_werepower;
    af.level = ch->level;
    af.duration = paf ? paf->duration : 0;
    af.where = TO_AFFECTS;
    af.bitvector = 0;
    af.location = APPLY_HITROLL;
    af.modifier = ch->level / 10;
    affect_to_char( ch, &af);
    af.location = APPLY_DAMROLL;
    affect_to_char( ch, &af);
    send_to_char("You extend your claws.\n\r", ch);
    act("With a soft hiss $n extends $s claws.", ch, NULL, NULL, TO_ROOM);
    ch->dam_type = mag_att;
  }
}


void power_bear( CHAR_DATA* ch, bool fSuccess ){
  CHAR_DATA* victim;
  int dam = number_range(3 * ch->level / 2, 5 * ch->level / 2);

  if ( (victim = ch->fighting) == NULL){
    send_to_char("But you're not fighting!\n\r", ch);
    return;
  }
  damage(ch, victim, dam, gsn_werebear, DAM_BASH, TRUE );
  if (ch->fighting == NULL || ch->fighting != victim)
    return;
  if (number_percent() < ch->level / 2)
    wound_effect(ch, victim, ch->level, dam );

}

void power_falcon( CHAR_DATA* ch, bool fSuccess, char* argument ){
  EXIT_DATA* pe;

  if (ch->fighting){
    send_to_char( "No way!  You are still fighting!\n\r", ch);
    return;
  }
  else if (ch->in_room->sector_type == SECT_INSIDE || IS_SET(ch->in_room->room_flags, ROOM_INDOORS)){
    if (ch->move < 15){
      send_to_char("You could not find a way out into the sky.\n\r", ch);
      return;
    }
    else{
      send_to_char("You fly around for a while before spotting a passage up into the sky.\n\r", ch);
      ch->move -= 25;
    }
  }
  send_to_char("You soar up into the sky!\n\r", ch);
  act("$n soars high up into the sky!", ch, NULL, NULL, TO_ROOM);

  sendf(ch, "\n\r%s\n\r", ch->in_room->area->name );
  where(ch, ch->in_room->area, argument );

  if (!fSuccess){
    send_to_char("You failed to get enough alttitude.\n\r", ch);
    return;
  }

  for (pe = ch->in_room->area->exits; pe; pe = pe->next_in_area ){
    if (pe->to_room == NULL || pe->to_room->area == NULL)
      continue;
    else if (IS_AREA(pe->to_room->area, AREA_MARKED))
      continue;
    else if (pe->to_room->area->nplayer < 1)
      continue;
    SET_BIT(pe->to_room->area->area_flags, AREA_MARKED);

    sendf(ch, "\n\r%s\n\r", pe->to_room->area->name );
    where(ch, pe->to_room->area, argument );
  }

  for (pe = ch->in_room->area->exits; pe; pe = pe->next_in_area ){
    if (pe->to_room == NULL || pe->to_room->area == NULL)
      continue;
    REMOVE_BIT(pe->to_room->area->area_flags, AREA_MARKED);
  }
}



void do_werepower(CHAR_DATA *ch, char *argument){
  AFFECT_DATA* paf;
  const int sn = skill_lookup("werepower");
  int cost;
  int lag;
  const int skill = get_skill(ch, sn);
  int chance;

  bool fSuccess = FALSE;

  if (skill < 2){
    send_to_char("Huh?\n\r", ch);
    return;
  }
  for (paf = ch->affected; paf; paf = paf->next){
    if (paf->type == gsn_weretiger
	|| paf->type == gsn_werewolf
	|| paf->type == gsn_werebear
	|| paf->type == gsn_werefalcon){
      break;
    }
  }

  if (paf == NULL){
    send_to_char("You are not in your beastly form!\n\r", ch);
    return;
  }
  cost = skill_table[paf->type].min_mana;
  lag = skill_table[paf->type].beats;

  if (ch->mana < cost){
    send_to_char("You don't have enough mana.\n\r",ch);
    return;
  }
  else
    ch->mana -= cost;

  WAIT_STATE2(ch, lag );

  chance = 4 * skill / 5;
  chance += (get_curr_stat(ch, STAT_LUCK) - 12) * 2;

  if (number_percent() < chance){
    check_improve(ch, sn, TRUE, 1);
    fSuccess = TRUE;
  }else{
    check_improve(ch, sn, FALSE, 1);
    fSuccess = FALSE;
  }

  if (paf->type == gsn_weretiger)	power_tiger( ch, fSuccess );
  else if (paf->type == gsn_werewolf)	power_wolf( ch, fSuccess );
  else if (paf->type == gsn_werebear)	power_bear( ch, fSuccess );
  else if (paf->type == gsn_werefalcon)	power_falcon( ch, fSuccess, argument );
  else
    send_to_char("No such werebeast.\n\r", ch);
}

void do_transform(CHAR_DATA *ch, char *argument){
  const int sn = gsn_transform;
  int cost = skill_table[sn].min_mana;
  int lag = skill_table[sn].beats;
  const int skill = get_skill(ch, sn);

  int chance;

  if (skill < 2){
    send_to_char("Huh?\n\r", ch);
    return;
  }
  else if (IS_NPC(ch)){
    send_to_char("Mobs can't transform.\n\r",ch);
    return;
  }
  else if (is_affected(ch,gsn_transform)){
    send_to_char("You are not ready to use this ability again.\n\r",ch);
    return;
  }
  if (ch->fighting){
    cost /= 2;
    lag /= 2;
  }
  if (ch->mana < cost){
    send_to_char("You don't have enough mana.\n\r",ch);
    return;
  }
  else
    ch->mana -= cost;

  WAIT_STATE2(ch, lag );

  if (ch->fighting)
    chance = 4 * skill / 5;
  else
    chance = skill / 2;

  chance += 30 - (30 * ch->hit / ch->max_hit);
  chance += (get_curr_stat(ch, STAT_LUCK) - 14) * 2;

  if (number_percent() > chance ){
    send_to_char("You feel some discomfort but fail to transform.\n\r",ch);
    act("$n looks a little uncomfortable, but nothing happens.",ch,NULL,NULL,TO_ROOM);
    check_improve(ch, sn, FALSE, 1);
    return;
  }

  check_improve(ch, sn, TRUE, 1);
  beast_transform(ch);
}

void tiger_form(CHAR_DATA *ch ){
  AFFECT_DATA af;    

  ch->dam_type = attack_lookup("slice");

  af.type      = gsn_weretiger;
  af.level     = ch->level;
  af.duration  = 72;

  af.where     = TO_AFFECTS;
  af.bitvector = 0;
  af.location  = APPLY_STR;
  af.modifier  = 2;
  affect_to_char( ch, &af );
  
  af.location  = APPLY_HIT;
  af.modifier  = ch->level;
  affect_to_char( ch, &af );

  af.location  = APPLY_HIT_GAIN;
  af.modifier  = 10 + ch->level / 2;
  affect_to_char( ch, &af );
  
  send_to_char("The strength of the tiger fills your veins.\n\r", ch);
}

void wolf_form(CHAR_DATA *ch ){
    AFFECT_DATA af;
    ch->dam_type = attack_lookup("bite");

    af.type      = gsn_werewolf;
    af.level     = ch->level;
    af.duration  = 72;

    af.where     = TO_RESIST;
    af.bitvector = RES_WEAPON;
    af.location  = APPLY_STR;
    af.modifier  = 1;
    affect_to_char( ch, &af );

    af.location  = APPLY_DEX;
    af.modifier  = 1;
    affect_to_char( ch, &af );

    af.location  = APPLY_AC;
    af.modifier  = -ch->level;
    affect_to_char( ch, &af );
    send_to_char("You are now resistant to non-magical damage.\n\r", ch);
}

void bear_form(CHAR_DATA *ch ){
  AFFECT_DATA af;
  ch->dam_type = attack_lookup("claw");
  
  affect_strip(ch, skill_lookup("enlarge"));

  af.type      = gsn_werebear;
  af.level     = ch->level;
  af.duration  = 72;
  
  af.where     = TO_AFFECTS;
  af.bitvector = 0;
  af.location  = APPLY_STR;
  af.modifier  = 3;
  affect_to_char( ch, &af );

  af.where     = TO_AFFECTS;
  af.bitvector = 0;
  af.location  = APPLY_DEX;
  af.modifier  = -2;
  affect_to_char( ch, &af );

  af.location  = APPLY_CON;
  af.modifier  = 2;
  affect_to_char( ch, &af );
  
  af.location  = APPLY_SIZE;
  af.modifier  = 1;
  affect_to_char( ch, &af );

  send_to_char("You nearly double in size as your bones and flesh expands.\n\r", ch);
}

void falcon_form(CHAR_DATA *ch ){
  AFFECT_DATA af;
  ch->dam_type = attack_lookup("peck");
  
  af.type      = gsn_werefalcon;
  af.level     = ch->level;
  af.duration  = 72;
  
  af.where     = TO_AFFECTS;
  af.bitvector = AFF_FLYING;
  af.location  = APPLY_DEX;
  af.modifier  = 3;
  affect_to_char( ch, &af );
  
  af.location  = APPLY_MOVE;
  af.modifier  = ch->level * 3;
  affect_to_char( ch, &af );
  ch->move += af.modifier;
  af.where = TO_SKILL;
  af.location = gsn_dodge;
  af.modifier = ch->level / 5;
  affect_to_char( ch, &af );

  send_to_char("You spread your wings and take to the sky.\n\r", ch);
}

void beast_transform(CHAR_DATA *ch ){
  AFFECT_DATA af;
  int type = IS_NPC(ch) ? ch->level % BEAST_RACE_MAX : ch->pcdata->beast_type;

  send_to_char("You scream out in agonizing pain as your body starts to deform.\n\r",ch);
  act("$n screams out in agonizing pain as $s body starts to deform.",ch,NULL,NULL,TO_ROOM);

  switch(type){
  case (BEAST_RACE_TIGER):
    tiger_form(ch); break;
  case (BEAST_RACE_WOLF):
    wolf_form(ch); break;
  case (BEAST_RACE_BEAR):
    bear_form(ch); break;
  case (BEAST_RACE_FALCON):
    falcon_form(ch); break;
  default:
    send_to_char("You can't transform into anything.\n\r",ch);
    return;
  }

  af.type      = gsn_transform;
  af.level     = ch->level;
  af.duration  = 1;
  af.where     = TO_AFFECTS;
  af.bitvector = 0;
  af.location  = APPLY_NONE;
  af.modifier  = 0;
  affect_to_char( ch, &af );
}

void do_shed(CHAR_DATA *ch, char *argument)
{
    AFFECT_DATA af;
    char buf[MSL];
    CHAR_DATA *skin, *fch;
    if (IS_NPC(ch))
    {
	send_to_char("Mobs can't shed!\n\r",ch);
	return;
    }
    if (ch->race != race_lookup("slith"))
    {
	send_to_char("You can't shed your skin!\n\r",ch);
	return;
    }
    if (ch->fighting == NULL)
    {
	send_to_char("You're not fighting anyone!\n\r",ch);
	return;
    }
    if (is_affected(ch,gsn_shed_skin))
    {
	send_to_char("You are not ready to shed again.\n\r",ch);
	return;
    }
    WAIT_STATE2(ch,8);
    af.where     = TO_AFFECTS;
    af.type      = gsn_shed_skin;
    af.level     = ch->level;
    af.duration  = 60;
    af.location  = 0;
    af.modifier  = 0;
    af.bitvector = 0;
    affect_to_char( ch, &af );
    act("You cast off your old skin in your place.",ch,NULL,NULL,TO_CHAR);

    skin = create_mobile( get_mob_index(MOB_VNUM_SKIN));
    skin->sex = ch->sex;
    skin->max_hit = UMAX(10, ch->max_hit );
    skin->hit = ch->max_hit;
    skin->alignment = ch->alignment;
    sprintf( buf, "a cast off skin of %s", ch->name);
    free_string( skin->short_descr );
    skin->short_descr = str_dup( buf );
    sprintf( buf, "A cast off skin of %s is here.\n\r", ch->name);
    free_string( skin->long_descr );
    skin->long_descr = str_dup( buf );
    char_to_room(skin,ch->in_room);
    skin->fighting = ch->fighting;
    skin->position = POS_FIGHTING;
    ch->fighting = NULL;
    ch->position = POS_STANDING;
    update_pos( ch );
    affect_strip( ch, gsn_phantasmal_griffon );
    affect_strip( ch, gsn_illusionary_spectre );
    affect_strip( ch, gsn_phantom_dragon );
    affect_strip( ch, gsn_throw );
    affect_strip( ch, skill_lookup("faerie fire") );
    affect_strip( ch, skill_lookup("faerie fog") );
    REMOVE_BIT(ch->affected_by, AFF_FAERIE_FIRE );

    set_delay(ch, ch);
    af.where     = TO_AFFECTS;
    af.type      = gsn_timer;
    af.level     = ch->level;
    af.duration  = 3;
    af.location  = 0;
    af.modifier  = 0;
    af.bitvector = 0;
    affect_to_char( skin, &af );
    for (fch = ch->in_room->people; fch != NULL; fch = fch->next)
	if (fch->fighting == ch)
	    fch->fighting = skin;
}	    

void do_swallow(CHAR_DATA *ch, char *argument)
{
  OBJ_DATA *obj;
  char arg[MIL];
  one_argument(argument,arg);
  if (ch->race != race_lookup("slith") || !IS_NEUTRAL(ch))
    {
      send_to_char("You can't swallow that.\n\r",ch);
      return;
    }
  if ( arg[0]=='\0' )
    {
      send_to_char("What do you want to swallow?\n\r",ch);
      return;
    }
    obj = get_obj_list( ch, arg, ch->in_room->contents );
    if ( obj == NULL )
    {
        send_to_char( "You can't find it.\n\r", ch );
        return;
    }
    if ( (obj->item_type != ITEM_CORPSE_NPC && obj->item_type != ITEM_CORPSE_PC )
	 || obj->condition < 2)
    {
      send_to_char("You don't like the taste of that.\n\r",ch);
      return;
    }
    if (!IS_NPC(ch) && ch->pcdata->condition[COND_HUNGER] > 30)
    {
	send_to_char("You are too full to eat more.\n\r",ch);
	return;
    }
    WAIT_STATE2(ch,12);
    act("You unhinge your jaws and swallow $p whole.",ch,obj,NULL,TO_CHAR);
    act("$n unhinges $s jaws and swallow $p whole.",ch,obj,NULL,TO_ROOM);
    free_string(obj->description);
    obj->description = str_dup("A digested corpse lies here.");
    obj->condition = 1;
    gain_condition( ch, COND_HUNGER, obj->level );
}

void do_probe(CHAR_DATA *ch, char *argument)
{
    EXIT_DATA * pexit;
    ROOM_INDEX_DATA * room;
    extern char * const dir_name[];
    char arg[MIL];   
    int dir, skill;
    CHAR_DATA *vch;
    bool danger = FALSE;

    if (IS_NPC(ch))
	return;

    if ( (skill = get_skill(ch, gsn_probe)) < 1){
      send_to_char("Huh?\n\r", ch);
      return;
    }


    argument = one_argument(argument, arg);
    if      (!str_cmp(arg, "n") || !str_cmp(arg, "north")) dir = 0;
    else if (!str_cmp(arg, "e") || !str_cmp(arg, "east"))  dir = 1;
    else if (!str_cmp(arg, "s") || !str_cmp(arg, "south")) dir = 2;
    else if (!str_cmp(arg, "w") || !str_cmp(arg, "west"))  dir = 3;
    else if (!str_cmp(arg, "u") || !str_cmp(arg, "up" ))   dir = 4;
    else if (!str_cmp(arg, "d") || !str_cmp(arg, "down"))  dir = 5;
    else
    {
        send_to_char("Which way do you wish to probe?\n\r",ch);
        return;
    }
    WAIT_STATE2(ch, 6);
    act("$n probes $T.",ch,NULL,dir_name[dir],TO_ROOM);

    if (number_percent() > skill){
      act("You probe $T, but your instincts fail you.",ch,NULL,dir_name[dir],TO_CHAR);
      check_improve( ch, gsn_probe, FALSE, 1);
      return;
    }
    else
      check_improve( ch, gsn_probe, TRUE, 1);

    pexit = ch->in_room->exit[dir];
    if ((pexit == NULL) || (pexit->to_room == NULL) || (IS_SET(pexit->exit_info, EX_CLOSED)))
    {
	send_to_char("You cannot probe in that direction.\n\r",ch);
	return;
    }
    room = pexit->to_room;
    if (room->exit[0] == NULL && room->exit[1] == NULL && room->exit[2] == NULL 
	&& room->exit[3] == NULL && room->exit[4] == NULL && room->exit[5] == NULL)
	danger = TRUE;
    else if (room->pCabal && ch->pCabal && room->pCabal != ch->pCabal)
	danger = TRUE;
    else 
    {
	for (vch = room->people; vch != NULL; vch = vch->next_in_room )
	{
	    if (IS_NPC(vch) && IS_SET(vch->act,ACT_AGGRESSIVE) && vch->level > ch->level - 5)
	    {
		danger = TRUE;
		break;
	    }
	}
    }
    if (danger)
	act("You probe $T, and your instincts warn you of danger!",ch,NULL,dir_name[dir],TO_CHAR);
    else
	act("You probe $T, and your instincts detects nothing dangerous.",ch,NULL,dir_name[dir],TO_CHAR);
}

void do_decoy(CHAR_DATA *ch, char *argument)
{
    int chance;
    CHAR_DATA *decoy;
    char buf[MSL];
    if (IS_NPC(ch))
	return;
    if ((chance = get_skill(ch,gsn_decoy)) == 0)
    {
        send_to_char("You don't know how to set a decoy.\n\r",ch);
        return;
    }
    if (is_affected(ch,gsn_decoy))
    {
        send_to_char("You are not ready to set another decoy.\n\r",ch);
        return;
    }
    if (ch->mana < 30) 
    {
        send_to_char("Rest up first.\n\r",ch);
        return;
    }
    WAIT_STATE2( ch, skill_table[gsn_decoy].beats );
    if (number_percent() < chance)
    {
        AFFECT_DATA af;
	af.where	= TO_AFFECTS;
        af.type   = gsn_decoy;
        af.level  = ch->level;
        af.duration = 12;
        af.modifier = 0;
        af.location = 0;
        af.bitvector = 0;
        affect_to_char(ch,&af);
        ch->mana -= 30;
	act("You set a decoy of yourself.",ch,NULL,NULL,TO_CHAR);
	if (!IS_AFFECTED(ch, AFF_HIDE) && !IS_AFFECTED(ch, AFF_SNEAK)){
	  act("$n sets a decoy of $mself.",ch,NULL,NULL,TO_ROOM);
	}
	decoy = create_mobile( get_mob_index(MOB_VNUM_DECOY) );
	free_string(decoy->name);
        free_string(decoy->short_descr);
        free_string(decoy->long_descr);
	sprintf(buf,"%s", ch->name);
        decoy->name = str_dup(buf);

	sprintf(buf,"%s", ch->name);
        decoy->short_descr = str_dup(buf);

	sprintf(buf,"%s%s is here.\n\r",ch->name,ch->pcdata->title);
	sprintf(buf,"%s%s is here.\n\r",ch->name,ch->pcdata->title);
        decoy->long_descr = str_dup(buf);
        decoy->sex = ch->sex;
	decoy->level = ch->level + 1;
        char_to_room(decoy,ch->in_room);

        af.where = TO_AFFECTS;
        af.type = gsn_decoy;  
        af.level     = ch->level;
        af.duration = -1;
        af.location  = APPLY_NONE;
        af.modifier  = 0;
        af.bitvector = 0;
        affect_to_char(decoy,&af); 

        af.type = gsn_timer;  
        af.level     = ch->level;
        af.duration = ch->level/4;
        affect_to_char(decoy,&af); 
	decoy->summoner = ch;
        check_improve(ch,gsn_decoy,TRUE,1);
    }
    else
    {
        ch->mana -= 15;
        act("You failed to set a decoy.",ch,NULL,NULL,TO_CHAR);
        check_improve(ch,gsn_decoy,FALSE,2);
    }
}

void do_crusade_old( CHAR_DATA *ch, char *argument)
{
    int chance;
    CHAR_DATA *vch;
    AFFECT_DATA af;
    char buf[MSL];
    bool found = FALSE;
    if ((chance = get_skill(ch,gsn_crusade)) == 0)
    {
        send_to_char( "Huh?\n\r", ch );
        return;
    }
    if (is_affected(ch,gsn_blasphemy))
    {
	send_to_char("You have no religion to crusade for.\n\r",ch);
	return;
    }
    if (is_affected(ch,gsn_crusade))
    {
	send_to_char("You are already on a crusade.\n\r",ch);
	return;
    }
    if (ch->mana < 30)
    {
	send_to_char("You better rest up before the crusade.\n\r",ch);
	return;
    }
    if (IS_AFFECTED(ch,AFF_CALM))
    {
        send_to_char("You can't get worked up in your calm state.\n\r",ch);
        return;
    }
    if (ch->leader != NULL)
    {
	send_to_char("But you're not the leader of your group!\n\r",ch);
	return;
    }
    WAIT_STATE2(ch,skill_table[gsn_crusade].beats);
    if (number_percent() > chance)
    {
    	ch->mana -= 15;
	send_to_char("You failed to start on your crusade.\n\r",ch);
	check_improve(ch,gsn_crusade,FALSE,2);
	return;
    }
    ch->mana -= 30;
    sprintf(buf,"Gods of Light, guide us in our holy path!");
    do_yell(ch,buf);
    for (vch = ch->in_room->people; vch != NULL; vch = vch->next)
    {
	if (!is_same_group(vch,ch) || vch == ch || vch->leader != ch)
	    continue;
    	if (IS_AFFECTED(vch,AFF_CALM) || is_affected(vch,gsn_blasphemy) || is_affected(vch,gsn_crusade))
	    continue;
	if (IS_EVIL(vch))
	    continue;
	found = TRUE;
	act("You are filled with the righteousness of purpose.",vch,NULL,NULL,TO_CHAR);
	act("$n is filled with the righteousness of purpose.",vch,NULL,NULL,TO_ROOM);
    	af.where		= TO_AFFECTS;
    	af.type			= gsn_crusade;
    	af.duration		= ch->level/2;
    	af.level		= ch->level;
    	af.bitvector		= 0;
    	af.location		= APPLY_SAVING_SPELL;
    	af.modifier		= 0 - (ch->level/10 - 2);
    	affect_to_char(vch,&af);
    	af.modifier		= 1;
    	af.location		= APPLY_LUCK;
    	affect_to_char(vch,&af);
    }
    if (!found)
    {
	send_to_char("No one is here to join you on your crusade.\n\r",ch);
	return;
    }
    af.where		= TO_AFFECTS;
    af.type		= gsn_crusade;
    af.duration		= ch->level/2;
    af.level		= 0;
    af.modifier		= 0;
    af.location		= 0;
    af.bitvector	= 0;
    affect_to_char(ch,&af);
    check_improve(ch,gsn_crusade,TRUE,1);
}
	
void do_heroism( CHAR_DATA *ch, char *argument)
{
    int chance;
    AFFECT_DATA af;
    CHAR_DATA *fch, *fch_next;

    if ((chance = get_skill(ch,gsn_heroism)) == 0)
    {
        send_to_char( "Huh?\n\r", ch );
        return;
    }
    if (is_affected(ch,gsn_blasphemy))
    {
	send_to_char("You faith is too shaky.\n\r",ch);
	return;
    }
    if (is_affected(ch,gsn_heroism))
    {
	send_to_char("You are already divinely blessed.\n\r",ch);
	return;
    }
    if (IS_AFFECTED(ch,AFF_BERSERK))
    {
	send_to_char("You get a little madder.\n\r",ch);
	return;
    }
    if (ch->mana < 30)
    {
	send_to_char("You don't have enough mana.\n\r",ch);
	return;
    }
    if (IS_AFFECTED(ch,AFF_CALM))
    {
        send_to_char("You can't get worked up in your calm state.\n\r",ch);
        return;
    }
    WAIT_STATE2(ch,skill_table[gsn_heroism].beats);
    if (number_percent() > chance)
    {
    	ch->mana -= 15;
	send_to_char("You fail to receive divine favor.\n\r",ch);
	check_improve(ch,gsn_heroism,FALSE,2);
	return;
    }

    act("You have been divinely empowered!",ch,NULL,NULL,TO_CHAR);
    act("$n has been divinely empowered!",ch,NULL,NULL,TO_ROOM);
    ch->mana -= 30;
    af.where		= TO_AFFECTS;
    af.type		= gsn_heroism;
    af.duration		= 24;
    af.level		= ch->level;
    af.modifier		= number_range(2,5);
    af.location		= APPLY_LUCK;
    af.bitvector	= AFF_BERSERK;
    affect_to_char(ch,&af);
    af.modifier		= ch->level / 8;
    af.location		= APPLY_HITROLL;
    af.bitvector	= 0;
    affect_to_char(ch,&af);
    af.location		= APPLY_DAMROLL;
    affect_to_char(ch,&af);
    af.location		= APPLY_AC;
    af.modifier		= 10 * (ch->level / 12);
    affect_to_char(ch,&af);

    stop_follower(ch);

    /* remove non justice pets */
    if ( ch->master != NULL ){
      stop_follower( ch );
    }
    for ( fch = char_list; fch != NULL; fch = fch_next ){
      fch_next = fch->next;
      if (IS_NPC(fch) 
	  && (fch->pIndexData->vnum == MOB_VNUM_SPECIAL_GUARD 
	      || fch->pIndexData->vnum == MOB_VNUM_HOUND))
	continue;
      if ( fch->master == ch )
	stop_follower( fch );
      if ( fch->leader == ch)
	fch->leader = fch;
    }    
    check_improve(ch,gsn_heroism,TRUE,1);
}

void do_tarot( CHAR_DATA *ch, char *argument)
{
    int chance, number, card = 0;
    AFFECT_DATA af;
    char arg[MIL], arg2[MIL]; 
    CHAR_DATA *victim;
    argument = one_argument(argument,arg);
    argument = one_argument(argument,arg2);

    if (((chance = get_skill(ch,gsn_tarot)) == 0) && (!IS_NPC(ch)))
    {
        send_to_char( "Huh?\n\r", ch );
        return;
    }
    if (arg[0] == '\0')
    {
	send_to_char("Whose fortune do you wish to fortell?\n\r",ch);
	return;
    }
    if (ch->mana < 100)
    {
	send_to_char("Rest up first.\n\r",ch);
	return;
    }
    if ((victim = get_char_room(ch, NULL, arg)) == NULL)
    {
        send_to_char("They aren't here.\n\r",ch);
        return;
    }
    if (IS_NPC(victim))
    {
	send_to_char("Why would you care for the fate of a mob?\n\r",ch);
	return;
    }
    if (!is_same_group(victim,ch) && victim->master != ch && !IS_IMMORTAL(ch) && !IS_NPC(ch))
    {
	send_to_char("They have to be following you.\n\r",ch);
        return;
    }
    if (is_affected(victim,gsn_tarot))
    {
    	if (ch == victim)
	    send_to_char("Your fate is already determined.\n\r",ch);
	else
	    send_to_char("Their fate is already determined.\n\r",ch);
	return;
    }
    ch->mana -= 100;
    if ((number_percent() > chance) && (!IS_NPC(ch)))
    {
	send_to_char("You failed to interpret the tarot cards.\n\r",ch);
    	check_improve(ch,gsn_tarot,FALSE,1);
	return;
    }
    if ((IS_IMMORTAL(ch) && arg2[0] != '\0') || (IS_NPC(ch) && arg2[0] != '\0'))
    {
	if (!is_number(arg2))
	{
	    send_to_char("Must be numeric.\n\r",ch);
	    return;
	}	
	card = atoi(arg2);
	if (card < 1 || card > 22)
	{
	    send_to_char("Pick a number from 1 to 22.\n\r",ch);
	    return;
	}

    }	
    else
    {
    number = number_range(0,1000);
    if (number > 950)
	card = 1;
    else if (number > 900)
	card = 2;
    else if (number > 850)
	card = 3;
    else if (number > 800)
	card = 4;
    else if (number > 750)
	card = 5;
    else if (number > 740)
	card = 6;
    else if (number > 690)
	card = 7;
    else if (number > 630)
	card = 8;
    else if (number > 580)
	card = 9;
    else if (number > 570)
	card = 10;
    else if (number > 500)
	card = 11;
    else if (number > 498)
	card = 12;
    else if (number > 444)
	card = 13;
    else if (number > 442)
	card = 14;
    else if (number > 363)
	card = 15;
    else if (number > 393)
	card = 16;
    else if (number > 213)
	card = 17;
    else if (number > 143)
	card = 18;
    else if (number > 73)
	card = 19;
    else if (number > 3)
	card = 20;
    else if (number > 1)
	card = 21;
    else 
	card = 22;
    }
    if (card == 0)
	return;
    if (ch == victim)
    {
    	act("$n pulls out a tarot card for $mself.",ch,NULL,NULL,TO_ROOM);
    	sendf(ch,"You draw a tarot card it reveals %s.\n\r",tarot_table[card].name);
    }
    else
    {
    	act("$n pulls out a tarot card for $N.",ch,NULL,victim,TO_NOTVICT);
    	sendf(ch,"You draw a tarot card and reveal %s to %s.\n\r",tarot_table[card].name, PERS(victim,ch));
    	sendf(victim,"%s draws a tarot card and reveals %s to you.\n\r",PERS(ch,victim),tarot_table[card].name);
    }
    af.where	= TO_AFFECTS;
    af.type   	= gsn_tarot;
    af.level  	= ch->level;
    af.duration = 24;
    af.bitvector = 0;
    WAIT_STATE2(ch,skill_table[gsn_tarot].beats); 
    switch (card)
    {
	default:
	    send_to_char("That is not a valid card!\n\r",ch);
	    return;
	// [ Fool ] -dex	    
	case (1):
	    af.modifier = - victim->level/10;
            af.location = APPLY_DEX;
    	    affect_to_char(victim,&af);
	    send_to_char("A burden has been placed upon you...\n\r",victim);
	    break;	    
	// [ Magician ] +int
	case (2):
	    af.modifier = victim->level/10;
            af.location = APPLY_INT;
    	    affect_to_char(victim,&af);
	    send_to_char("You shall be gifted with intelligence...\n\r",victim);
	    break;
	// [ High Priestess ] +wis
	case (3):
	    af.modifier = victim->level/10;
            af.location = APPLY_WIS;
    	    affect_to_char(victim,&af);
	    send_to_char("You shall be blessed with wisdom...\n\r",victim);
	    break;
	// [ Empress ] chance to lose gold per tick
	case (4):
	    send_to_char("Keep an eye on your gold...\n\r",victim);
	    break;
	// [ Emperor ] chance to gain gold per tick
	case (5):
	    send_to_char("You shall increase your fortunes...\n\r",victim);
	    break;
	// [ Hierophant ] cannot leave area
	case (6):
	    af.duration = 12;
	    send_to_char("You mobility shall be restricted...\n\r",victim);
	    break;
	// [ Lovers ] +luck
	case (7):
	    af.modifier = victim->level/5;
            af.location = APPLY_LUCK;
    	    affect_to_char(victim,&af);
	    send_to_char("Luck will be by your side...\n\r",victim);
	    break;
	// [ Chariot ] +move
	case (8):
	    af.modifier = victim->level*2;
            af.location = APPLY_MOVE;
    	    affect_to_char(victim,&af);
	    victim->move += victim->level*2;
	    send_to_char("You shall be able to travel to greater distances...\n\r",victim);
	    break;
	// [ Strength ] +str
	case (9):
	    af.modifier = victim->level/10;
            af.location = APPLY_STR;
    	    affect_to_char(victim,&af);
	    send_to_char("Power has been granted to you...\n\r",victim);
	    break;
	// [ Hermit ] can't group
	case (10):
	    send_to_char("Your travels shall be in solitude...\n\r",victim);
	    break;
	// [ Wheel of Fortune ] luck changes rapidly
	case (11):
	    af.duration = 12;
	    send_to_char("Vague is the outcome...",victim);
	    break;
	// [ Justice ] chance same dam dealt will be dealt back 1/1000
	case (12):
	    send_to_char("An eye for an eye...\n\r",victim);
	    break;
	// [ Hanged Man ] -luck
	case (13):
	    af.modifier = - victim->level/5;
            af.location = APPLY_LUCK;
    	    affect_to_char(victim,&af);
	    send_to_char("Luck has abandoned you...\n\r",victim);
	    break;
	// [ Death ] will die eventually 1/500
	case (14):
	    af.duration = 100;
	    send_to_char("The end, is coming...\n\r",victim);
	    break;
	// [ Temperance ] +hp
	case (15):
	    af.modifier = victim->level/2;
            af.location = APPLY_HIT;
    	    affect_to_char(victim,&af);
	    victim->hit += victim->level/2;
	    send_to_char("You shall be blessed with life...\n\r",victim);
	    break;
	// [ Devil ] cursed
	case (16):
	    af.modifier = - victim->level/10;
            af.location = APPLY_HITROLL;
	    af.bitvector = AFF_CURSE;
    	    affect_to_char(victim,&af);
	    send_to_char("The Gods frown upon you...\n\r",victim);
	    break;
	// [ Tower ] +con
	case (17):
	    af.modifier = victim->level/10;
            af.location = APPLY_CON;
    	    affect_to_char(victim,&af);
	    send_to_char("You shall stand tall and face your difficulties...\n\r",victim);
	    break;
	// [ Star ] save vs
	case (18):
	    af.modifier = - victim->level/5;
            af.location = APPLY_SAVING_SPELL;
    	    affect_to_char(victim,&af);
	    send_to_char("The stars twinkles mystically above you...\n\r",victim);
	    break;
	// [ Moon ] +hit - dam
	case (19):
	    af.modifier = - victim->level/10;
            af.location = APPLY_DAMROLL;
    	    affect_to_char(victim,&af);
	    af.modifier = victim->level/10;
            af.location = APPLY_HITROLL;
    	    affect_to_char(victim,&af);
	    send_to_char("The softness of the moon shines down on you...\n\r",victim);
	    break;
	// [ Sun ] -hit + dam
	case (20):
	    af.modifier = victim->level/10;
            af.location = APPLY_DAMROLL;
    	    affect_to_char(victim,&af);
	    af.modifier = - victim->level/10;
            af.location = APPLY_HITROLL;
    	    affect_to_char(victim,&af);
	    send_to_char("The energy of the sun flows within you...\n\r",victim);
	    break;
	// [ Judgement ] escape death once 1/1000
	case (21):
	    send_to_char("A chance will be given, when judgement day arrives...\n\r",victim);
	    break;    
	// [ World ] +luck +hit +dam +hp 1/1000
	case (22):
	    af.modifier = victim->level/15;
            af.location = APPLY_LUCK;
    	    affect_to_char(victim,&af);
	    af.modifier = victim->level/15;
            af.location = APPLY_DAMROLL;
    	    affect_to_char(victim,&af);
	    af.modifier = victim->level/15;
            af.location = APPLY_HITROLL;
    	    affect_to_char(victim,&af);
	    af.modifier = victim->level/3;
            af.location = APPLY_HIT;
    	    affect_to_char(victim,&af);
	    send_to_char("The world is at your feet...",victim);
	    break;
    }
    af.level	= 69;
    af.modifier = card;
    af.location = 0;
    af.bitvector = 0;
    affect_to_char(victim,&af);
    check_improve(ch,gsn_tarot,TRUE,1);
}

void do_leech( CHAR_DATA *ch, char *argument)
{
    int chance = number_percent(), sn = 0, sn2 = 0, level = 0, count = 0;
    AFFECT_DATA af;
    char arg[MIL], buf[MSL]; 
    CHAR_DATA *victim;
    SKILL_DATA nsk;
    struct skill_type tsk;
    bool found = FALSE;
    argument = one_argument(argument,arg);
    if (IS_NPC(ch))
	return;
    if (ch->race != race_lookup("illithid"))
    {
        send_to_char( "Huh?\n\r", ch );
        return;
    }
    if (ch->level < 15)
    {
	send_to_char("You are too inexperienced to leech.\n\r",ch);
	return;
    }
    if (is_affected(ch,gsn_leech))
    {
	send_to_char("You can only leech one spell at a time.\n\r",ch);
	return;
    }
    if (is_affected(ch,gsn_drained))
    {
	send_to_char("You are too drained to leech anymore at the moment.\n\r",ch);
	return;
    }
    if (arg[0] == '\0')
    {
	send_to_char("Whose memory do you want to leech from?\n\r",ch);
	return;
    }
    if (ch->mana < 50)
    {
	send_to_char("Rest up first.\n\r",ch);
	return;
    }
    if ((victim = get_char_room(ch, NULL, arg)) == NULL)
    {
        send_to_char("They aren't here.\n\r",ch);
        return;
    }
    if (victim->race == race_lookup("illithid"))
    {
	send_to_char("You cannot leech from another illithid.\n\r",ch);
	return;
    }
    if (is_affected(victim,gsn_leech))
    {
	send_to_char("You can't leech from that person yet.\n\r",ch);
	return;
    }
    if (IS_NPC(victim))
    {
	send_to_char("You can learn nothing from a mob.\n\r",ch);
	return;
    }
    if (victim->fighting != NULL)
    {
        sendf(ch, "%s won't hold still long enough.\n\r",PERS(victim,ch));
	return;
    }
    if (is_safe(ch,victim))
	return;
    sprintf(buf, "Help, %s is frying my brains!",PERS(ch,victim));
    j_yell(victim,buf);
    act("You wrap your tentacles around $N's head, and emit a light shock.",ch,NULL,victim,TO_CHAR);
    act("$n wraps $s tentacles around your head, and emit a shock of electricity!",ch,NULL,victim,TO_VICT);
    act("$n wraps $s tentacles around $N's head.",ch,NULL,victim,TO_NOTVICT);
    damage(ch,victim,number_range(0,ch->level),gsn_leech,DAM_LIGHTNING,TRU

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

Site Stats

Snippets: 1791
Codebases: 571