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

/* this is for spirit bomb, if we ever need it some where else
   it should probably be moved to new_fun.c  -Goku */
int get_npc_rank( CHAR_DATA *ch )
{

	if (!IS_NPC(ch))
		return get_true_rank(ch);

	if (ch->exp < 5000)
		return 1;
	else if (ch->exp < 100000)
		return 2;
	else if (ch->exp < 1000000)
		return 3;
	else if (ch->exp < 10000000)
		return 4;
	else if (ch->exp < 100000000)
		return 5;
	else if (ch->exp < 1000000000)
		return 6;
	else if (ch->exp < 10000000000ULL)
		return 7;
	else if (ch->exp < 50000000000ULL)
		return 8;
	else if (ch->exp < 100000000000ULL)
		return 9;
	else if (ch->exp < 300000000000ULL)
		return 10;
	else if (ch->exp < 600000000000ULL)
		return 11;
	else if (ch->exp < 1000000000000ULL)
		return 12;
	else if (ch->exp >= 1000000000000ULL)
		return 13;

	return 0;
}

/* For puting people back together */
void reuniteSplitForms(CHAR_DATA *ch)
{
	int count = 0;
	CHAR_DATA *och;
	CHAR_DATA *och_next;
	CHAR_DATA *purgeQue[5];


	for ( och = first_char; och; och = och_next )
	{
		och_next = och->next;

		if (!IS_NPC(och))
			continue;

		if ( xIS_SET(och->affected_by, AFF_SPLIT_FORM) && och->master == ch)
		{
			if (och->in_room != ch->in_room)
			{
				send_to_char("You must be in the same room as your double.", ch);
				return;
			}
			extract_char( och, TRUE );
			xREMOVE_BIT( (ch)->affected_by, AFF_SPLIT_FORM );
			act( AT_SKILL, "You and your double merge back into one being.", ch, NULL, NULL, TO_CHAR );
			act( AT_SKILL, "$n and $s double merge back into one being.", ch, NULL, NULL, TO_NOTVICT );
			return;
		}

		if( (xIS_SET(och->affected_by, AFF_TRI_FORM) || xIS_SET(och->affected_by, AFF_MULTI_FORM))
			&& och->master == ch)
		{
			purgeQue[count] = och;
			count++;
		}
	}

	if ((xIS_SET(ch->affected_by, AFF_TRI_FORM) && count == 3))
	{
		if (purgeQue[0]->in_room != ch->in_room || purgeQue[1]->in_room != ch->in_room
			|| purgeQue[2]->in_room != ch->in_room)
		{
			send_to_char("You must be in the same room as all your doubles.", ch);
			return;
		}
		else
		{
			extract_char( purgeQue[0], TRUE );
			extract_char( purgeQue[1], TRUE );
			extract_char( purgeQue[2], TRUE );
			xREMOVE_BIT( (ch)->affected_by, AFF_TRI_FORM );
			act( AT_SKILL, "You and your doubles merge back into one being.", ch, NULL, NULL, TO_CHAR );
			act( AT_SKILL, "$n and $s doubles merge back into one being.", ch, NULL, NULL, TO_NOTVICT );
			return;
		}
	}

	if (xIS_SET(ch->affected_by, AFF_MULTI_FORM) && count == 5)
	{
		if (purgeQue[0]->in_room != ch->in_room || purgeQue[1]->in_room != ch->in_room
			|| purgeQue[2]->in_room != ch->in_room || purgeQue[3]->in_room != ch->in_room
			|| purgeQue[4]->in_room != ch->in_room)
		{
			send_to_char("You must be in the same room as all your doubles.", ch);
			return;
		}
		else
		{
			extract_char( purgeQue[0], TRUE );
			extract_char( purgeQue[1], TRUE );
			extract_char( purgeQue[2], TRUE );
			extract_char( purgeQue[3], TRUE );
			extract_char( purgeQue[4], TRUE );
			xREMOVE_BIT( (ch)->affected_by, AFF_MULTI_FORM );
			act( AT_SKILL, "You and your doubles merge back into one being.", ch, NULL, NULL, TO_CHAR );
			act( AT_SKILL, "$n and $s doubles merge back into one being.", ch, NULL, NULL, TO_NOTVICT );
			return;
		}
	}

	send_to_char("Something wierd happened?", ch);
	bug("reuniteSplitForms: couldn't clean splits normaly, purging all of %s's forms", ch->name);

	for ( och = first_char; och; och = och_next )
	{
		och_next = och->next;

		if (!IS_NPC(och))
			continue;

		if( (xIS_SET(och->affected_by, AFF_SPLIT_FORM)
			|| xIS_SET(och->affected_by, AFF_TRI_FORM)
			|| xIS_SET(och->affected_by, AFF_MULTI_FORM))
			&& och->master == ch)
		{
			extract_char( och, TRUE );
		}
	}
	xREMOVE_BIT( (ch)->affected_by, AFF_MULTI_FORM );
	xREMOVE_BIT( (ch)->affected_by, AFF_TRI_FORM );
	xREMOVE_BIT( (ch)->affected_by, AFF_SPLIT_FORM );

	return;
}

/* Copy player stats to a mob for split, tri, and multi form */
void statsToMob(CHAR_DATA *ch, CHAR_DATA *victim, sh_int form_gsn, bool botched)
{

    char buf  [MAX_STRING_LENGTH];
    float botchMod = 0;

	sprintf( buf, "split%s", ch->name );
	STRFREE( victim->name );
	victim->name = STRALLOC( buf );
	STRFREE( victim->short_descr );
	victim->short_descr = STRALLOC( ch->name );

	if (xIS_SET(ch->affected_by, AFF_SNAMEK))
		xSET_BIT(victim->affected_by, AFF_SNAMEK);
	if (xIS_SET(ch->affected_by, AFF_HYPER))
		xSET_BIT(victim->affected_by, AFF_HYPER);
	if (xIS_SET(ch->affected_by, AFF_GROWTH))
		xSET_BIT(victim->affected_by, AFF_GROWTH);
	if (xIS_SET(ch->affected_by, AFF_GIANT))
		xSET_BIT(victim->affected_by, AFF_GIANT);

	if (!botched)
	{
		sprintf( buf, "%s is standing here.\n\r", victim->short_descr );
		STRFREE( victim->long_descr );
		victim->long_descr = STRALLOC( buf );

		victim->perm_str = get_curr_str(ch);
		victim->perm_dex = get_curr_dex(ch);
		victim->perm_int = get_curr_int(ch);
		victim->perm_con = get_curr_con(ch);
		victim->perm_lck = get_curr_lck(ch);
		victim->sex = ch->sex;
		victim->exp = ch->pl;
		victim->alignment = ch->alignment;

		if (form_gsn == gsn_split_form)
		{
			victim->hit = 20;
			victim->max_hit = 20;
			victim->mana = ch->mana/2;
			victim->max_mana = ch->max_mana/2;
		}
		else if (form_gsn == gsn_tri_form)
		{
			victim->hit = 15;
			victim->max_hit = 15;
			victim->mana = ch->mana/3;
			victim->max_mana = ch->max_mana/3;
		}
		else if (form_gsn == gsn_multi_form)
		{
			victim->hit = 10;
			victim->max_hit = 10;
			victim->mana = ch->mana/5;
			victim->max_mana = ch->max_mana/5;
		}
	}
	else
	{
		sprintf( buf, "%sSomething doesn't look right with this creature.\n\r", victim->description);
		STRFREE( victim->description );
		victim->description = STRALLOC( buf );
		sprintf( buf, "%s is standing here.\n\r", victim->short_descr );
		STRFREE( victim->long_descr );
		victim->long_descr = STRALLOC( buf );

		botchMod = (float)number_range(ch->pcdata->learned[form_gsn]/2, ch->pcdata->learned[form_gsn])/100;

		victim->perm_str = UMAX(1, botchMod * get_curr_str(ch));
		victim->perm_dex = UMAX(1, botchMod * get_curr_dex(ch));
		victim->perm_int = UMAX(1, botchMod * get_curr_int(ch));
		victim->perm_con = UMAX(1, botchMod * get_curr_con(ch));
		victim->perm_lck = UMAX(1, botchMod * get_curr_lck(ch));
		victim->sex = ch->sex;
		victim->exp = UMAX(1, botchMod * ch->pl);
		victim->alignment = ch->alignment;

		if (form_gsn == gsn_split_form)
		{
			victim->hit = URANGE(1, botchMod * 20, 20);
			victim->max_hit = URANGE(1, botchMod * 20, 20);
			victim->mana = UMAX(1, botchMod * (ch->mana/2));
			victim->max_mana = UMAX(1, botchMod * (ch->max_mana/2));
		}
		else if (form_gsn == gsn_tri_form)
		{
			victim->hit = URANGE(1, botchMod * 15, 15);
			victim->max_hit = URANGE(1, botchMod * 15, 15);
			victim->mana = UMAX(1, botchMod * (ch->mana/3));
			victim->max_mana = UMAX(1, botchMod * (ch->max_mana/3));
		}
		else if (form_gsn == gsn_multi_form)
		{
			victim->hit = URANGE(1, botchMod * 10, 10);
			victim->max_hit = URANGE(1, botchMod * 10, 10);
			victim->mana = UMAX(1, botchMod * (ch->mana/5));
			victim->max_mana = UMAX(1, botchMod * (ch->max_mana/5));
		}
	}

	return;

}

/* Remove the stats placed on players from racial transformations */
void transStatRemove(CHAR_DATA *ch)
{
	AFFECT_DATA *tAff;
	AFFECT_DATA *tAffNext;

	if ( xIS_SET( ch->affected_by, AFF_SUPPRESS ) )
	    xREMOVE_BIT( ch->affected_by, AFF_SUPPRESS );

	if ( !ch->first_affect )
		return;

	for (tAff = ch->first_affect;tAff;tAff = tAffNext)
	{
		tAffNext = tAff->next;
		if (tAff->affLocator == LOC_TRANS_STAT_APPLY)
			affect_remove(ch, tAff);
	}

	return;
}

/* Apply stats to characters who use racial transformations */
void transStatApply(CHAR_DATA *ch, int strMod, int spdMod, int intMod, int conMod)
{
	AFFECT_DATA affStr;
	AFFECT_DATA affSpd;
	AFFECT_DATA affInt;
	AFFECT_DATA affCon;

	transStatRemove(ch);

	if (strMod)
	{
		affStr.type = -1;
		affStr.duration = -1;
		affStr.location = APPLY_STR;
		affStr.modifier = strMod;
		xCLEAR_BITS(affStr.bitvector);
		affStr.affLocator = LOC_TRANS_STAT_APPLY;
		affect_to_char(ch, &affStr);
	}

	if (spdMod)
	{
		affSpd.type = -1;
		affSpd.duration = -1;
		affSpd.location = APPLY_DEX;
		affSpd.modifier = spdMod;
		xCLEAR_BITS(affSpd.bitvector);
		affSpd.affLocator = LOC_TRANS_STAT_APPLY;
		affect_to_char(ch, &affSpd);
	}

	if (intMod)
	{
		affInt.type = -1;
		affInt.duration = -1;
		affInt.location = APPLY_INT;
		affInt.modifier = intMod;
		xCLEAR_BITS(affInt.bitvector);
		affInt.affLocator = LOC_TRANS_STAT_APPLY;
		affect_to_char(ch, &affInt);
	}

	if (conMod)
	{
		affCon.type = -1;
		affCon.duration = -1;
		affCon.location = APPLY_CON;
		affCon.modifier = conMod;
		xCLEAR_BITS(affCon.bitvector);
		affCon.affLocator = LOC_TRANS_STAT_APPLY;
		affect_to_char(ch, &affCon);
	}

	return;
}

void rage( CHAR_DATA *ch, CHAR_DATA *victim )
{

	if ( ch->pcdata->learned[gsn_ssj] > 0 )
		return;

	if (ch->delay <= 0)
	{
	if (ch->race != 0 && ch->race != 2)
		return;

	if (ch->rage < 500 || ch->exp < 8000000)
		return;

	if ( ch->pcdata->learned[gsn_ssj] > 0 )
		return;

	switch (number_range(1,5))
	{
	default:
	case 1:
	case 2:
	case 3:
	case 4:
	break;
	case 5:
	if (number_percent() > ((ch->rage - 400) / 50))
	{
		switch (number_range(1, 10))
		{
		default:
		break;
		case 1:
		act( AT_BLUE, "Your hair flashes blonde, but quickly returns to normal.", ch, NULL, victim, TO_CHAR );
		act( AT_BLUE, "$n's hair flashes blonde, but quickly returns to normal.", ch, NULL, victim, TO_VICT );
		act( AT_BLUE, "$n's hair flashes blonde, but quickly returns to normal.", ch, NULL, victim, TO_NOTVICT );
		break;
		case 2:
		act( AT_BLUE, "You scream out, in pure rage, your hatred for $N.", ch, NULL, victim, TO_CHAR );
		act( AT_BLUE, "$n screams out, in pure rage, $s hatred for you.", ch, NULL, victim, TO_VICT );
		act( AT_BLUE, "$n screams out, in pure rage, $s hatred for $N.", ch, NULL, victim, TO_NOTVICT );
		break;
		case 3:
		break;
		case 4:
		break;
		case 5:
		break;
		case 6:
		break;
		case 7:
		break;
		case 8:
		break;
		case 9:
		break;
		case 10:
		break;
		}
		return;
	}
	ch->delay_vict = victim;
	ch->delay = 6;
	break;
	}
	}

	switch (ch->delay)
	{
	case 6:
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "You scream out, in pure rage, your hatred for $N.", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "$n screams out, in pure rage, $s hatred for you.", ch, NULL, victim, TO_VICT );
		act( AT_RED, "$n screams out, in pure rage, $s hatred for $N.", ch, NULL, victim, TO_NOTVICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		ch->delay -= 1;
	    add_timer( ch,     TIMER_DELAY, 4, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 4, NULL, 1 );
		break;
	case 5:
		act( AT_RED, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "=-", ch, NULL, victim, TO_VICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_YELLOW, "Your hair flashes blonde, but quickly returns to normal.", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "$n's hair flashes blonde, but quickly returns to normal.", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "$n's hair flashes blonde, but quickly returns to normal.", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "=-", ch, NULL, victim, TO_VICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_NOTVICT );
		ch->delay -= 1;
	    add_timer( ch,     TIMER_DELAY, 4, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 4, NULL, 1 );
		break;
	case 4:
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "Your hair flashes blonde, but quickly returns to normal.", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "$n's hair flashes blonde, but quickly returns to normal.", ch, NULL, victim, TO_VICT );
		act( AT_RED, "$n's hair flashes blonde, but quickly returns to normal.", ch, NULL, victim, TO_NOTVICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		ch->delay -= 1;
	    add_timer( ch,     TIMER_DELAY, 4, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 4, NULL, 1 );
		break;
	case 3:
		act( AT_RED, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "=-", ch, NULL, victim, TO_VICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_YELLOW, "Your hair flashes blonde, but slowly fades back to normal.", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "$n's hair flashes blonde, but slowly fades back to normal.", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "$n's hair flashes blonde, but slowly fades back to normal.", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "=-", ch, NULL, victim, TO_VICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_NOTVICT );
		ch->delay -= 1;
	    add_timer( ch,     TIMER_DELAY, 4, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 4, NULL, 1 );
		break;
	case 2:
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "Your voice bellows out through the area, with a deep angry howl.", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "$n's voice bellows out through the area, with a deep angry howl.", ch, NULL, victim, TO_VICT );
		act( AT_RED, "$n's voice bellows out through the area, with a deep angry howl.", ch, NULL, victim, TO_NOTVICT );
		do_yell( ch, "rrrrrRRRRRRRRAAAAAAAAAAAAHHHHHHHHHH!!!");
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		ch->delay -= 1;
	    add_timer( ch,     TIMER_DELAY, 4, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 4, NULL, 1 );
		break;
	case 1:
		act( AT_RED, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "=-", ch, NULL, victim, TO_VICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_YELLOW, "Your hair flashes blonde and your eyes turn blue as a fiery aura erupts around you.", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "You look up at $N, with rage filled eyes, ready to kill...", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "$n's hair flashes blonde and $s eyes turn blue as a fiery aura erupts around $m.", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "$n looks up at you, with rage filled eyes, ready to kill...", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "$n's hair flashes blonde and $s eyes turn blue as a fiery aura erupts around $m.", ch, NULL, victim, TO_NOTVICT );
		act( AT_YELLOW, "$n looks up at $N, with rage filled eyes, ready to kill...", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "=-", ch, NULL, victim, TO_VICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_NOTVICT );

	    ch->pcdata->learned[gsn_ssj] = 10;
		if (xIS_SET((ch)->affected_by, AFF_KAIOKEN))
			xREMOVE_BIT((ch)->affected_by, AFF_KAIOKEN);
		if (xIS_SET((ch)->affected_by, AFF_OOZARU))
			xREMOVE_BIT((ch)->affected_by, AFF_OOZARU);
		xSET_BIT( (ch)->affected_by, AFF_SSJ );
		ch->pl = ch->exp * 10;
		transStatApply(ch, 10, 5, 3, 5);
		ch->rage = 0;
		ch->delay = 0;
	    add_timer( ch,     TIMER_ASUPRESSED, 6, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 6, NULL, 1 );
		break;
	}
	return;
}
void rage2( CHAR_DATA *ch, CHAR_DATA *victim )
{

	if ( ch->pcdata->learned[gsn_ssj2] > 0 && ch->pcdata->learned[gsn_ssj] <= 0)
		return;

	if (!xIS_SET(ch->affected_by, AFF_SSJ))
		return;

	if (ch->delay <= 0)
	{
	if (ch->race != 0 && ch->race != 2)
		return;

	if (ch->rage < 800 || ch->exp < 50000000)
		return;

	if ( ch->pcdata->learned[gsn_ssj2] > 0 )
		return;

	switch (number_range(1,5))
	{
	default:
	case 1:
	case 2:
	case 3:
	case 4:
	break;
	case 5:
	if (number_percent() > ((ch->rage - 800) / 50))
	{
		switch (number_range(1, 10))
		{
		default:
		break;
		case 1:
		act( AT_BLUE, "Electricity begins arcing around your body, but it quickly disappears.", ch, NULL, victim, TO_CHAR );
		act( AT_BLUE, "Electricity begins arcing around $n's body, but it quickly disappears.", ch, NULL, victim, TO_VICT );
		act( AT_BLUE, "Electricity begins arcing around $n's body, but it quickly disappears.", ch, NULL, victim, TO_NOTVICT );
		break;
		case 2:
		act( AT_BLUE, "You scream out, in pure rage, your hatred for $N.", ch, NULL, victim, TO_CHAR );
		act( AT_BLUE, "$n screams out, in pure rage, $s hatred for you.", ch, NULL, victim, TO_VICT );
		act( AT_BLUE, "$n screams out, in pure rage, $s hatred for $N.", ch, NULL, victim, TO_NOTVICT );
		break;
		case 3:
		break;
		case 4:
		break;
		case 5:
		break;
		case 6:
		break;
		case 7:
		break;
		case 8:
		break;
		case 9:
		break;
		case 10:
		break;
		}
		return;
	}
	ch->delay_vict = victim;
	ch->delay = 6;
	break;
	}
	}

	switch (ch->delay)
	{
	case 6:
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "You scream out, in pure rage, your hatred for $N.", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "$n screams out, in pure rage, $s hatred for you.", ch, NULL, victim, TO_VICT );
		act( AT_RED, "$n screams out, in pure rage, $s hatred for $N.", ch, NULL, victim, TO_NOTVICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		ch->delay -= 1;
	    add_timer( ch,     TIMER_DELAY, 4, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 4, NULL, 1 );
		break;
	case 5:
		act( AT_RED, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "=-", ch, NULL, victim, TO_VICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_YELLOW, "Electricity begins arcing around your body.", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "Electricity begins arcing around $n's body.", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "Electricity begins arcing around $n's body.", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "=-", ch, NULL, victim, TO_VICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_NOTVICT );
		ch->delay -= 1;
	    add_timer( ch,     TIMER_DELAY, 4, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 4, NULL, 1 );
		break;
	case 4:
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "Electricity violently arcs around your body.", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "Electricity violently arcs around $n's body.", ch, NULL, victim, TO_VICT );
		act( AT_RED, "Electricity violently arcs around $n's body.", ch, NULL, victim, TO_NOTVICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		ch->delay -= 1;
	    add_timer( ch,     TIMER_DELAY, 4, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 4, NULL, 1 );
		break;
	case 3:
		act( AT_RED, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "=-", ch, NULL, victim, TO_VICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_YELLOW, "Your hair flies back and begins to stand straight up.", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "$n's hair flies back and begins to stand straight up.", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "$n's hair flies back and begins to stand straight up.", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "=-", ch, NULL, victim, TO_VICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_NOTVICT );
		ch->delay -= 1;
	    add_timer( ch,     TIMER_DELAY, 4, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 4, NULL, 1 );
		break;
	case 2:
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "Your voice bellows out through the area, with a deep angry howl.", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "$n's voice bellows out through the area, with a deep angry howl.", ch, NULL, victim, TO_VICT );
		act( AT_RED, "$n's voice bellows out through the area, with a deep angry howl.", ch, NULL, victim, TO_NOTVICT );
		do_yell( ch, "rrrrrRRRRRRRRAAAAAAAAAAAAHHHHHHHHHH!!!");
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		ch->delay -= 1;
	    add_timer( ch,     TIMER_DELAY, 4, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 4, NULL, 1 );
		break;
	case 1:
		act( AT_RED, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "=-", ch, NULL, victim, TO_VICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_YELLOW, "Your hair flies back all the way and electricity arcs all around you as your aura flares brightly.", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "$n's hair flies back all the way and electricity arcs all around $m as $s aura flares brightly.", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "$n's hair flies back all the way and electricity arcs all around $m as $s aura flares brightly", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "=-", ch, NULL, victim, TO_VICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_NOTVICT );

	    ch->pcdata->learned[gsn_ssj2] = 10;
		if (xIS_SET((ch)->affected_by, AFF_KAIOKEN))
			xREMOVE_BIT((ch)->affected_by, AFF_KAIOKEN);
		if (xIS_SET((ch)->affected_by, AFF_OOZARU))
			xREMOVE_BIT((ch)->affected_by, AFF_OOZARU);
		if (!xIS_SET(ch->affected_by, AFF_SSJ))
			xSET_BIT( (ch)->affected_by, AFF_SSJ );
		xSET_BIT( (ch)->affected_by, AFF_SSJ2 );
		ch->pl = ch->exp * 16;
		transStatApply(ch, 16, 8, 4, 8);
		ch->delay = 0;
		ch->rage = 0;
	    add_timer( ch,     TIMER_ASUPRESSED, 6, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 6, NULL, 1 );
		break;
	}
	return;
}

void rage3( CHAR_DATA *ch, CHAR_DATA *victim )
{

	if ( ch->pcdata->learned[gsn_ssj3] > 0 && ch->pcdata->learned[gsn_ssj] <= 0
		&& ch->pcdata->learned[gsn_ssj2] <= 0)
		return;

	if (!xIS_SET(ch->affected_by, AFF_SSJ) && !xIS_SET(ch->affected_by, AFF_SSJ2))
		return;

	if (ch->delay <= 0)
	{
	if (ch->race != 0 && ch->race != 2)
		return;

	if (ch->rage < 1000 || ch->exp < 500000000)
		return;

	if ( ch->pcdata->learned[gsn_ssj3] > 0 )
		return;

	switch (number_range(1,5))
	{
	default:
	case 1:
	case 2:
	case 3:
	case 4:
	break;
	case 5:
	if (number_percent() > ((ch->rage - 1000) / 50))
	{
		return;
	}
	ch->delay_vict = victim;
	ch->delay = 6;
	break;
	}
	}

	switch (ch->delay)
	{
	case 6:
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "You scream out, in pure rage, your hatred for $N.", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "$n screams out, in pure rage, $s hatred for you.", ch, NULL, victim, TO_VICT );
		act( AT_RED, "$n screams out, in pure rage, $s hatred for $N.", ch, NULL, victim, TO_NOTVICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		ch->delay -= 1;
	    add_timer( ch,     TIMER_DELAY, 4, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 4, NULL, 1 );
		break;
	case 5:
		act( AT_RED, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "=-", ch, NULL, victim, TO_VICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_YELLOW, "Electricity begins arcing around your body.", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "Electricity begins arcing around $n's body.", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "Electricity begins arcing around $n's body.", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "=-", ch, NULL, victim, TO_VICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_NOTVICT );
		ch->delay -= 1;
	    add_timer( ch,     TIMER_DELAY, 4, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 4, NULL, 1 );
		break;
	case 4:
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "Electricity violently arcs around your body.", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "Electricity violently arcs around $n's body.", ch, NULL, victim, TO_VICT );
		act( AT_RED, "Electricity violently arcs around $n's body.", ch, NULL, victim, TO_NOTVICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		ch->delay -= 1;
	    add_timer( ch,     TIMER_DELAY, 4, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 4, NULL, 1 );
		break;
	case 3:
		act( AT_RED, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "=-", ch, NULL, victim, TO_VICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_YELLOW, "Your hair begins to flow all the way down your back.", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "$n's hair begins to flow all the way down $s back.", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "$n's hair begins to flow all the way down $s back.", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "=-", ch, NULL, victim, TO_VICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_NOTVICT );
		ch->delay -= 1;
	    add_timer( ch,     TIMER_DELAY, 4, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 4, NULL, 1 );
		break;
	case 2:
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "Your voice bellows out through the area, with a deep angry howl.", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "$n's voice bellows out through the area, with a deep angry howl.", ch, NULL, victim, TO_VICT );
		act( AT_RED, "$n's voice bellows out through the area, with a deep angry howl.", ch, NULL, victim, TO_NOTVICT );
		do_yell( ch, "rrrrrRRRRRRRRAAAAAAAAAAAAHHHHHHHHHH!!!");
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		ch->delay -= 1;
	    add_timer( ch,     TIMER_DELAY, 4, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 4, NULL, 1 );
		break;
	case 1:
		act( AT_RED, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "=-", ch, NULL, victim, TO_VICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_YELLOW, "Your eyebrows disappear and your aura flares even brighter.", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "$n's eyebrows disappear and $s aura flares even brighter.", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "$n's eyebrows disappear and $s aura flares even brighter.", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "=-", ch, NULL, victim, TO_VICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_NOTVICT );

	    ch->pcdata->learned[gsn_ssj3] = 10;
		if (xIS_SET((ch)->affected_by, AFF_KAIOKEN))
			xREMOVE_BIT((ch)->affected_by, AFF_KAIOKEN);
		if (xIS_SET((ch)->affected_by, AFF_OOZARU))
			xREMOVE_BIT((ch)->affected_by, AFF_OOZARU);
		if (!xIS_SET(ch->affected_by, AFF_SSJ))
			xSET_BIT( (ch)->affected_by, AFF_SSJ );
		if (!xIS_SET(ch->affected_by, AFF_SSJ2))
			xSET_BIT( (ch)->affected_by, AFF_SSJ2 );
		xSET_BIT( (ch)->affected_by, AFF_SSJ3 );
		ch->pl = ch->exp * 24;
		transStatApply(ch, 24, 12, 6, 12);
		ch->delay = 0;
		ch->rage = 0;
	    add_timer( ch,     TIMER_ASUPRESSED, 6, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 6, NULL, 1 );
		break;
	}
	return;
}

void rage4( CHAR_DATA *ch, CHAR_DATA *victim )
{

	if ( ch->pcdata->learned[gsn_ssj4] > 0 && ch->pcdata->learned[gsn_ssj] <= 0
		&& ch->pcdata->learned[gsn_ssj2] <= 0 && ch->pcdata->learned[gsn_ssj3] <= 0)
		return;

	if (!xIS_SET(ch->affected_by, AFF_SSJ) && !xIS_SET(ch->affected_by, AFF_SSJ2)
		&& !xIS_SET(ch->affected_by, AFF_SSJ3))
		return;

	if (ch->delay <= 0)
	{
	if (ch->race != 0)
		return;

	if (ch->rage < 1500 || ch->exp < 2000000000)
		return;

	if ( ch->pcdata->learned[gsn_ssj4] > 0 )
		return;

	switch (number_range(1,5))
	{
	default:
	case 1:
	case 2:
	case 3:
	case 4:
	break;
	case 5:
	if (number_percent() > ((ch->rage - 1500) / 50))
	{
		return;
	}
	ch->delay_vict = victim;
	ch->delay = 6;
	break;
	}
	}

	switch (ch->delay)
	{
	case 6:
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "You scream out, in pure rage, your hatred for $N.", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "$n screams out, in pure rage, $s hatred for you.", ch, NULL, victim, TO_VICT );
		act( AT_RED, "$n screams out, in pure rage, $s hatred for $N.", ch, NULL, victim, TO_NOTVICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		ch->delay -= 1;
	    add_timer( ch,     TIMER_DELAY, 4, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 4, NULL, 1 );
		break;
	case 5:
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "Electricity violently arcs around your body.", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "Electricity violently arcs around $n's body.", ch, NULL, victim, TO_VICT );
		act( AT_RED, "Electricity violently arcs around $n's body.", ch, NULL, victim, TO_NOTVICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		ch->delay -= 1;
	    add_timer( ch,     TIMER_DELAY, 4, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 4, NULL, 1 );
		break;
	case 4:
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "Red fur begins to sprout all over your body.", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "Red fur begins to sprout all over $n's body.", ch, NULL, victim, TO_VICT );
		act( AT_RED, "Red fur begins to sprout all over $n's body.", ch, NULL, victim, TO_NOTVICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		ch->delay -= 1;
	    add_timer( ch,     TIMER_DELAY, 4, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 4, NULL, 1 );
		break;
	case 3:
		act( AT_RED, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "=-", ch, NULL, victim, TO_VICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_YELLOW, "Your hair flashes black.", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "$n's hair flashes black.", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "$n's hair flashes black.", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "=-", ch, NULL, victim, TO_VICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_NOTVICT );
		ch->delay -= 1;
	    add_timer( ch,     TIMER_DELAY, 4, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 4, NULL, 1 );
		break;
	case 2:
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "Your voice bellows out through the area, with a deep angry howl.", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "$n's voice bellows out through the area, with a deep angry howl.", ch, NULL, victim, TO_VICT );
		act( AT_RED, "$n's voice bellows out through the area, with a deep angry howl.", ch, NULL, victim, TO_NOTVICT );
		do_yell( ch, "rrrrrRRRRRRRRAAAAAAAAAAAAHHHHHHHHHH!!!");
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_VICT );
		act( AT_YELLOW, "=-", ch, NULL, victim, TO_NOTVICT );
		ch->delay -= 1;
	    add_timer( ch,     TIMER_DELAY, 4, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 4, NULL, 1 );
		break;
	case 1:
		act( AT_RED, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "=-", ch, NULL, victim, TO_VICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "You howl with anger as your hair turns black again and grow", ch, NULL, NULL, TO_CHAR );
		act( AT_RED, "thick red fur all over your body, finally you sprout a", ch, NULL, NULL, TO_CHAR );
		act( AT_RED, "tail and look up with glaring eyes inset within a red outline.", ch, NULL, NULL, TO_CHAR );
		act( AT_RED, "$n howls with anger as $s hair turns black again and grows", ch, NULL, NULL, TO_NOTVICT );
		act( AT_RED, "thick red fur all over $s body, finally $e sprouts a", ch, NULL, NULL, TO_NOTVICT );
		act( AT_RED, "tail and looks up at you with glaring eyes inset within a red outline.", ch, NULL, NULL, TO_NOTVICT );
		act( AT_RED, "You look up at $N, with rage filled eyes, ready to kill...", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "$n looks up at you, with rage filled eyes, ready to kill...", ch, NULL, victim, TO_VICT );
		act( AT_RED, "$n looks up at $N, with rage filled eyes, ready to kill...", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "=-", ch, NULL, victim, TO_VICT );
		act( AT_RED, "=-", ch, NULL, victim, TO_NOTVICT );

	    ch->pcdata->learned[gsn_ssj4] = 10;
		if (xIS_SET((ch)->affected_by, AFF_KAIOKEN))
			xREMOVE_BIT((ch)->affected_by, AFF_KAIOKEN);
		if (xIS_SET((ch)->affected_by, AFF_OOZARU))
			xREMOVE_BIT((ch)->affected_by, AFF_OOZARU);
		if (!xIS_SET(ch->affected_by, AFF_SSJ))
			xSET_BIT( (ch)->affected_by, AFF_SSJ );
		if (!xIS_SET(ch->affected_by, AFF_SSJ2))
			xSET_BIT( (ch)->affected_by, AFF_SSJ2 );
		if (!xIS_SET(ch->affected_by, AFF_SSJ3))
			xSET_BIT( (ch)->affected_by, AFF_SSJ3 );
		xSET_BIT( (ch)->affected_by, AFF_SSJ4 );
		ch->pl = ch->exp * 30;
		transStatApply(ch, 30, 15, 8, 15);
		ch->delay = 0;
		ch->rage = 0;
	    add_timer( ch,     TIMER_ASUPRESSED, 8, NULL, 1 );
	    add_timer( victim, TIMER_ASUPRESSED, 8, NULL, 1 );
		break;
	}
	return;
}

void heart_calc( CHAR_DATA *ch, char *argument  )
{
	double pl_mult = 1;
	double pl_mult2 = 1;
	int con = 0;
	double chk = 0;

	if (ch->race != 1 || IS_NPC(ch))
		return;

	if (ch->exp > ch->pl)
		return;

	if (!IS_SET(ch->pcdata->combatFlags, CMB_NO_HEART))
		return;

	if (!xIS_SET(ch->affected_by, AFF_HEART))
		ch->heart_pl = ch->pl;

	con = (get_curr_con(ch)) - 10;

	if (con < 1)
	{
		if (xIS_SET(ch->affected_by, AFF_HEART))
			xREMOVE_BIT(ch->affected_by, AFF_HEART);
		ch->pl = ch->heart_pl;
		return;
	}

	if (ch->hit >= 90 || ch->hit <= 0)
	{
		if (xIS_SET(ch->affected_by, AFF_HEART))
			xREMOVE_BIT(ch->affected_by, AFF_HEART);
		ch->pl = ch->heart_pl;
		return;
	}

	pl_mult = con / 10;

	chk = (double)(18 - (ch->hit / 5)) / 18 * pl_mult;

	if (chk <= 1)
	{
		if (xIS_SET(ch->affected_by, AFF_HEART))
			xREMOVE_BIT(ch->affected_by, AFF_HEART);
		ch->pl = ch->heart_pl;
		return;
	}

	if (!xIS_SET(ch->affected_by, AFF_HEART))
	{
		xSET_BIT(ch->affected_by, AFF_HEART);
	}

	pl_mult2 = (double) ch->heart_pl / ch->exp;
	chk = (double) pl_mult2 + chk;

	ch->pl = ch->exp * chk;

	act( AT_RED, "", ch, NULL, NULL, TO_CHAR    );
	act( AT_RED, "", ch, NULL, NULL, TO_NOTVICT    );


	return;
}

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

	if (ch->pl <= ch->exp)
	{
		send_to_char( "You are already powered down.\n\r", ch );
		ch->powerup = 0;
		if (xIS_SET((ch)->affected_by, AFF_SSJ))
                {
			xREMOVE_BIT((ch)->affected_by, AFF_SSJ);
                        if( !IS_NPC( ch ) )
                        {
                          ch->pcdata->haircolor = ch->pcdata->orignalhaircolor;
                          ch->pcdata->eyes      = ch->pcdata->orignaleyes;
                        }
                }
	
		if (xIS_SET((ch)->affected_by, AFF_USSJ))
			xREMOVE_BIT((ch)->affected_by, AFF_USSJ);
		if (xIS_SET((ch)->affected_by, AFF_USSJ2))
			xREMOVE_BIT((ch)->affected_by, AFF_USSJ2);
		if (xIS_SET((ch)->affected_by, AFF_SSJ2))
			xREMOVE_BIT((ch)->affected_by, AFF_SSJ2);
		if (xIS_SET((ch)->affected_by, AFF_SSJ3))
			xREMOVE_BIT((ch)->affected_by, AFF_SSJ3);
		if (xIS_SET((ch)->affected_by, AFF_SSJ4))
			xREMOVE_BIT((ch)->affected_by, AFF_SSJ4);
		if (xIS_SET((ch)->affected_by, AFF_KAIOKEN))
			xREMOVE_BIT((ch)->affected_by, AFF_KAIOKEN);
		if (xIS_SET((ch)->affected_by, AFF_SNAMEK))
			xREMOVE_BIT((ch)->affected_by, AFF_SNAMEK);
		if (xIS_SET((ch)->affected_by, AFF_ICER2))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER2);
		if (xIS_SET((ch)->affected_by, AFF_ICER3))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER3);
		if (xIS_SET((ch)->affected_by, AFF_ICER4))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER4);
		if (xIS_SET((ch)->affected_by, AFF_ICER5))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER5);
		if (xIS_SET((ch)->affected_by, AFF_HEART))
			xREMOVE_BIT(ch->affected_by, AFF_HEART);
		if (xIS_SET((ch)->affected_by, AFF_HYPER))
			xREMOVE_BIT(ch->affected_by, AFF_HYPER);
		if (xIS_SET((ch)->affected_by, AFF_EXTREME))
			xREMOVE_BIT((ch)->affected_by, AFF_EXTREME);
		if (xIS_SET((ch)->affected_by, AFF_SEMIPERFECT))
			xREMOVE_BIT(ch->affected_by, AFF_SEMIPERFECT);
		if (xIS_SET((ch)->affected_by, AFF_PERFECT))
			xREMOVE_BIT(ch->affected_by, AFF_PERFECT);
		if (xIS_SET((ch)->affected_by, AFF_ULTRAPERFECT))
			xREMOVE_BIT(ch->affected_by, AFF_ULTRAPERFECT);
		if (xIS_SET((ch)->affected_by, AFF_GROWTH))
			xREMOVE_BIT(ch->affected_by, AFF_GROWTH);
		if (xIS_SET((ch)->affected_by, AFF_GIANT))
			xREMOVE_BIT(ch->affected_by, AFF_GIANT);
		if (xIS_SET((ch)->affected_by, AFF_MYSTIC))
			xREMOVE_BIT(ch->affected_by, AFF_MYSTIC);
                if (xIS_SET((ch)->affected_by, AFF_EVILBOOST))
                        xREMOVE_BIT((ch)->affected_by, AFF_EVILBOOST);
                if (xIS_SET((ch)->affected_by, AFF_EVILSURGE))
                        xREMOVE_BIT((ch)->affected_by, AFF_EVILSURGE);
                if (xIS_SET((ch)->affected_by, AFF_EVILOVERLOAD))
                        xREMOVE_BIT((ch)->affected_by, AFF_EVILOVERLOAD);
                if (xIS_SET((ch)->affected_by, AFF_EVIL_TRANS))
                        xREMOVE_BIT((ch)->affected_by, AFF_EVIL_TRANS);
                if (xIS_SET((ch)->affected_by, AFF_KID_TRANS))
                        xREMOVE_BIT((ch)->affected_by, AFF_KID_TRANS);
                if (xIS_SET((ch)->affected_by, AFF_SUPER_TRANS))
                        xREMOVE_BIT((ch)->affected_by, AFF_SUPER_TRANS);
		transStatRemove(ch);
		heart_calc(ch, "");
		return;
	}
	if (ch->exp != ch->pl && xIS_SET(ch->affected_by, AFF_OOZARU))
	{
		send_to_char( "You can't while you are an Oozaru.\n\r", ch );
		return;
	}
	if (ch->exp != ch->pl && xIS_SET(ch->affected_by, AFF_MAKEOSTAR))
	{
		send_to_char( "The power of the Makeo Star cannot be avoided.\n\r", ch );
		return;
	}
	if (ch->exp != ch->pl && (xIS_SET(ch->affected_by, AFF_T4CHIP) 
            || xIS_SET(ch->affected_by, AFF_T3CHIP)
            || xIS_SET(ch->affected_by, AFF_T2CHIP)
            || xIS_SET(ch->affected_by, AFF_T1CHIP)
            || xIS_SET(ch->affected_by, AFF_OMEGACHIP)
            || xIS_SET(ch->affected_by, AFF_SIGMAVIRUS)
            || xIS_SET(ch->affected_by, AFF_CRYSTALPROC)
            || xIS_SET(ch->affected_by, AFF_V1CHIP)
            || xIS_SET(ch->affected_by, AFF_VM1CHIP)
            || xIS_SET(ch->affected_by, AFF_V2CHIP)
            || xIS_SET(ch->affected_by, AFF_VM2CHIP)))
	{
		send_to_char( "You cannot powerdown while you have that installed.\n\r", ch );
		return;
	}
	if ( xIS_SET((ch)->affected_by, AFF_SSJ)
		|| xIS_SET((ch)->affected_by, AFF_USSJ)
		|| xIS_SET((ch)->affected_by, AFF_USSJ2)
		|| xIS_SET((ch)->affected_by, AFF_SSJ2)
		|| xIS_SET((ch)->affected_by, AFF_SSJ3)
		|| xIS_SET((ch)->affected_by, AFF_SSJ4)
		|| xIS_SET((ch)->affected_by, AFF_KAIOKEN)
		|| xIS_SET((ch)->affected_by, AFF_HYPER)
		|| xIS_SET((ch)->affected_by, AFF_EXTREME)
		|| xIS_SET((ch)->affected_by, AFF_SNAMEK)
		|| xIS_SET((ch)->affected_by, AFF_ICER2)
		|| xIS_SET((ch)->affected_by, AFF_ICER3)
		|| xIS_SET((ch)->affected_by, AFF_ICER4)
		|| xIS_SET((ch)->affected_by, AFF_ICER5)
		|| xIS_SET((ch)->affected_by, AFF_SEMIPERFECT)
		|| xIS_SET((ch)->affected_by, AFF_PERFECT)
		|| xIS_SET((ch)->affected_by, AFF_ULTRAPERFECT)
                || xIS_SET((ch)->affected_by, AFF_GROWTH)
                || xIS_SET((ch)->affected_by, AFF_GIANT)
		|| xIS_SET((ch)->affected_by, AFF_MYSTIC)
		|| xIS_SET((ch)->affected_by, AFF_EVILBOOST)
                || xIS_SET((ch)->affected_by, AFF_EVILSURGE)
                || xIS_SET((ch)->affected_by, AFF_EVILOVERLOAD)
                || xIS_SET((ch)->affected_by, AFF_EVIL_TRANS)
                || xIS_SET((ch)->affected_by, AFF_KID_TRANS)
                || xIS_SET((ch)->affected_by, AFF_SUPER_TRANS) )
		{
		if (xIS_SET((ch)->affected_by, AFF_SSJ))
                {
			xREMOVE_BIT((ch)->affected_by, AFF_SSJ);
                        if( !IS_NPC( ch ) )
                        {
                          ch->pcdata->haircolor = ch->pcdata->orignalhaircolor;
                          ch->pcdata->eyes      = ch->pcdata->orignaleyes;
                        }
                }
		if (xIS_SET((ch)->affected_by, AFF_USSJ))
			xREMOVE_BIT((ch)->affected_by, AFF_USSJ);
		if (xIS_SET((ch)->affected_by, AFF_USSJ2))
			xREMOVE_BIT((ch)->affected_by, AFF_USSJ2);
		if (xIS_SET((ch)->affected_by, AFF_SSJ2))
			xREMOVE_BIT((ch)->affected_by, AFF_SSJ2);
		if (xIS_SET((ch)->affected_by, AFF_SSJ3))
			xREMOVE_BIT((ch)->affected_by, AFF_SSJ3);
		if (xIS_SET((ch)->affected_by, AFF_SSJ4))
			xREMOVE_BIT((ch)->affected_by, AFF_SSJ4);
		if (xIS_SET((ch)->affected_by, AFF_KAIOKEN))
			xREMOVE_BIT((ch)->affected_by, AFF_KAIOKEN);
		if (xIS_SET((ch)->affected_by, AFF_SNAMEK))
			xREMOVE_BIT((ch)->affected_by, AFF_SNAMEK);
		if (xIS_SET((ch)->affected_by, AFF_ICER2))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER2);
		if (xIS_SET((ch)->affected_by, AFF_ICER3))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER3);
		if (xIS_SET((ch)->affected_by, AFF_ICER4))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER4);
		if (xIS_SET((ch)->affected_by, AFF_ICER5))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER5);
		if (xIS_SET((ch)->affected_by, AFF_HYPER))
			xREMOVE_BIT(ch->affected_by, AFF_HYPER);
		if (xIS_SET((ch)->affected_by, AFF_EXTREME))
			xREMOVE_BIT((ch)->affected_by, AFF_EXTREME);
		if (xIS_SET((ch)->affected_by, AFF_SEMIPERFECT))
			xREMOVE_BIT(ch->affected_by, AFF_SEMIPERFECT);
		if (xIS_SET((ch)->affected_by, AFF_PERFECT))
			xREMOVE_BIT(ch->affected_by, AFF_PERFECT);
		if (xIS_SET((ch)->affected_by, AFF_ULTRAPERFECT))
			xREMOVE_BIT(ch->affected_by, AFF_ULTRAPERFECT);
		if (xIS_SET((ch)->affected_by, AFF_GROWTH))
			xREMOVE_BIT(ch->affected_by, AFF_GROWTH);
		if (xIS_SET((ch)->affected_by, AFF_GIANT))
			xREMOVE_BIT(ch->affected_by, AFF_GIANT);
		if (xIS_SET((ch)->affected_by, AFF_MYSTIC))
			xREMOVE_BIT(ch->affected_by, AFF_MYSTIC);
                if (xIS_SET((ch)->affected_by, AFF_EVILBOOST))
                        xREMOVE_BIT((ch)->affected_by, AFF_EVILBOOST);
                if (xIS_SET((ch)->affected_by, AFF_EVILSURGE))
                        xREMOVE_BIT((ch)->affected_by, AFF_EVILSURGE);
                if (xIS_SET((ch)->affected_by, AFF_EVILOVERLOAD))
                        xREMOVE_BIT((ch)->affected_by, AFF_EVILOVERLOAD);
                if (xIS_SET((ch)->affected_by, AFF_EVIL_TRANS))
                        xREMOVE_BIT((ch)->affected_by, AFF_EVIL_TRANS);
                if (xIS_SET((ch)->affected_by, AFF_KID_TRANS))
                        xREMOVE_BIT((ch)->affected_by, AFF_KID_TRANS);
                if (xIS_SET((ch)->affected_by, AFF_SUPER_TRANS))
                        xREMOVE_BIT((ch)->affected_by, AFF_SUPER_TRANS);
		}
	ch->powerup = 0;
	send_to_pager_color( "&BYou power down and return to normal.\n\r", ch );
	if (xIS_SET((ch)->affected_by, AFF_HEART))
		xREMOVE_BIT(ch->affected_by, AFF_HEART);
	transStatRemove(ch);
	ch->pl = ch->exp;
	heart_calc(ch, "");
	return;
}

void do_powerup( CHAR_DATA *ch, char *argument  )
{
	float pl_mult = 1;
        int   auraColor = AT_YELLOW;

	if ( xIS_SET((ch)->affected_by, AFF_SSJ)
		|| xIS_SET((ch)->affected_by, AFF_SSJ2)
		|| xIS_SET((ch)->affected_by, AFF_SSJ3)
		|| xIS_SET((ch)->affected_by, AFF_SSJ4)
		|| xIS_SET((ch)->affected_by, AFF_KAIOKEN)
		|| xIS_SET((ch)->affected_by, AFF_HYPER)
		|| xIS_SET((ch)->affected_by, AFF_SNAMEK)
		|| xIS_SET((ch)->affected_by, AFF_ICER2)
		|| xIS_SET((ch)->affected_by, AFF_ICER3)
		|| xIS_SET((ch)->affected_by, AFF_ICER4)
		|| xIS_SET((ch)->affected_by, AFF_ICER5)
		|| xIS_SET((ch)->affected_by, AFF_SEMIPERFECT)
		|| xIS_SET((ch)->affected_by, AFF_PERFECT)
		|| xIS_SET((ch)->affected_by, AFF_ULTRAPERFECT)
		|| xIS_SET((ch)->affected_by, AFF_OOZARU)
		|| xIS_SET((ch)->affected_by, AFF_EXTREME)
		|| xIS_SET((ch)->affected_by, AFF_MYSTIC)
                || xIS_SET((ch)->affected_by, AFF_EVILBOOST)
                || xIS_SET((ch)->affected_by, AFF_EVILSURGE)
                || xIS_SET((ch)->affected_by, AFF_EVILOVERLOAD)
                || xIS_SET((ch)->affected_by, AFF_EVIL_TRANS)
                || xIS_SET((ch)->affected_by, AFF_KID_TRANS)
                || xIS_SET((ch)->affected_by, AFF_SUPER_TRANS)
                || xIS_SET((ch)->affected_by, AFF_T4CHIP)
                || xIS_SET((ch)->affected_by, AFF_T3CHIP)
                || xIS_SET((ch)->affected_by, AFF_T2CHIP)
                || xIS_SET((ch)->affected_by, AFF_T1CHIP)
                || xIS_SET((ch)->affected_by, AFF_OMEGACHIP)
                || xIS_SET((ch)->affected_by, AFF_SIGMAVIRUS)
                || xIS_SET((ch)->affected_by, AFF_CRYSTALPROC)
                || xIS_SET((ch)->affected_by, AFF_V1CHIP)
                || xIS_SET((ch)->affected_by, AFF_VM1CHIP)
                || xIS_SET((ch)->affected_by, AFF_V2CHIP)
                || xIS_SET((ch)->affected_by, AFF_VM2CHIP))
	{
		send_to_pager_color( "&BYou can't power up any more in this form.\n\r", ch );
		return;
	}

    if ( xIS_SET( ch->affected_by, AFF_SUPPRESS ) )
	xREMOVE_BIT( ch->affected_by, AFF_SUPPRESS );

    if( !IS_NPC( ch ) && ch->pcdata->auraColorPowerUp >= 0 )
      auraColor = ch->pcdata->auraColorPowerUp;

    if ( !str_cmp( argument, "max" ) )
    {
        if( ch->race == race_lookup( "android" ) )
        {
		act( auraColor, "With a bright flash and a deafening boom that fills the air with a static charge you power up to your maximum.", ch, NULL, NULL, TO_CHAR );
		act( auraColor, "With a bright flash and a deafening boom that fills the air with a static charge $n powers up to $s maximum.", ch, NULL, NULL, TO_NOTVICT );
        }
        else
        {
		act( auraColor, "With a blinding flash you power up to your maximum.", ch, NULL, NULL, TO_CHAR );
		act( auraColor, "With a blinding flash $n powers up to $s maximum.", ch, NULL, NULL, TO_NOTVICT );
        }
	if (ch->exp <= 100000)
	{
		ch->powerup = 1;
		pl_mult = 1.1;
	}
	else if (ch->exp <= 250000)
	{
		ch->powerup = 2;
		pl_mult = 1.2;
	}
	else if (ch->exp <= 500000)
	{
		ch->powerup = 3;
		pl_mult = 1.3;
	}
	else if (ch->exp <= 1000000)
	{
		ch->powerup = 4;
		pl_mult = 1.4;
	}
	else if (ch->exp <= 2000000)
	{
		ch->powerup = 5;
		pl_mult = 1.5;
	}
	else if (ch->exp <= 5000000)
	{
		ch->powerup = 6;
		pl_mult = 1.6;
	}
	else
	{
		ch->powerup = 7;
		pl_mult = 1.7;
	}

	if (xIS_SET((ch)->affected_by, AFF_HEART))
		xREMOVE_BIT(ch->affected_by, AFF_HEART);
	ch->pl = ch->exp * pl_mult;
	heart_calc(ch, "");
    return;
    }

	if (ch->pl < ch->exp)
	{
		act( auraColor, "You power up to your base.", ch, NULL, NULL, TO_CHAR );
		act( auraColor, "$n powers up to $s base.", ch, NULL, NULL, TO_NOTVICT );
		if (xIS_SET((ch)->affected_by, AFF_HEART))
			xREMOVE_BIT(ch->affected_by, AFF_HEART);
		ch->powerup = 0;
		ch->pl = ch->exp;
		heart_calc(ch, "");
		return;
	}

	if (ch->powerup == 0)
	{
            if( ch->race == race_lookup( "android" ) )
            {
		act( auraColor, "A soft hum begins to fill the air as you power up for the first time.", ch, NULL, NULL, TO_CHAR );
		act( auraColor, "A soft hum begins to fill the air as $n powers up for the first time.", ch, NULL, NULL, TO_NOTVICT );
            }
            else
            {
		act( auraColor, "You begin to glow as you power up for the first time.", ch, NULL, NULL, TO_CHAR );
		act( auraColor, "$n begins to glow as $e powers up for the first time.", ch, NULL, NULL, TO_NOTVICT );
            }
		ch->powerup = 1;
		pl_mult = 1.1;
	if (xIS_SET((ch)->affected_by, AFF_HEART))
		xREMOVE_BIT(ch->affected_by, AFF_HEART);
	ch->pl = ch->exp * pl_mult;
	heart_calc(ch, "");
	}
	else if (ch->powerup == 1 && ch->exp > 100000)
	{
            if( ch->race == race_lookup( "android" ) )
            {
		act( auraColor, "The soft hum coming from you is joined by whirring and grinding noises as you power up for the second time.", ch, NULL, NULL, TO_CHAR );
		act( auraColor, "The soft hum coming from $n is joined by whirring and grinding noises as $e powers up for the second time.", ch, NULL, NULL, TO_NOTVICT );
            }
            else
            {
		act( auraColor, "You begin to glow more as you power up for the second time.", ch, NULL, NULL, TO_CHAR );
		act( auraColor, "$n begins to glow more as $e powers up for the second time.", ch, NULL, NULL, TO_NOTVICT );
            }
		ch->powerup = 2;
		pl_mult = 1.2;
	if (xIS_SET((ch)->affected_by, AFF_HEART))
		xREMOVE_BIT(ch->affected_by, AFF_HEART);
	ch->pl = ch->exp * pl_mult;
	heart_calc(ch, "");
	}
	else if (ch->powerup == 2 && ch->exp > 250000)
	{
            if( ch->race == race_lookup( "android" ) )
            {
		act( auraColor, "The air around you gains a static charge as you power up for the third time.", ch, NULL, NULL, TO_CHAR );
		act( auraColor, "The air around $n gains a static charge as $e powers up for the third time.", ch, NULL, NULL, TO_NOTVICT );
            }
            else
            {
		act( auraColor, "You begin to glow brightly as you power up for the third time.", ch, NULL, NULL, TO_CHAR );
		act( auraColor, "$n begins to glow brightly as $e powers up for the third time.", ch, NULL, NULL, TO_NOTVICT );
            }
		ch->powerup = 3;
		pl_mult = 1.3;
	if (xIS_SET((ch)->affected_by, AFF_HEART))
		xREMOVE_BIT(ch->affected_by, AFF_HEART);
	ch->pl = ch->exp * pl_mult;
	heart_calc(ch, "");
	}
	else if (ch->powerup == 3 && ch->exp > 500000)
	{
            if( ch->race == race_lookup( "android" ) )
            {
		act( auraColor, "An internal engine roars to life, the ground shaking softly, as you power up for the fourth time.", ch, NULL, NULL, TO_CHAR );
		act( auraColor, "An internal engine roars to life, the ground shaking softly, as $e powers up for the fourth time.", ch, NULL, NULL, TO_NOTVICT );
            }
            else
            {
		act( auraColor, "The ground trembles under your feet as you power up for the fourth time.", ch, NULL, NULL, TO_CHAR );
		act( auraColor, "The ground trembles under $n's feet as $e powers up for the fourth time.", ch, NULL, NULL, TO_NOTVICT );
            }
		ch->powerup = 4;
		pl_mult = 1.4;
	if (xIS_SET((ch)->affected_by, AFF_HEART))
		xREMOVE_BIT(ch->affected_by, AFF_HEART);
	ch->pl = ch->exp * pl_mult;
	heart_calc(ch, "");
	}
	else if (ch->powerup == 4 && ch->exp > 1000000)
	{
            if( ch->race == race_lookup( "android" ) )
            {
		act( auraColor, "A high-pitched whine comes from your body, cracks appearing under your feet, as you power up for the fifth time.", ch, NULL, NULL, TO_CHAR );
		act( auraColor, "A high-pithced whine comes from $n's body, cracks appearing under $s feet, as $e powers up for the fifth time.", ch, NULL, NULL, TO_NOTVICT );
            }
            else
            {
		act( auraColor, "The ground really shakes as you power up for the fifth time.", ch, NULL, NULL, TO_CHAR );
		act( auraColor, "The ground really shakes as $n powers up for the fifth time.", ch, NULL, NULL, TO_NOTVICT );
            }
		ch->powerup = 5;
		pl_mult = 1.5;
	if (xIS_SET((ch)->affected_by, AFF_HEART))
		xREMOVE_BIT(ch->affected_by, AFF_HEART);
	ch->pl = ch->exp * pl_mult;
	heart_calc(ch, "");
	}
	else if (ch->powerup == 5 && ch->exp > 2000000)
	{
            if( ch->race == race_lookup( "android" ) )
            {
		act( auraColor, "Engine roaring loudly and electricity crackling through the air, you power up for the sixth time.", ch, NULL, NULL, TO_CHAR );
		act( auraColor, "Engine roaring loudly and electricity crackling through the air, $n powers up for the sixth time.", ch, NULL, NULL, TO_NOTVICT );
            }
            else
            {
		act( auraColor, "Pieces of rock fly around as you power up for the sixth time.", ch, NULL, NULL, TO_CHAR );
		act( auraColor, "Pieces of rock fly around as $n powers up for the sixth time.", ch, NULL, NULL, TO_NOTVICT );
            }
		ch->powerup = 6;
		pl_mult = 1.6;
	if (xIS_SET((ch)->affected_by, AFF_HEART))
		xREMOVE_BIT(ch->affected_by, AFF_HEART);
	ch->pl = ch->exp * pl_mult;
	heart_calc(ch, "");
	}
	else if (ch->powerup == 6 && ch->exp > 5000000)
	{
            if( ch->race == race_lookup( "android" ) )
            {
		act( auraColor, "The stench of ozone fills the humming air, a deafening boom blasting from you, as you power up for the last time.", ch, NULL, NULL, TO_CHAR );
		act( auraColor, "The stench of ozone fills the humming air, a deafening boom blasting from $n, as $e powers up for the last time.", ch, NULL, NULL, TO_NOTVICT );
            }
            else
            {
		act( auraColor, "Large chunks of rock crumble all around as you power up for the last time.", ch, NULL, NULL, TO_CHAR );
		act( auraColor, "Large chunks of rock crumble all around as $n powers up for the last time.", ch, NULL, NULL, TO_NOTVICT );
            }
		ch->powerup = 7;
		pl_mult = 1.7;
	if (xIS_SET((ch)->affected_by, AFF_HEART))
		xREMOVE_BIT(ch->affected_by, AFF_HEART);
	ch->pl = ch->exp * pl_mult;
	heart_calc(ch, "");
	}
	else
		send_to_pager_color( "&BYou are already powered up to your max.\n\r", ch );

	return;
}

void show_char_to_char_scan( CHAR_DATA *list, CHAR_DATA *ch, OBJ_DATA *scouter)
{
    CHAR_DATA *rch;
	long double scaned_pl = (long double)0;
        long double scouter_pl = (long double)0;

    for ( rch = list; rch; rch = rch->next_in_room )
    {
	if ( rch == ch )
	    continue;

	if ( IS_NPC(rch) )
		scaned_pl = rch->exp;
	else
		scaned_pl = rch->pl;

	if (ch->race != 4)
	{
                scouter_pl = (long double)(scouter->value[2] * (long double)100);
		if ((long double)scaned_pl > (long double)scouter_pl)
                {
			scaned_pl = -1;
                }
	if ( scaned_pl == -1 )
	{
	    act( AT_GREY, "Your scouter explodes from a very strong power.", ch, NULL, rch, TO_CHAR );
	    act( AT_GREY, "$n's scouter explodes from someones power.", ch, NULL, rch, TO_ROOM );
		obj_from_char( scouter );
    	extract_obj( scouter );
		break;
	}
	}
	if (ch->race == 4)
	{
	if (ch->pl < ch->exp)
	{
		if (scaned_pl > (long double)(ch->exp * (long double)8) )
		{
			return;
		}
	}
	else
	{
		if (scaned_pl > (long double)(ch->pl * (long double)8) )
		{
			return;
		}
	}
	}
	pager_printf_color(ch, "You detect a power level of %s.\n\r", num_punct_ld(scaned_pl) );
    return;
	}
}

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

/*    if( IS_NPC(ch) && is_split(ch) )
    {
        if( !ch->master )
          return;
        if( !can_use_skill( ch->master, number_percent(), gsn_evilboost ))
          return;
    }*/

/*    if( wearing_chip(ch) )
    {
        ch_printf(ch,"You can't while you have a chip installed.\n\r");
        return;
    }*/

    double pl_mult = 0;
    int arg;
    /*int sizeStr=0, sizeSpd=0, sizeCon=0, sizeInt=0;*/

    arg = atoi(argument);

    if (xIS_SET((ch)->affected_by, AFF_EVILBOOST) && (arg == 0))
    {
        send_to_char( "You power down and return to normal.\n\r", ch );
        xREMOVE_BIT((ch)->affected_by, AFF_EVILBOOST);
        transStatRemove(ch);
	if( xIS_SET((ch)->affected_by, AFF_MAKEOSTAR) )
	  ch->pl = ch->exp * 10;
	else
          ch->pl = ch->exp;
	ch->evilmod = 0;
        return;
    }
    else if (!xIS_SET((ch)->affected_by, AFF_EVILBOOST) && arg == 0)
    {
        ch_printf(ch,"You're not in that form, though!\n\r");
        return;
    }

    pl_mult = 6;

    if (arg > pl_mult)
        pl_mult = (int) pl_mult;
    else if (arg < 3)
        pl_mult = 3;
    else
        pl_mult = arg;

    if ( ch->mana < skill_table[gsn_evilboost]->min_mana * pl_mult )
    {
        send_to_char( "You don't have enough energy.\n\r", ch );
        return;
    }
    WAIT_STATE( ch, skill_table[gsn_evilboost]->beats );
    if ( can_use_skill(ch, number_percent(), gsn_evilboost ) )
    {
	act( AT_RED, "You focus your thoughts on all that is evil, vile, and wicked. Yelling out, your body size suddenly increases as your muscles bulge with evil energy.", ch, NULL, NULL, TO_CHAR );
        act( AT_RED, "$n focuses $s thoughts on all that is evil, vile, and wicked. $e yells out, $s body size suddenly increasing as $s muscles bulge with evil energy.", ch, NULL, NULL, TO_NOTVICT );

        xSET_BIT( (ch)->affected_by, AFF_EVILBOOST );

        if( xIS_SET((ch)->affected_by, AFF_EVILOVERLOAD) )
          xREMOVE_BIT((ch)->affected_by, AFF_EVILOVERLOAD);

        if( xIS_SET((ch)->affected_by, AFF_EVILSURGE) )
          xREMOVE_BIT((ch)->affected_by, AFF_EVILSURGE);

	if( xIS_SET((ch)->affected_by, AFF_MAKEOSTAR) )
	  ch->pl = ch->exp * (pl_mult + 10);
	else
          ch->pl = ch->exp * pl_mult;

	ch->evilmod = pl_mult;

        transStatApply(ch, pl_mult, pl_mult/2, pl_mult/2, pl_mult);

        learn_from_success( ch, gsn_evilboost );
    }
    else
    {
        act( AT_SKILL, "You can't draw out enough evil power to transform.", ch, NULL, NULL, TO_CHAR );
        act( AT_SKILL, "$n can't draw out enough evil power to transform.", ch, NULL, NULL, TO_NOTVICT );
        learn_from_failure( ch, gsn_evilboost );
    }

    ch->mana -= skill_table[gsn_evilboost]->min_mana * pl_mult;
    return;
}

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

/*    if( wearing_chip(ch) )
    {
        ch_printf(ch,"You can't while you have a chip installed.\n\r");
        return;
    }*/

/*    if( IS_NPC(ch) && is_split(ch) )
    {
        if( !ch->master )
          return;
        if( !can_use_skill( ch->master, number_percent(), gsn_evilsurge ))
          return;
    }*/

    double pl_mult = 0;
    int arg;
    /*int sizeStr=0, sizeSpd=0, sizeCon=0, sizeInt=0;*/

    arg = atoi(argument);

    if (xIS_SET((ch)->affected_by, AFF_EVILSURGE) && (arg == 0))
    {
        send_to_char( "You power down and return to normal.\n\r", ch );
        xREMOVE_BIT((ch)->affected_by, AFF_EVILSURGE);
        transStatRemove(ch);
        if( xIS_SET((ch)->affected_by, AFF_MAKEOSTAR) )
          ch->pl = ch->exp * 10;
        else
          ch->pl = ch->exp;
        ch->evilmod = 0;
        return;
    }
    else if (!xIS_SET((ch)->affected_by, AFF_EVILSURGE) && arg == 0)
    {
        ch_printf(ch,"You're not in that form, though!\n\r");
        return;
    }

    pl_mult = 14;

    if (arg > pl_mult)
        pl_mult = (int) pl_mult;
    else if (arg < 8)
        pl_mult = 8;
    else
        pl_mult = arg;

    if ( ch->mana < skill_table[gsn_evilsurge]->min_mana * pl_mult )
    {
        send_to_char( "You don't have enough energy.\n\r", ch );
        return;
    }
    WAIT_STATE( ch, skill_table[gsn_evilsurge]->beats );
    if ( can_use_skill(ch, number_percent(), gsn_evilsurge ) )
    {
        act( AT_RED, "You flood your mind with images of unspeakable horrors and atrocities. Screaming out, the ground beneath you trembles and cracks as your body grows larger, your muscles surging with tremendous, evil power.", ch, NULL, NULL, TO_CHAR );
        act( AT_RED, "$n floods $s mind with images of unspeakable horrors and atrocities. Screaming out, the ground beneath $m trembles and cracks as $s body grows larger, $s muscles surging with tremendous, evil power.", ch, NULL, NULL, TO_NOTVICT );

        xSET_BIT( (ch)->affected_by, AFF_EVILSURGE );

	if( xIS_SET((ch)->affected_by, AFF_EVILBOOST) )
	  xREMOVE_BIT((ch)->affected_by, AFF_EVILBOOST);

        if( xIS_SET((ch)->affected_by, AFF_EVILOVERLOAD) )
          xREMOVE_BIT((ch)->affected_by, AFF_EVILOVERLOAD);

        if( xIS_SET((ch)->affected_by, AFF_MAKEOSTAR) )
          ch->pl = ch->exp * (pl_mult + 10);
        else
          ch->pl = ch->exp * pl_mult;

        ch->evilmod = pl_mult;

        transStatApply(ch, pl_mult, pl_mult/2, pl_mult/2, pl_mult);

        learn_from_success( ch, gsn_evilsurge );
    }
    else
    {
        act( AT_SKILL, "You can't draw out enough evil power to transform.", ch, NULL, NULL, TO_CHAR );
        act( AT_SKILL, "$n can't draw out enough evil power to transform.", ch, NULL, NULL, TO_NOTVICT );
        learn_from_failure( ch, gsn_evilsurge );
    }

    ch->mana -= skill_table[gsn_evilsurge]->min_mana * pl_mult;
    return;
}

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

/*    if( IS_NPC(ch) && is_split(ch) )
    {
        if( !ch->master )
          return;
        if( !can_use_skill( ch->master, number_percent(), gsn_eviloverload ))
          return;
    } */

/*    if( wearing_chip(ch) )
    {
        ch_printf(ch,"You can't while you have a chip installed.\n\r");
        return;
    }*/

    double pl_mult = 0;
    int arg;
    /*int sizeStr=0, sizeSpd=0, sizeCon=0, sizeInt=0;*/

    arg = atoi(argument);

    if (xIS_SET((ch)->affected_by, AFF_EVILOVERLOAD) && (arg == 0))
    {
        send_to_char( "You power down and return to normal.\n\r", ch );
        xREMOVE_BIT((ch)->affected_by, AFF_EVILOVERLOAD);
        transStatRemove(ch);
        if( xIS_SET((ch)->affected_by, AFF_MAKEOSTAR) )
          ch->pl = ch->exp * 10;
        else
          ch->pl = ch->exp;
        ch->evilmod = 0;
        return;
    }
    else if (!xIS_SET((ch)->affected_by, AFF_EVILOVERLOAD) && arg == 0)
    {
        ch_printf(ch,"You're not in that form, though!\n\r");
        return;
    }

    pl_mult = 24;

    if (arg > pl_mult)
        pl_mult = (int) pl_mult;
    else if (arg < 18)
        pl_mult = 18;
    else
        pl_mult = arg;

    if ( ch->mana < skill_table[gsn_eviloverload]->min_mana * pl_mult )
    {
        send_to_char( "You don't have enough energy.\n\r", ch );
        return;
    }
    WAIT_STATE( ch, skill_table[gsn_eviloverload]->beats );
    if ( can_use_skill(ch, number_percent(), gsn_eviloverload ) )
    {
        act( AT_RED, "As you overload your mind with countless images of pure evil, your body begins to buckle under the strain of an incredible spike in powerlevel. The very air all around begins to wave under the intensity. Then all at once, your body explodes upward to a size of almost 20 feet; every corner of your being flowing with unspeakably evil power.", ch, NULL, NULL, TO_CHAR );
        act( AT_RED, "As $n overloads $s mind with countless images of pure evil, $s body begins to buckle under the strain of an incredible spike in powerlevel. The very air all around $n to wave under the intensity. Then all at once, $n's body explodes upward to a size of almost 20 feet; every corner of $s being flowing with unspeakably evil power.", ch, NULL, NULL, TO_NOTVICT );

        xSET_BIT( (ch)->affected_by, AFF_EVILOVERLOAD );

        if( xIS_SET((ch)->affected_by, AFF_EVILBOOST) )
          xREMOVE_BIT((ch)->affected_by, AFF_EVILBOOST);

        if( xIS_SET((ch)->affected_by, AFF_EVILSURGE) )
          xREMOVE_BIT((ch)->affected_by, AFF_EVILSURGE);

        if( xIS_SET((ch)->affected_by, AFF_MAKEOSTAR) )
          ch->pl = ch->exp * (pl_mult + 10);
        else
          ch->pl = ch->exp * pl_mult;

        ch->evilmod = pl_mult;

        transStatApply(ch, pl_mult, pl_mult/2, pl_mult/2, pl_mult);

        learn_from_success( ch, gsn_eviloverload );
    }
    else
    {
        act( AT_SKILL, "You can't draw out enough evil power to transform.", ch, NULL, NULL, TO_CHAR );
        act( AT_SKILL, "$n can't draw out enough evil power to transform.", ch, NULL, NULL, TO_NOTVICT );
        learn_from_failure( ch, gsn_eviloverload );
    }

    ch->mana -= skill_table[gsn_eviloverload]->min_mana * pl_mult;
    return;
}

void do_demonweapon(CHAR_DATA *ch, char *argument )
{
    OBJ_DATA *o;
    OBJ_INDEX_DATA *pObjIndex;

    if( IS_NPC(ch) )
          return;

/*    if( wearing_chip(ch) )
    {
        ch_printf(ch,"You can't while you have a chip installed.\n\r");
        return;
    }*/

    if( argument[0] == '\0' )
    {
        ch_printf(ch,"\n\rSyntax: 'Demon weapon' <item>\n\r");
        ch_printf(ch,"\n\r");
        ch_printf(ch,"Item can only be one of the following:\n\r");
        ch_printf(ch,"\n\r");
        ch_printf(ch,"scimitar shortsword longsword broadsword lance maul\n\r");
        return;
    }

    if( !(!str_cmp(argument,"scimitar")) && !(!str_cmp(argument,"shortsword")) &&
        !(!str_cmp(argument,"longsword")) && !(!str_cmp(argument,"broadsword")) &&
        !(!str_cmp(argument,"lance")) && !(!str_cmp(argument,"maul")) )
    {
        do_demonweapon(ch,"");
        return;
    }

    if ( IS_NPC(ch) && IS_AFFECTED( ch, AFF_CHARM ) )
    {
        send_to_char( "You can't concentrate enough for that.\n\r", ch );
        return;
    }
    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_demonweapon]->skill_level[ch->class] )
    {
        send_to_char( "You can't do that.\n\r", ch );
        return;
    }
    if ( ch->mana < ch->max_mana )
    {
        send_to_char( "You don't have enough energy.\n\r", ch );
        return;
    }
    if( ch->hit < 100 )
    {
	ch_printf(ch,"You don't have enough health.\n\r", ch );
	return;
    }
    if( ch->carry_number >= 3 )
    {
        ch_printf(ch,"You haven't got any room.\n\r");
        return;
    }

    WAIT_STATE( ch, skill_table[gsn_demonweapon]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_demonweapon ) )
    {
        int a = 0;
        if( !str_cmp(argument,"scimitar") )
          a = 1260;
        else if( !str_cmp(argument,"shortsword") )
          a = 1261;
        else if( !str_cmp(argument,"longsword") )
          a = 1262;
        else if( !str_cmp(argument,"broadsword") )
          a = 1263;
        else if( !str_cmp(argument,"lance") )
          a = 1264;
        else if( !str_cmp(argument,"maul") )
          a = 1265;
        if( a == 0 )
        {
          bug("Serious problem in function demon weapon",0);
          return;
        }
	if( !str_cmp(argument,"scimitar") )
	{
          act( AT_RED, "You begin to push a tremendous amount of energy into your arms; bloating your muscles up to a very large size. The moment your arms feel like they are going to explode, a twin pair of demon scimitars bursts out of them and into your hands; your arms healing back up almost instantly.", ch, NULL, NULL, TO_CHAR );
          act( AT_RED, "$n begins to push a tremendous amount of energy into $s arms; bloating $s muscles up to a very large size. The moment $s arms look like they are going to explode, a twin pair of demon scimitars bursts out of them and into $s hands; $s arms healing back up almost instantly.", ch, NULL, NULL, TO_NOTVICT );
	}
	if( !str_cmp(argument,"shortsword") ||
	    !str_cmp(argument,"longsword") ||
	    !str_cmp(argument,"broadsword") )
	{
	  act( AT_RED, "The pupils of your eyes suddenly glow bright red as you grab a spike sticking out of your leg in one hand and begin to pull on it. Yelling out, your flesh is torn away as you pull a gleaming demon sword out of your leg. Your leg heals back up almost instantly.", ch, NULL, NULL, TO_CHAR );
	  act( AT_RED, "The pupils of $n's eyes suddenly glow bright red as $e grabs a spike sticking out of $s leg in one hand and begins to pull on it. Yelling out, $s flesh is torn away as $n pulls a gleaming demon sword out of $s leg. $n's leg heals back up almost instantly.", ch, NULL, NULL, TO_NOTVICT );
	}
	if( !str_cmp(argument,"lance") )
	{
	  act( AT_RED, "With a spray of demon blood you rip off your left arm with your right hand. The severed limb begins to bulge as you pump your own energy into it. It starts to stretch out from end to end, when all of a sudden it explodes, turning into a demon lance. Your left arm regenerates almost instantly after.", ch, NULL, NULL, TO_CHAR );
	  act( AT_RED, "With a spray of demon blood $n rips off $s left arm with $s right hand. The severed limb begins to bulge as $n pumps $s own energy into it. It starts to stretch out from end to end, when all of a sudden it explodes, turning into a demon lance. $n's left arm regenerates almost instantly after.", ch, NULL, NULL, TO_NOTVICT );
	}
	if( !str_cmp(argument,"maul") )
	{
	  act( AT_RED, "With a spray of demon blood you rip off your right arm with your left hand. The severed limb begins to bulge as you pump your own energy into it. It starts to stretch out from end to end, when all of a sudden it explodes, turning into a demon maul. Your right arm regenerates almost instantly after.", ch, NULL, NULL, TO_CHAR );
	  act( AT_RED, "With a spray of demon blood $n rips off $s right arm with $s left hand. The severed limb begins to bulge as $n pumps $s own energy into it. It starts to stretch out from end to end, when all of a sudden it explodes, turning into a demon maul. $n's right arm regenerates almost instantly after.", ch, NULL, NULL, TO_NOTVICT );
	}
        learn_from_success( ch, gsn_demonweapon );
        pObjIndex = get_obj_index( a );
        o = create_object_new( pObjIndex, 1 , ORIGIN_OINVOKE, ch->name );
        o = obj_to_char( o, ch );
	ch->hit -= 80;
        save_char_obj( ch );
    }
    else
    {
         act( AT_SKILL, "You fail to use your demon powers to create a weapon.", ch, NULL, NULL, TO_CHAR );
         act( AT_SKILL, "$n fails to use $s demon powers to create a weapon.", ch, NULL, NULL, TO_NOTVICT );
        learn_from_failure( ch, gsn_demonweapon );
    }
    ch->mana = 0;
    return;
}

void do_maliceray(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

/*    if( IS_NPC(ch) && is_split(ch) )
    {
        if( !ch->master )
          return;
        if( !can_use_skill( ch->master, number_percent(), gsn_maliceray ))
          return;
    } */

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

    if ((ch->race == 9)
    &&   (ch->exp < skill_table[gsn_genie_signature]->skill_level[ch->class]) )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }
    else
    {
      if ( (!IS_NPC(ch))
      &&   (ch->exp < skill_table[gsn_maliceray]->skill_level[ch->class]) )
      {
	  send_to_char( "You can't do that.\n\r", ch );
	  return;
      }
    }

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

        if ( ch->mana < skill_table[gsn_maliceray]->min_mana )
        {
            send_to_char( "You don't have enough energy.\n\r", ch );
            return;
        }
        if (ch->focus < skill_table[gsn_maliceray]->focus)
    {
                send_to_char( "You need to focus more.\n\r", ch );
                return;
    }
    else
        ch->focus -= skill_table[gsn_maliceray]->focus;

    WAIT_STATE( ch, skill_table[gsn_maliceray]->beats );
    if (ch->race != 9)
    {
      if ( can_use_skill(ch, number_percent(),gsn_maliceray ) )
      {
        dam = get_attmod(ch, victim) * number_range( 22, 26 );
        if (ch->charge > 0)
                dam = chargeDamMult(ch, dam);

        act( AT_RED, "You aim your right hand at $N, and brace it with your left, quickly charging and firing a shimmering crimson blast of energy at $M. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
        act( AT_RED, "$n aims $s right hand at you, and braces it with $s left, quickly charging and firing a shimmering crimson blast of energy at you. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
        act( AT_RED, "$n aims $s right hand at $N, and braces it with $s left, quickly charging and firing a shimmering crimson blast of energy at $N. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

        dam = ki_absorb( victim, ch, dam, gsn_maliceray );
        learn_from_success( ch, gsn_maliceray );
        global_retcode = damage( ch, victim, dam, TYPE_HIT );
      }
      else
      {
        act( AT_RED, "You missed $N with your malice ray.", ch, NULL, victim, TO_CHAR );
        act( AT_RED, "$n misses you with $s malice ray.", ch, NULL, victim, TO_VICT );
        act( AT_RED, "$n missed $N with a malice ray.", ch, NULL, victim, TO_NOTVICT );
        learn_from_failure( ch, gsn_maliceray );
        global_retcode = damage( ch, victim, 0, TYPE_HIT );
      }
    }
    else
    {
      if ( can_use_skill(ch, number_percent(),gsn_genie_signature ) )
      {
        dam = get_attmod(ch, victim) * number_range( 22, 26 );
        if (ch->charge > 0)
                dam = chargeDamMult(ch, dam);

        act( AT_PINK, "You aim your right hand at $N, and brace it with your left, quickly charging and firing a shimmering crimson blast of energy at $M. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
        act( AT_PINK, "$n aims $s right hand at you, and braces it with $s left, quickly charging and firing a shimmering crimson blast of energy at you. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
        act( AT_PINK, "$n aims $s right hand at $N, and braces it with $s left, quickly charging and firing a shimmering crimson blast of energy at $N. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

        dam = ki_absorb( victim, ch, dam, gsn_maliceray );
        learn_from_success( ch, gsn_genie_signature );
        global_retcode = damage( ch, victim, dam, TYPE_HIT );
      }
      else
      {
        act( AT_PURPLE, "You missed $N with your malice ray.", ch, NULL, victim, TO_CHAR );
        act( AT_PURPLE, "$n misses you with $s malice ray.", ch, NULL, victim, TO_VICT );
        act( AT_PURPLE, "$n missed $N with a malice ray.", ch, NULL, victim, TO_NOTVICT );

        learn_from_failure( ch, gsn_genie_signature );
        global_retcode = damage( ch, victim, 0, TYPE_HIT );
      }
    }

    ch->mana -= skill_table[gsn_maliceray]->min_mana;
    return;
}

void do_cleaver(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

/*    if( IS_NPC(ch) && is_split(ch) )
    {
        if( !ch->master )
          return;
        if( !can_use_skill( ch->master, number_percent(), gsn_cleaver))
          return;
    } */

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

    if ( !IS_NPC(ch) && ch->exp < skill_table[gsn_cleaver]->skill_level[ch->class] )
    {
        send_to_char( "You can't do that.\n\r", ch );
        return;
        }

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

    if ( ch->mana < skill_table[gsn_cleaver]->min_mana )
    {
        send_to_char( "You don't have enough energy.\n\r", ch );
        return;
    }
    if (ch->focus < skill_table[gsn_cleaver]->focus)
    {
                send_to_char( "You need to focus more.\n\r", ch );
                return;
    }
    else
        ch->focus -= skill_table[gsn_cleaver]->focus;

    WAIT_STATE( ch, skill_table[gsn_cleaver]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_cleaver ) )
    {
        switch (number_range(1,100))
        {
    case 100:
        if (IS_NPC(victim) || (!IS_NPC(victim) &&
	   (!xIS_SET(ch->act, PLR_SPAR) || !xIS_SET(ch->act, PLR_SPAR) )))
        {

                /* Redone so that instant death can't be abused to instant kill
                 * players over 2x their power.
                 */
                if (victim->pl / ch->pl >= 2)
                {
                        act( AT_DGREY, "You charge a spinning energy disk above your head and hurl it towards $N.", ch, NULL, victim, TO_CHAR );
                        act( AT_DGREY, "It flies staight towards $N, but its damage is absorbed by $s powerful aura.", ch, NULL, victim, TO_CHAR );
                        act( AT_DGREY, "$n charges a spinning energy disk above $s head and hurls it towards you.", ch, NULL, victim, TO_VICT );
                        act( AT_DGREY, "It flies staight towards you, but its damage is absorbed by your powerful aura.", ch, NULL, victim, TO_VICT );
                        act( AT_DGREY, "$n charges a spinning energy disk above $s head and hurls it towards $N.", ch, NULL, victim, TO_NOTVICT );
                        act( AT_DGREY, "It flies staight towards $N, but its damage is absorbed by $s powerful aura.", ch, NULL, victim, TO_NOTVICT );
                        dam = 0;
                        break;
                }

/* Redone so it _is_ instant death
 *      if (victim->max_hit >= victim->hit)
 *              dam = victim->max_hit * 2;
 *      else
 *              dam = victim->hit * 2;
 */
                dam = 999999999;
        act( AT_DGREY, "You charge a spinning energy disk above your head and hurl it towards $N.", ch, NULL, victim, TO_CHAR );
        act( AT_RED, "IT CUTS STRAIGHT THROUGH $N!!!  Killing $M instantly.", ch, NULL, victim, TO_CHAR );
        act( AT_DGREY, "$n charges a spinning energy disk above $s head and hurls it towards you.", ch, NULL, victim, TO_VICT );
        act( AT_RED, "IT CUTS STRAIGHT THROUGH YOU!!!  Killing you instantly.", ch, NULL, victim, TO_VICT );
        act( AT_DGREY, "$n charges a spinning energy disk above $s head and hurls it towards $N.", ch, NULL, victim, TO_NOTVICT );
        act( AT_RED, "IT CUTS STRAIGHT THROUGH $N!!!  Killing $M instantly.", ch, NULL, victim, TO_NOTVICT );

        learn_from_success( ch, gsn_cleaver );
        global_retcode = damage( ch, victim, dam, TYPE_HIT );
    break;
    }
        default:
        dam = get_attmod(ch, victim) * number_range( 24, 30 );
        if (ch->charge > 0)
                dam = chargeDamMult(ch, dam);
        act( AT_DGREY, "You charge a spinning energy disk above your head and hurl it towards $N. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
        act( AT_DGREY, "$n charges a spinning energy disk above $s head and hurls it towards you. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
        act( AT_DGREY, "$n charges a spinning energy disk above $s head and hurls it towards $N. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

        learn_from_success( ch, gsn_cleaver );
        global_retcode = damage( ch, victim, dam, TYPE_HIT );
    break;
    }
    }
    else
    {
        act( AT_DGREY, "You missed $N with your cleaver.", ch, NULL, victim, TO_CHAR );
        act( AT_DGREY, "$n misses you with $s cleaver.", ch, NULL, victim, TO_VICT );
        act( AT_DGREY, "$n missed $N with a cleaver.", ch, NULL, victim, TO_NOTVICT );
        learn_from_failure( ch, gsn_cleaver );
        global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
        ch->mana -= skill_table[gsn_cleaver]->min_mana;
    return;
}

void do_demonic_eclipse(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

/*    if( IS_NPC(ch) && is_split(ch) )
    {
        if( !ch->master )
          return;
        if( !can_use_skill( ch->master, number_percent(), gsn_demonic_eclipse ))
          return;
    } */

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

    if ((ch->race == 9)
    &&   (ch->exp < skill_table[gsn_genie_finisher]->skill_level[ch->class]) )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }
    else
    {
      if ( (!IS_NPC(ch))
      &&   (ch->exp < skill_table[gsn_demonic_eclipse]->skill_level[ch->class] ))
      {
	  send_to_char( "You can't do that.\n\r", ch );
	  return;
      }
    }

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

        if ( ch->mana < skill_table[gsn_demonic_eclipse]->min_mana )
        {
            send_to_char( "You don't have enough energy.\n\r", ch );
            return;
        }
        if (ch->focus < skill_table[gsn_demonic_eclipse]->focus)
    {
                send_to_char( "You need to focus more.\n\r", ch );
                return;
    }
    else
        ch->focus -= skill_table[gsn_demonic_eclipse]->focus;

    WAIT_STATE( ch, skill_table[gsn_demonic_eclipse]->beats );
    if (ch->race != 9)
    {
      if ( can_use_skill(ch, number_percent(),gsn_demonic_eclipse ) )
      {
        dam = get_attmod(ch, victim) * number_range( 56, 62 );
        if (ch->charge > 0)
                dam = chargeDamMult(ch, dam);

	  act( AT_DGREY, "You clasp your hands together infront of yourself and begin to concentrate an immense amount of evil energy. A mixture of red and black flames begin to radiate slowly from your entire body. After a few moments, you pull your palms away from each other slowly; the energy radiating from you suddenly flows down into the space between your palms as a small, pitch black ball of energy forms, with a corona of dark red.", ch, NULL, victim, TO_CHAR );
	  act( AT_DGREY, "Your eyes turn solid red as you yell out, the ground beneath you shattering and flying into the air, as you hoist the dark energy ball up over your head. 'DEMONIC ECLIPSE!!!' you shout as you throw the blast towards $N with incredible force. The attack quickly swells in size, untill it hits $N. $E is momentarily engulfed by the energy, unspeakably tormented within a torrent of dark energies, before it explodes. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_DGREY, "$n clasps $s hands together infront of $mself and begins to concentrate an immense amount of evil energy. A mixture of red and black flames begin to radiate slowly from $s entire body. After a few moments, $e pull $s palms away from each other slowly; the energy radiating from $n suddenly flows down into the space between $s palms as a small, pitch black ball of energy forms, with a corona of dark red.", ch, NULL, victim, TO_VICT );
	  act( AT_DGREY, "$n's eyes turn solid red as $e yells out, the ground beneath $m shattering and flying into the air, as $e hoists the dark energy ball up over $s head. 'DEMONIC ECLIPSE!!!' $n shouts as $e throws the blast towards you with incredible force. The attack quickly swells in size, untill it hits you. You are momentarily engulfed by the energy, unspeakably tormented within a torrent of dark energies, before it explodes. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_DGREY, "$n clasps $s hands together infront of $mself and begins to concentrate an immense amount of evil energy. A mixture of red and black flames begin to radiate slowly from $s entire body. After a few moments, $e pull $s palms away from each other slowly; the energy radiating from $n suddenly flows down into the space between $s palms as a small, pitch black ball of energy forms, with a corona of dark red.", ch, NULL, victim, TO_NOTVICT );
	  act( AT_DGREY, "$n's eyes turn solid red as $e yells out, the ground beneath $m shattering and flying into the air, as $e hoists the dark energy ball up over $s head. 'DEMONIC ECLIPSE!!!' $n shouts as $e throws the blast towards $N with incredible force. The attack quickly swells in size, untill it hits $N. $E is momentarily engulfed by the energy, unspeakably tormented within a torrent of dark energies, before it explodes. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

        dam = ki_absorb( victim, ch, dam, gsn_demonic_eclipse );
        learn_from_success( ch, gsn_demonic_eclipse );
        global_retcode = damage( ch, victim, dam, TYPE_HIT );
      }
      else
      {
        act( AT_DGREY, "You missed $N with your demonic eclipse.", ch, NULL, victim, TO_CHAR );
        act( AT_DGREY, "$n misses you with $s demonic eclipse.", ch, NULL, victim, TO_VICT );
        act( AT_DGREY, "$n missed $N with a demonic eclipse.", ch, NULL, victim, TO_NOTVICT );
        learn_from_failure( ch, gsn_demonic_eclipse );
        global_retcode = damage( ch, victim, 0, TYPE_HIT );
      }
    }
    else
    {
      if ( can_use_skill(ch, number_percent(),gsn_genie_finisher ) )
      {
        dam = get_attmod(ch, victim) * number_range( 56, 62 );
        if (ch->charge > 0)
                dam = chargeDamMult(ch, dam);

	  act( AT_PINK, "You clasp your hands together infront of yourself and begin to concentrate an immense amount of evil energy. A mixture of red and black flames begin to radiate slowly from your entire body. After a few moments, you pull your palms away from each other slowly; the energy radiating from you suddenly flows down into the space between your palms as a small, pitch black ball of energy forms, with a corona of dark red.", ch, NULL, victim, TO_CHAR );
	  act( AT_PINK, "Your eyes turn solid red as you yell out, the ground beneath you shattering and flying into the air, as you hoist the dark energy ball up over your head. 'DEMONIC ECLIPSE!!!' you shout as you throw the blast towards $N with incredible force. The attack quickly swells in size, untill it hits $N. $E is momentarily engulfed by the energy, unspeakably tormented within a torrent of dark energies, before it explodes. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_PINK, "$n clasps $s hands together infront of $mself and begins to concentrate an immense amount of evil energy. A mixture of red and black flames begin to radiate slowly from $s entire body. After a few moments, $e pull $s palms away from each other slowly; the energy radiating from $n suddenly flows down into the space between $s palms as a small, pitch black ball of energy forms, with a corona of dark red.", ch, NULL, victim, TO_VICT );
	  act( AT_PINK, "$n's eyes turn solid red as $e yells out, the ground beneath $m shattering and flying into the air, as $e hoists the dark energy ball up over $s head. 'DEMONIC ECLIPSE!!!' $n shouts as $e throws the blast towards you with incredible force. The attack quickly swells in size, untill it hits you. You are momentarily engulfed by the energy, unspeakably tormented within a torrent of dark energies, before it explodes. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_PINK, "$n clasps $s hands together infront of $mself and begins to concentrate an immense amount of evil energy. A mixture of red and black flames begin to radiate slowly from $s entire body. After a few moments, $e pull $s palms away from each other slowly; the energy radiating from $n suddenly flows down into the space between $s palms as a small, pitch black ball of energy forms, with a corona of dark red.", ch, NULL, victim, TO_NOTVICT );
	  act( AT_PINK, "$n's eyes turn solid red as $e yells out, the ground beneath $m shattering and flying into the air, as $e hoists the dark energy ball up over $s head. 'DEMONIC ECLIPSE!!!' $n shouts as $e throws the blast towards $N with incredible force. The attack quickly swells in size, untill it hits $N. $E is momentarily engulfed by the energy, unspeakably tormented within a torrent of dark energies, before it explodes. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

        dam = ki_absorb( victim, ch, dam, gsn_demonic_eclipse );
        learn_from_success( ch, gsn_genie_finisher );
        global_retcode = damage( ch, victim, dam, TYPE_HIT );
      }
      else
      {
        act( AT_PURPLE, "You missed $N with your demonic eclipse.", ch, NULL, victim, TO_CHAR );
        act( AT_PURPLE, "$n misses you with $s demonic eclipse.", ch, NULL, victim, TO_VICT );
        act( AT_PURPLE, "$n missed $N with a demonic eclipse.", ch, NULL, victim, TO_NOTVICT );
        learn_from_failure( ch, gsn_genie_finisher );
        global_retcode = damage( ch, victim, 0, TYPE_HIT );
      }
    }

    ch->mana -= skill_table[gsn_demonic_eclipse]->min_mana;
    return;
}

void do_scan( CHAR_DATA *ch, char *argument )
{
    ROOM_INDEX_DATA *was_in_room;
    EXIT_DATA *pexit;
    sh_int dir = -1;
    sh_int dist;
    sh_int max_dist = 0;
	OBJ_DATA *scouter = NULL;
	CHAR_DATA *victim = NULL;
	long double scaned_pl;
        long double scouter_pl;
    bool HBTCset = FALSE;

    set_char_color( AT_ACTION, ch );

    if ( IS_AFFECTED( ch, AFF_BLIND ) )
    {
	send_to_char( "Not very effective when you're blind...\n\r", ch );
	return;
    }

	if ( ch->race != 4 && (scouter = has_scouter(ch)) == NULL )
	{
	send_to_char( "You need a scouter to do that.\n\r", ch );
	return;
    }

    if ( argument[0] == '\0' )
    {
	send_to_char( "You must scan in a direction or focus on a person.\n\r", ch );
	return;
    }

    if ( ( dir = get_door( argument ) ) == -1
    	&& (victim = get_char_room( ch, argument )) == NULL)
    {
	send_to_char( "Scan what?\n\r", ch );
	return;
    }

	if (IS_IMMORTAL(ch))
	{
		send_to_char("You shouldn't be scanning mortals.\n\r",ch);
		return;
	}

	if ( victim )
	{
	    act( AT_GREY, "You scan $N with your scouter.", ch, NULL, victim, TO_CHAR );
	    act( AT_GREY, "$n scans you with $s scouter.", ch, NULL, victim, TO_VICT );
	    act( AT_GREY, "$n scans $N with $s scouter.", ch, NULL, victim, TO_NOTVICT );
		if ( IS_NPC(victim) )
			scaned_pl = victim->exp;
		else
			scaned_pl = victim->pl;

	if (ch->race != 4)
	{
                scouter_pl = (long double)(scouter->value[2] * 100);
		if ((long double)scaned_pl > (long double)scouter_pl)
                {
			scaned_pl = -1;
                }
	}
	if ( scaned_pl == -1 ) {
	    act( AT_GREY, "Your scouter explodes from $N's power.", ch, NULL, victim, TO_CHAR );
	    act( AT_GREY, "$n's scouter explodes from your power.", ch, NULL, victim, TO_VICT );
	    act( AT_GREY, "$n's scouter explodes from $N's power.", ch, NULL, victim, TO_NOTVICT );
		obj_from_char( scouter );
	    extract_obj( scouter );
		return;
	}
	if (ch->race == 4)
	{
		if (ch->pl < ch->exp)
		{
			if (scaned_pl > ch->exp * 8)
			{
				pager_printf_color(ch, "You don't want your head to explode do you?");
				return;
			}
		}
		else
		{
			if (scaned_pl > ch->pl * 8)
			{
				pager_printf_color(ch, "You don't want your head to explode do you?");
				return;
			}
		}
	}
	if (IS_NPC(victim))
	pager_printf_color(ch, "%s's power level is %s.", victim->short_descr, num_punct_ld(scaned_pl) );
	else
	pager_printf_color(ch, "%s's power level is %s.", victim->name, num_punct_ld(scaned_pl) );
	return;
	}

    if( !IS_NPC( ch ) && ch->pcdata->nextHBTCDate != 0 )
    {
      HBTCset = TRUE;
    }

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

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

	if (scouter)
		max_dist = scouter->value[2]/10000;
	else
		max_dist = ch->exp/100000;

	if (max_dist > 15)
		max_dist = 15;

    for ( dist = 1; dist <= max_dist; )
    {

	char_from_room( ch );
	char_to_room( ch, pexit->to_room );
	set_char_color( AT_RMNAME, ch );
	send_to_char( ch->in_room->name, ch );
	send_to_char( "\n\r", ch );
	show_char_to_char_scan( ch->in_room->first_person, ch, scouter);
	if ( !has_scouter(ch) )
		break;

	switch( ch->in_room->sector_type )
	{
	    default: dist++; break;
	    case SECT_AIR:
		if ( number_percent() < 80 ) dist++; break;
	    case SECT_INSIDE:
	    case SECT_FIELD:
	    case SECT_UNDERGROUND:
		dist++; break;
	    case SECT_FOREST:
	    case SECT_CITY:
	    case SECT_DESERT:
	    case SECT_HILLS:
		dist += 2; break;
	    case SECT_WATER_SWIM:
	    case SECT_WATER_NOSWIM:
		dist += 3; break;
	    case SECT_MOUNTAIN:
	    case SECT_UNDERWATER:
	    case SECT_OCEANFLOOR:
		dist += 4; break;
	}

	if ( dist >= max_dist )
	{
	    act( AT_GREY, "There is to much interference to scan farther $t.", ch, dir_name[dir], NULL, TO_CHAR );
	    break;
	}
	if ( ( pexit = get_exit( ch->in_room, dir ) ) == NULL )
	{
	    act( AT_GREY, "Your scans $t are being blocked by an unknown force...", ch,
		dir_name[dir], NULL, TO_CHAR );
	    break;
	}
    }

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

    if( HBTCset == FALSE )
    {
      ch->pcdata->nextHBTCDate = 0;
    }
    return;
}
/*
 * Check for parry.
 */
bool check_parry( CHAR_DATA *ch, CHAR_DATA *victim )
{
    int chances = 0;

	return FALSE;

    if ( !IS_AWAKE(victim) )
	return FALSE;

    if ( xIS_SET( victim->affected_by, AFF_TIMESTOP ) )
	return FALSE;

    if ( IS_NPC(victim) && !xIS_SET(victim->defenses, DFND_PARRY) )
      return FALSE;

	if (IS_NPC(victim) && IS_NPC(ch))
		chances = victim->exp / ch->exp;
	if (IS_NPC(victim) && !IS_NPC(ch))
		chances = victim->exp / ch->pl;
	if (!IS_NPC(victim) && IS_NPC(ch))
		chances = victim->pl / ch->exp;
	if (!IS_NPC(victim) && !IS_NPC(ch))
		chances = victim->pl / ch->pl;

	chances += get_curr_int(victim) - 5;

    /* Put in the call to chance() to allow penalties for misaligned
       clannies.  */
    if ( chances != 0 && victim->morph )
	chances+=victim->morph->parry;

     if ( IS_NPC(victim) && IS_NPC(ch)
    	&&!chance( victim, chances + (victim->exp / ch->exp) ) )
   	{
	learn_from_failure( victim, gsn_dodge );
   	    return FALSE;
    }
    if ( IS_NPC(victim) && !IS_NPC(ch)
    	&&!chance( victim, chances + (victim->exp / ch->pl) ) )
   	{
	learn_from_failure( victim, gsn_dodge );
   	    return FALSE;
    }
    if ( !IS_NPC(victim) && IS_NPC(ch)
    	&&!chance( victim, chances + (victim->pl / ch->exp) ) )
   	{
	learn_from_failure( victim, gsn_dodge );
   	    return FALSE;
    }
    if ( !IS_NPC(victim) && !IS_NPC(ch)
    	&&!chance( victim, chances + (victim->pl / ch->pl) ) )
   	{
	learn_from_failure( victim, gsn_dodge );
   	    return FALSE;
    }

    if ( !IS_NPC(victim)
         && !IS_SET( victim->pcdata->flags, PCFLAG_GAG) ) /*SB*/
    act( AT_SKILL, "You anticipate $n's attack and block it.",  ch, NULL, victim, TO_VICT    );

    if ( !IS_NPC(ch)
         && !IS_SET( ch->pcdata->flags, PCFLAG_GAG) )  /* SB */
    act( AT_SKILL, "$N anticipates your attack and blocks it.", ch, NULL, victim, TO_CHAR    );

    learn_from_success( victim, gsn_parry );
    return TRUE;
}



/*
 * Check for dodge.
 */
bool check_dodge( CHAR_DATA *ch, CHAR_DATA *victim )
{
    int chances = 0;

	return FALSE;

    if ( !IS_AWAKE(victim) )
	return FALSE;

    if ( xIS_SET( victim->affected_by, AFF_TIMESTOP ) )
	return FALSE;

    if ( IS_NPC(victim) && !xIS_SET(victim->defenses, DFND_DODGE) )
      return FALSE;

	if (IS_NPC(victim) && IS_NPC(ch))
		chances = victim->exp / ch->exp;
	if (IS_NPC(victim) && !IS_NPC(ch))
		chances = victim->exp / ch->pl;
	if (!IS_NPC(victim) && !IS_NPC(ch))
		chances = victim->pl / ch->exp;
	if (!IS_NPC(victim) && !IS_NPC(ch))
		chances = victim->pl / ch->pl;

	chances += get_curr_dex(victim) - 5;

    if ( chances != 0 && victim->morph != NULL )
	chances+=victim->morph->dodge;

    /* Consider luck as a factor */
    if ( IS_NPC(victim) && IS_NPC(ch)
    	&&!chance( victim, chances + (victim->exp / ch->exp) ) )
   	{
	learn_from_failure( victim, gsn_dodge );
   	    return FALSE;
    }
    if ( IS_NPC(victim) && !IS_NPC(ch)
    	&&!chance( victim, chances + (victim->exp / ch->pl) ) )
   	{
	learn_from_failure( victim, gsn_dodge );
   	    return FALSE;
    }
    if ( !IS_NPC(victim) && IS_NPC(ch)
    	&&!chance( victim, chances + (victim->pl / ch->exp) ) )
   	{
	learn_from_failure( victim, gsn_dodge );
   	    return FALSE;
    }
    if ( !IS_NPC(victim) && !IS_NPC(ch)
    	&&!chance( victim, chances + (victim->pl / ch->pl) ) )
   	{
	learn_from_failure( victim, gsn_dodge );
   	    return FALSE;
    }

    if ( !IS_NPC(victim) && !IS_SET( victim->pcdata->flags, PCFLAG_GAG) )
    act( AT_SKILL, "You dodge $n's attack.", ch, NULL, victim, TO_VICT    );

    if ( !IS_NPC(ch) && !IS_SET( ch->pcdata->flags, PCFLAG_GAG) )
    act( AT_SKILL, "$N dodges your attack.", ch, NULL, victim, TO_CHAR    );

    learn_from_success( victim, gsn_dodge );
    return TRUE;
}

bool check_tumble( CHAR_DATA *ch, CHAR_DATA *victim )
{
      return FALSE;

/*
    int chances;

    if ( victim->class != CLASS_THIEF || !IS_AWAKE( victim ) )
      return FALSE;
    if ( !IS_NPC( victim )
    &&   !victim->pcdata->learned[gsn_tumble] > 0 )
      return FALSE;
    if ( IS_NPC( victim ) )
      chances = UMIN( 60, 2 * victim->level );
    else
      chances = (int) ( LEARNED(victim, gsn_tumble) / sysdata.tumble_mod
			+ ( get_curr_dex( victim ) - 13 ) );
    if ( chances != 0 && victim->morph )
      chances+=victim->morph->tumble;
    if ( !chance( victim, chances + victim->level - ch->level ) )
      return FALSE;
    if ( !IS_NPC(victim) && !IS_SET( victim->pcdata->flags, PCFLAG_GAG ) )
      act( AT_SKILL, "You tumble away from $n's attack.", ch, NULL, victim, TO_VICT );
    if ( !IS_NPC(ch) && !IS_SET( ch->pcdata->flags, PCFLAG_GAG ) )
      act( AT_SKILL, "$N tumbles away from your attack.", ch, NULL, victim, TO_CHAR );
    learn_from_success( victim, gsn_tumble );

    return TRUE;
*/
}

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

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

    if ( !IS_NPC(ch)
    &&   ch->level < skill_table[gsn_tail]->skill_level[ch->class] )
    {
	send_to_char(
	    "That isn't quite one of your natural skills.\n\r", ch );
	return;
    }

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

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

void do_rescue( CHAR_DATA *ch, char *argument )
{
    char arg[MAX_INPUT_LENGTH];
    CHAR_DATA *victim;
    CHAR_DATA *fch;
    int percent;

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

    if ( IS_AFFECTED( ch, AFF_BERSERK ) )
    {
	send_to_char( "You aren't thinking clearly...\n\r", ch );
	return;
    }

    one_argument( argument, arg );
    if ( arg[0] == '\0' )
    {
	send_to_char( "Rescue whom?\n\r", ch );
	return;
    }

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

    if ( victim == ch )
    {
	send_to_char( "How about fleeing instead?\n\r", ch );
	return;
    }

    if ( ch->mount )
    {
	send_to_char( "You can't do that while mounted.\n\r", ch );
	return;
    }

    if ( !IS_NPC(ch) && IS_NPC(victim) )
    {
	send_to_char( "They don't need your help!\n\r", ch );
	return;
    }

    if ( !ch->fighting )
    {
	send_to_char( "Too late...\n\r", ch );
	return;
    }

    if ( ( fch = who_fighting( victim) ) == NULL )
    {
	send_to_char( "They are not fighting right now.\n\r", ch );
	return;
    }

    if ( who_fighting( victim ) == ch )
    {
	send_to_char( "Just running away would be better...\n\r", ch );
	return;
    }

    if ( IS_AFFECTED( victim, AFF_BERSERK ) )
    {
	send_to_char( "Stepping in front of a berserker would not be an intelligent decision.\n\r", ch );
	return;
    }

    percent = number_percent( ) - (get_curr_lck(ch) - 14)
	      - (get_curr_lck(victim) - 16);

    WAIT_STATE( ch, skill_table[gsn_rescue]->beats );
    if (!can_use_skill( ch, percent, gsn_rescue ) )
    {
	send_to_char( "You fail the rescue.\n\r", ch );
	act( AT_SKILL, "$n tries to rescue you!", ch, NULL, victim, TO_VICT   );
	act( AT_SKILL, "$n tries to rescue $N!", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_rescue );
	return;
    }

    act( AT_SKILL, "You rescue $N!",  ch, NULL, victim, TO_CHAR    );
    act( AT_SKILL, "$n rescues you!", ch, NULL, victim, TO_VICT    );
    act( AT_SKILL, "$n moves in front of $N!",  ch, NULL, victim, TO_NOTVICT );

    learn_from_success( ch, gsn_rescue );
    adjust_favor( ch, 8, 1 );
    stop_fighting( fch, FALSE );
    stop_fighting( victim, FALSE );
    if ( ch->fighting )
      stop_fighting( ch, FALSE );

    set_fighting( ch, fch );
    set_fighting( fch, ch );
    return;
}

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

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_kick]->skill_level[ch->class] )
    {
	send_to_char(
	    "You better leave the martial arts to fighters.\n\r", ch );
	return;
    }

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

	if ( ch->mana < skill_table[gsn_kick]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}

	if (ch->focus < skill_table[gsn_kick]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_kick]->focus;

    WAIT_STATE( ch, skill_table[gsn_kick]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_kick ) )
    {
	learn_from_success( ch, gsn_kick );
	global_retcode = damage( ch, victim, (get_attmod(ch, victim) * number_range( 2, 4 )), gsn_kick );
    }
    else
    {
	learn_from_failure( ch, gsn_kick );
	global_retcode = damage( ch, victim, 0, gsn_kick );
    }
	ch->mana -= skill_table[gsn_kick]->min_mana;
    return;
}

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

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_punch]->skill_level[ch->class] )
    {
	send_to_char(
	    "You better leave the martial arts to fighters.\n\r", ch );
	return;
    }

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

	if ( ch->mana < skill_table[gsn_punch]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}

	if (ch->focus < skill_table[gsn_punch]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_punch]->focus;

    WAIT_STATE( ch, skill_table[gsn_punch]->beats );
    if ( can_use_skill( ch, number_percent(), gsn_punch ) )
    {
	learn_from_success( ch, gsn_punch );
	global_retcode = damage( ch, victim, (get_attmod(ch,victim) * number_range( 1, 3 )), gsn_punch );
    }
    else
    {
	learn_from_failure( ch, gsn_punch );
	global_retcode = damage( ch, victim, 0, gsn_punch );
    }
	ch->mana -= skill_table[gsn_punch]->min_mana;
    return;
}

void do_kaioken( CHAR_DATA *ch, char *argument )
{
   int arg = 1;
   int max = 0;
   int strMod=0, spdMod=0, intMod=0, conMod=0;
   char buf[MAX_STRING_LENGTH];

	arg = atoi(argument);

	if (xIS_SET((ch)->affected_by, AFF_SSJ)
		|| xIS_SET((ch)->affected_by, AFF_SSJ2)
		|| xIS_SET((ch)->affected_by, AFF_SSJ3)
		|| xIS_SET((ch)->affected_by, AFF_SSJ4))
	    {
		send_to_char( "You can't use kaioken if you are a Super Saiyan.\n\r", ch );
		return;
		}

	if (xIS_SET((ch)->affected_by, AFF_OOZARU))
	    {
		send_to_char( "You can't use kaioken while you are an Oozaru.\n\r", ch );
		return;
		}

	if (xIS_SET((ch)->affected_by, AFF_EXTREME))
    {
		send_to_char( "You can't use kaioken while using the 'Extreme Technique'.\n\r", ch );
		return;
	}

	if (xIS_SET((ch)->affected_by, AFF_HYPER))
	    {
		send_to_char( "You can't use kaioken while you are using the Hyper technique.\n\r", ch );
		return;
    	}

        transStatRemove(ch);
	if (xIS_SET((ch)->affected_by, AFF_KAIOKEN))
    {
		send_to_char( "You power down and return to normal.\n\r", ch );
		xREMOVE_BIT((ch)->affected_by, AFF_KAIOKEN);
		if (xIS_SET((ch)->affected_by, AFF_HEART))
			xREMOVE_BIT(ch->affected_by, AFF_HEART);
		ch->pl = ch->exp;
		heart_calc(ch, "");
		return;
   	}

	if (arg <= 1) {
		act( AT_SKILL, "Isn't it kind of pointless to do Kaioken times 1?", ch, NULL, NULL, TO_CHAR );
		return;
	}

	max = (ch->exp / 1000000) + 3;

	if (arg > max) {
		act( AT_SKILL, "Your body can't sustain that level of Kaioken.", ch, NULL, NULL, TO_CHAR );
		return;
	}

	if (arg > 10) {
		act( AT_SKILL, "Kaioken can't go beyond 10 times.", ch, NULL, NULL, TO_CHAR );
		return;
	}

    WAIT_STATE( ch, skill_table[gsn_kaioken]->beats );

	if ( can_use_skill(ch, number_percent(), gsn_kaioken ) )
	{
	sprintf( buf, "Bright red flames erupt around you as you yell out KAIOKEN TIMES %d!!!", arg );
	act( AT_FIRE, buf, ch, NULL, NULL, TO_CHAR );
	sprintf( buf, "Bright red flames erupt around %s as $e yells out KAIOKEN TIMES %d!!!", ch->name, arg );
	act( AT_FIRE, buf, ch, NULL, NULL, TO_NOTVICT );
	xSET_BIT( (ch)->affected_by, AFF_KAIOKEN );
	if (xIS_SET((ch)->affected_by, AFF_HEART))
		xREMOVE_BIT(ch->affected_by, AFF_HEART);
	ch->pl = ch->exp * arg;
	heart_calc(ch, "");
	learn_from_success( ch, gsn_kaioken );
        switch( arg )
        {
          case 2:
            strMod = 4;
            spdMod = 6;
            intMod = 0;
            conMod = -1;
          break;
          case 3:
            strMod = 6;
            spdMod = 8;
            intMod = 0;
            conMod = -2;
          break;
          case 4:
            strMod = 8;
            spdMod = 11;
            intMod = 1;
            conMod = -3;
          break;
          case 5:
            strMod = 10;
            spdMod = 13;
            intMod = 1;
            conMod = -3;
          break;
          case 6:
            strMod = 12;
            spdMod = 16;
            intMod = 2;
            conMod = -4;
          break;
          case 7:
            strMod = 14;
            spdMod = 18;
            intMod = 2;
            conMod = -4;
          break;
          case 8:
            strMod = 16;
            spdMod = 20;
            intMod = 3;
            conMod = -5;
          break;
          case 9:
            strMod = 18;
            spdMod = 22;
            intMod = 3;
            conMod = -5;
          break;
          case 10:
            strMod = 20;
            spdMod = 24;
            intMod = 4;
            conMod = -6;
          break;
        }
	transStatApply(ch, strMod, spdMod, intMod, conMod);
    }
	else
	{
	sprintf( buf, "You yell out KAIOKEN TIMES %d!!!  Red flames flicker around your body, but quickly fade away.", arg );
	act( AT_FIRE, buf, ch, NULL, NULL, TO_CHAR );
	sprintf( buf, "%s yells out KAIOKEN TIMES %d!!!  Red flames flicker around $s body, but quickly fade away.", ch->name, arg );
	act( AT_FIRE, buf, ch, NULL, NULL, TO_NOTVICT );
	learn_from_failure( ch, gsn_kaioken );
    }

	return;


}

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

	if (xIS_SET((ch)->affected_by, AFF_KAIOKEN))
    {
		send_to_char( "You can't transform in to a super saiyan while using kaioken.\n\r", ch );
		return;
	}
	if (xIS_SET((ch)->affected_by, AFF_SSJ)
		|| xIS_SET((ch)->affected_by, AFF_SSJ2)
		|| xIS_SET((ch)->affected_by, AFF_SSJ3)
		|| xIS_SET((ch)->affected_by, AFF_SSJ4))
	    {
		send_to_char( "You power down and return to normal.\n\r", ch );
	if (xIS_SET((ch)->affected_by, AFF_USSJ))
		xREMOVE_BIT((ch)->affected_by, AFF_USSJ);
	if (xIS_SET((ch)->affected_by, AFF_USSJ2))
		xREMOVE_BIT((ch)->affected_by, AFF_USSJ2);
	if (xIS_SET((ch)->affected_by, AFF_SSJ))
		xREMOVE_BIT((ch)->affected_by, AFF_SSJ);
	if (xIS_SET((ch)->affected_by, AFF_SSJ2))
		xREMOVE_BIT((ch)->affected_by, AFF_SSJ2);
	if (xIS_SET((ch)->affected_by, AFF_SSJ3))
		xREMOVE_BIT((ch)->affected_by, AFF_SSJ3);
	if (xIS_SET((ch)->affected_by, AFF_SSJ4))
		xREMOVE_BIT((ch)->affected_by, AFF_SSJ4);
		ch->pl = ch->exp;
		transStatRemove(ch);
                if( !IS_NPC( ch ) )
                {
                  ch->pcdata->haircolor = ch->pcdata->orignalhaircolor;
                  ch->pcdata->eyes      = ch->pcdata->orignaleyes;
                }
		return;
    	}

	if (xIS_SET((ch)->affected_by, AFF_OOZARU))
	    {
		send_to_char( "You can't transform while you are an Oozaru.\n\r", ch );
		return;
		}

	if ( ch->mana < skill_table[gsn_ssj]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}

    WAIT_STATE( ch, skill_table[gsn_ssj]->beats );
   if ( can_use_skill(ch, number_percent(), gsn_ssj ) )
	{
	act( AT_YELLOW, "Your hair flashes blonde and your eyes turn blue as a fiery aura erupts around you.", ch, NULL, NULL, TO_CHAR );
	act( AT_YELLOW, "$n's hair flashes blonde and $s eyes turn blue as a fiery aura erupts around $m.", ch, NULL, NULL, TO_NOTVICT );
	xSET_BIT( (ch)->affected_by, AFF_SSJ );
	ch->pl = ch->exp * 10;
	transStatApply(ch, 10, 5, 3, 5);
	learn_from_success( ch, gsn_ssj );
        if( !IS_NPC( ch ) )
        {
          ch->pcdata->eyes      = 0;
          ch->pcdata->haircolor = 3;
        }
    }
	else
	{
	switch (number_range(1, 3))
	{
		default:
		act( AT_BLUE, "Your hair flashes blonde, but quickly returns to normal.", ch, NULL, NULL, TO_CHAR );
		act( AT_BLUE, "$n's hair flashes blonde, but quickly returns to normal.", ch, NULL, NULL, TO_NOTVICT );
		break;
		case 1:
		act( AT_BLUE, "Your hair flashes blonde, but quickly returns to normal.", ch, NULL, NULL, TO_CHAR );
		act( AT_BLUE, "$n's hair flashes blonde, but quickly returns to normal.", ch, NULL, NULL, TO_NOTVICT );
		break;
		case 2:
		act( AT_BLUE, "You, a super Saiyan?  I don't think so.", ch, NULL, NULL, TO_CHAR );
		break;
		case 3:
		act( AT_BLUE, "You almost pop a vein trying to transform in to a super Saiyan.", ch, NULL, NULL, TO_CHAR );
		act( AT_BLUE, "$n almost pops a vein trying to transform in to a super Saiyan", ch, NULL, NULL, TO_NOTVICT );
		break;
	}
	learn_from_failure( ch, gsn_ssj );
    }

	ch->mana -= skill_table[gsn_ssj]->min_mana;
	return;
}

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

	if (xIS_SET((ch)->affected_by, AFF_KAIOKEN))
    {
		send_to_char( "You can't transform in to a super saiyan while using kaioken.\n\r", ch );
		return;
	}

        if( xIS_SET( (ch)->affected_by, AFF_USSJ )
         || xIS_SET( (ch)->affected_by, AFF_USSJ2 ) )
        {
          send_to_char( "You have to power out of USSJ to do this.\n\r", ch );
          return;
        }
	if (xIS_SET((ch)->affected_by, AFF_SSJ2))
	    {
		send_to_char( "You power down to super Saiyan 1.\n\r", ch );
		xREMOVE_BIT((ch)->affected_by, AFF_SSJ2);

                if( xIS_SET((ch)->affected_by, AFF_SSJ3) )
                {
                  xREMOVE_BIT( (ch)->affected_by, AFF_SSJ3 );
                }
                if( xIS_SET((ch)->affected_by, AFF_SSJ4) )
                {
                  xREMOVE_BIT( (ch)->affected_by, AFF_SSJ4 );
                }

		ch->pl = ch->exp * 10;
		transStatApply(ch, 10, 5, 3, 5);
                if( !IS_NPC( ch ) )
                {
                  ch->pcdata->eyes      = 0;
                  ch->pcdata->haircolor = 3;
                }
		return;
    	}

	if (xIS_SET((ch)->affected_by, AFF_OOZARU))
	{
		send_to_char( "You can't transform while you are an Oozaru.\n\r", ch );
		return;
	}

	if (!xIS_SET((ch)->affected_by, AFF_SSJ))
	{
		if ( ch->mana < skill_table[gsn_ssj2]->min_mana * 1.5)
		{
			send_to_char( "You don't have enough energy.\n\r", ch );
			return;
		}

		WAIT_STATE( ch, skill_table[gsn_ssj2]->beats );
		if ( can_use_skill(ch, number_percent(), gsn_ssj2 ) )
			{
			act( AT_YELLOW, "Your hair flashes blonde, standing up in a mass of spikes. "
				"Your eyes turn blue as a fiery aura bursts into existence around you, "
				"quickly becoming charged with sheets of electricity.", ch, NULL, NULL, TO_CHAR );
			act( AT_YELLOW, "$n's hair flashes blonde, standing up in a mass of spikes. "
				"$n's eyes turn blue as a fiery aura bursts into existence around $m, "
				"quickly becoming charged with sheets of electricity.", ch, NULL, NULL, TO_NOTVICT );
			xSET_BIT( (ch)->affected_by, AFF_SSJ );
			xSET_BIT( (ch)->affected_by, AFF_SSJ2 );
			ch->pl = ch->exp * 16;
			transStatApply(ch, 16, 8, 4, 8);
			learn_from_success( ch, gsn_ssj2 );
			if( !IS_NPC( ch ) )
			{
				ch->pcdata->eyes      = 0;
				ch->pcdata->haircolor = 3;
			}
	    }
		else
		{
		switch (number_range(1, 2))
		{
			default:
			act( AT_BLUE, "Electricity begins arcing around your body, but it quickly disappears.", ch, NULL, NULL, TO_CHAR );
			act( AT_BLUE, "Electricity begins arcing around $n's body, but it quickly disappears.", ch, NULL, NULL, TO_NOTVICT );
			break;
			case 1:
			act( AT_BLUE, "Your hair flashes blonde and starts to spike up, but quickly returns to normal.", ch, NULL, NULL, TO_CHAR );
			act( AT_BLUE, "$n's hair flashes blonde and starts to spike up, but quickly returns to normal.", ch, NULL, NULL, TO_NOTVICT );
			break;
			case 2:
			act( AT_BLUE, "You almost pop a vein trying to transform in to a super saiyan 2.", ch, NULL, NULL, TO_CHAR );
			act( AT_BLUE, "$n almost pops a vein trying to transform in to a super saiyan 2.", ch, NULL, NULL, TO_NOTVICT );
			break;
		}
		learn_from_failure( ch, gsn_ssj2 );
		}

		ch->mana -= skill_table[gsn_ssj2]->min_mana * 1.5;
		return;
	}

	if ( ch->mana < skill_table[gsn_ssj2]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
    WAIT_STATE( ch, skill_table[gsn_ssj2]->beats );
   if ( can_use_skill(ch, number_percent(), gsn_ssj2 ) )
	{
//	act( AT_YELLOW, "Your hair flies back and electricity arcs around you as your aura flares brightly.", ch, NULL, NULL, TO_CHAR );
//	act( AT_YELLOW, "$n's hair flies back and electricity arcs around $m as $s aura flares brightly.", ch, NULL, NULL, TO_NOTVICT );
	act( AT_YELLOW, "Your hair straightens and stands more on end, your aura flaring as "
                        "electricity arcs around you.", ch, NULL, NULL, TO_CHAR );
	act( AT_YELLOW, "$n's hair straightens and stands more on end, $s aura flaring as "
                        "electricity arcs around $m.", ch, NULL, NULL, TO_NOTVICT );
	xSET_BIT( (ch)->affected_by, AFF_SSJ2 );
	ch->pl = ch->exp * 16;
	transStatApply(ch, 16, 8, 4, 8);
	learn_from_success( ch, gsn_ssj2 );
        if( !IS_NPC( ch ) )
        {
          ch->pcdata->eyes      = 0;
          ch->pcdata->haircolor = 3;
        }
    }
	else
	{
	switch (number_range(1, 2))
	{
		default:
		act( AT_BLUE, "Electricity begins arcing around your body, but it quickly disappears.", ch, NULL, NULL, TO_CHAR );
		act( AT_BLUE, "Electricity begins arcing around $n's body, but it quickly disappears.", ch, NULL, NULL, TO_NOTVICT );
		break;
		case 1:
		act( AT_BLUE, "Electricity begins arcing around your body, but it quickly disappears.", ch, NULL, NULL, TO_CHAR );
		act( AT_BLUE, "Electricity begins arcing around $n's body, but it quickly disappears.", ch, NULL, NULL, TO_NOTVICT );
		break;
		case 2:
		act( AT_BLUE, "You almost pop a vein trying to transform in to a super Saiyan 2.", ch, NULL, NULL, TO_CHAR );
		act( AT_BLUE, "$n almost pops a vein trying to transform in to a super Saiyan 2.", ch, NULL, NULL, TO_NOTVICT );
		break;
	}
	learn_from_failure( ch, gsn_ssj2 );
    }

	ch->mana -= skill_table[gsn_ssj2]->min_mana;
	return;
}

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

	if (xIS_SET((ch)->affected_by, AFF_KAIOKEN))
    {
		send_to_char( "You can't transform in to a super saiyan while using kaioken.\n\r", ch );
		return;
	}

        if( xIS_SET( (ch)->affected_by, AFF_USSJ )
         || xIS_SET( (ch)->affected_by, AFF_USSJ2 ) )
        {
          send_to_char( "You have to power out of USSJ to do this.\n\r", ch );
          return;
        }
	if (xIS_SET((ch)->affected_by, AFF_SSJ3))
	    {
		send_to_char( "You power down to super Saiyan 2.\n\r", ch );
		xREMOVE_BIT((ch)->affected_by, AFF_SSJ3);

                if( xIS_SET( (ch)->affected_by, AFF_SSJ4) )
                {
                  xREMOVE_BIT( (ch)->affected_by, AFF_SSJ4 );
                }

		ch->pl = ch->exp * 16;
		transStatApply(ch, 16, 8, 4, 8);
                if( !IS_NPC( ch ) )
                {
                  ch->pcdata->eyes      = 0;
                  ch->pcdata->haircolor = 3;
                }
		return;
    	}

	if (xIS_SET((ch)->affected_by, AFF_OOZARU))
	{
		send_to_char( "You can't transform while you are an Oozaru.\n\r", ch );
		return;
	}

	if (!xIS_SET((ch)->affected_by, AFF_SSJ2))
	{
		if ( ch->mana < skill_table[gsn_ssj3]->min_mana * 2)
		{
			send_to_char( "You don't have enough energy.\n\r", ch );
			return;
		}

		WAIT_STATE( ch, skill_table[gsn_ssj3]->beats );
		if ( can_use_skill(ch, number_percent(), gsn_ssj3 ) )
		{
			act( AT_YELLOW, "A brilliant golden aura explodes around you as your hair suddenly flashes a similar color. "
				"It flows rapidly down your back as your eyebrows disappear.", ch, NULL, NULL, TO_CHAR );
			act( AT_YELLOW, "A brilliant golden aura explodes around $n as $s hair suddenly flashes a similar color. "
				"It flows rapidly down $s back as $s eyebrows disappear.", ch, NULL, NULL, TO_NOTVICT );
			xSET_BIT( (ch)->affected_by, AFF_SSJ );
			xSET_BIT( (ch)->affected_by, AFF_SSJ2 );
			xSET_BIT( (ch)->affected_by, AFF_SSJ3 );
			ch->pl = ch->exp * 24;
			transStatApply(ch, 24, 12, 6, 12);
			learn_from_success( ch, gsn_ssj3 );
			if( !IS_NPC( ch ) )
			{
				ch->pcdata->eyes      = 0;
				ch->pcdata->haircolor = 3;
			}
		}
		else
		{
		switch (number_range(1, 3))
		{
			default:
				act( AT_BLUE, "Your hair begins to crawl down your back, but it quickly returns.", ch, NULL, NULL, TO_CHAR );
				act( AT_BLUE, "$n's hair begins to crawl down $s back, but it quickly returns.", ch, NULL, NULL, TO_NOTVICT );
			break;
			case 1:
				act( AT_BLUE, "Your hair begins to crawl down your back, but it quickly returns.", ch, NULL, NULL, TO_CHAR );
				act( AT_BLUE, "$n's hair begins to crawl down $s back, but it quickly returns.", ch, NULL, NULL, TO_NOTVICT );
			break;
			case 2:
				act( AT_BLUE, "You almost pop a vein trying to transform in to a super saiyan 3.", ch, NULL, NULL, TO_CHAR );
				act( AT_BLUE, "$n almost pops a vein trying to transform in to a super saiyan 3.", ch, NULL, NULL, TO_NOTVICT );
			break;
			case 3:
				act( AT_BLUE, "Your hair starts to lengthen and change color, but quickly returns to normal.", ch, NULL, NULL, TO_CHAR );
				act( AT_BLUE, "$n's hair starts to lengthen and change color, but quickly returns to normal.", ch, NULL, NULL, TO_NOTVICT );
			break;
		}
		learn_from_failure( ch, gsn_ssj3 );
		}

		ch->mana -= skill_table[gsn_ssj3]->min_mana * 2;
		return;
	}

	if ( ch->mana < skill_table[gsn_ssj3]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
    WAIT_STATE( ch, skill_table[gsn_ssj3]->beats );
   if ( can_use_skill(ch, number_percent(), gsn_ssj3 ) )
	{
//	act( AT_YELLOW, "Your hair flows down your back and your eyebrows disappear as your aura flares even brighter.", ch, NULL, NULL, TO_CHAR );
//	act( AT_YELLOW, "$n's hair flows down $s back and $s eyebrows disappear as $s aura flares even brighter.", ch, NULL, NULL, TO_NOTVICT );
	act( AT_YELLOW, "Your hair lengthens, flowing down your back.  Your eyebrows disappear as your "
                        "aura flashes a bright gold.", ch, NULL, NULL, TO_CHAR );
	act( AT_YELLOW, "$n's hair lengthens, flowing down $s back.  $n's eyebrows disappear as $s "
                        "aura flashes a bright gold.", ch, NULL, NULL, TO_NOTVICT );
	xSET_BIT( (ch)->affected_by, AFF_SSJ3 );
	ch->pl = ch->exp * 24;
	transStatApply(ch, 24, 12, 6, 12);
	learn_from_success( ch, gsn_ssj3 );
        if( !IS_NPC( ch ) )
        {
          ch->pcdata->eyes      = 0;
          ch->pcdata->haircolor = 3;
        }
    }
	else
	{
	switch (number_range(1, 3))
	{
		default:
		act( AT_BLUE, "Your hair begins to crawl down your back, but it quickly returns.", ch, NULL, NULL, TO_CHAR );
		act( AT_BLUE, "$n's hair begins to crawl down $s back, but it quickly returns.", ch, NULL, NULL, TO_NOTVICT );
		break;
		case 1:
		act( AT_BLUE, "Your hair begins to crawl down your back, but it quickly returns.", ch, NULL, NULL, TO_CHAR );
		act( AT_BLUE, "$n's hair begins to crawl down $s back, but it quickly returns.", ch, NULL, NULL, TO_NOTVICT );
		break;
		case 2:
		act( AT_BLUE, "You almost pop a vein trying to transform in to a super Saiyan 3.", ch, NULL, NULL, TO_CHAR );
		act( AT_BLUE, "$n almost pops a vein trying to transform in to a super Saiyan 3.", ch, NULL, NULL, TO_NOTVICT );
		break;
		case 3:
		act( AT_BLUE, "Your aura begins to flare up, but it quickly shrinks down again.", ch, NULL, NULL, TO_CHAR );
		act( AT_BLUE, "$n's aura begins to flare up, but it quickly shrinks down again.", ch, NULL, NULL, TO_NOTVICT );
		break;
	}
	learn_from_failure( ch, gsn_ssj3 );
    }

	ch->mana -= skill_table[gsn_ssj3]->min_mana;
	return;
}

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

	if (xIS_SET((ch)->affected_by, AFF_KAIOKEN))
    {
		send_to_char( "You can't transform in to a super saiyan while using kaioken.\n\r", ch );
		return;
	}

        if( xIS_SET( (ch)->affected_by, AFF_USSJ )
         || xIS_SET( (ch)->affected_by, AFF_USSJ2 ) )
        {
          send_to_char( "You have to power out of USSJ to do this.\n\r", ch );
          return;
        }
	if (xIS_SET((ch)->affected_by, AFF_SSJ4))
	    {
		send_to_char( "You power down to super Saiyan 3.\n\r", ch );
		xREMOVE_BIT((ch)->affected_by, AFF_SSJ4);
		ch->pl = ch->exp * 24;
		transStatApply(ch, 24, 12, 6, 12);
                if( !IS_NPC( ch ) )
                {
                  ch->pcdata->eyes      = 0;
                  ch->pcdata->haircolor = 3;
                }
		return;
    	}

	if (xIS_SET((ch)->affected_by, AFF_OOZARU))
	{
		send_to_char( "You can't transform while you are an Oozaru.\n\r", ch );
		return;
	}

	if (!xIS_SET((ch)->affected_by, AFF_SSJ3))
	{
		if ( ch->mana < skill_table[gsn_ssj4]->min_mana * 3)
		{
			send_to_char( "You don't have enough energy.\n\r", ch );
			return;
		}

		WAIT_STATE( ch, skill_table[gsn_ssj4]->beats );
		if ( can_use_skill(ch, number_percent(), gsn_ssj4 ) )
		{
			act( AT_RED, "You howl with anger as a menacing, fiery, red aura explodes around you. "
				"Thick red fur sprouts all over your body as your hair turns a darker variant of normal.", ch, NULL, NULL, TO_CHAR );
			act( AT_RED, "$n howls with anger as a menacing, fiery, red aura explodes around $m. "
				"Thick red fur sprouts all over $s body as $s hair turns a darker variant of normal.", ch, NULL, NULL, TO_NOTVICT );
			xSET_BIT( (ch)->affected_by, AFF_SSJ );
			xSET_BIT( (ch)->affected_by, AFF_SSJ2 );
			xSET_BIT( (ch)->affected_by, AFF_SSJ3 );
			xSET_BIT( (ch)->affected_by, AFF_SSJ4 );
			ch->pl = ch->exp * 30;
			transStatApply(ch, 30, 15, 8, 15);
			learn_from_success( ch, gsn_ssj4 );
			if( !IS_NPC( ch ) )
			{
				ch->pcdata->eyes      = 4;
				ch->pcdata->haircolor = 9;
			}
		}
		else
		{
			switch (number_range(1, 4))
			{
				default:
					act( AT_BLUE, "Your hair flashes black, but quickly returns to blonde.", ch, NULL, NULL, TO_CHAR );
					act( AT_BLUE, "$n's hair flashes black, but quickly returns to blonde.", ch, NULL, NULL, TO_NOTVICT );
					break;
				case 1:
					act( AT_BLUE, "Your hair flashes black, but quickly returns to blonde.", ch, NULL, NULL, TO_CHAR );
					act( AT_BLUE, "$n's hair flashes black, but quickly returns to blonde.", ch, NULL, NULL, TO_NOTVICT );
					break;
				case 2:
					act( AT_BLUE, "You almost pop a vein trying to transform in to a super Saiyan 4.", ch, NULL, NULL, TO_CHAR );
					act( AT_BLUE, "$n almost pops a vein trying to transform in to a super Saiyan 4.", ch, NULL, NULL, TO_NOTVICT );
					break;
				case 3:
					act( AT_BLUE, "Red fur begins to sprout all over your body, but quickly disappears.", ch, NULL, NULL, TO_CHAR );
					act( AT_BLUE, "Red fur begins to sprout all over $n's body, but quickly disappears.", ch, NULL, NULL, TO_NOTVICT );
					break;
				case 4:
					act( AT_BLUE, "Your aura flashes a fiery red, but quickly goes back to gold.", ch, NULL, NULL, TO_CHAR );
					act( AT_BLUE, "$n's aura flashes a fiery red, but quickly goes back to gold.", ch, NULL, NULL, TO_NOTVICT );
					break;
			}
			learn_from_failure( ch, gsn_ssj4 );
		}

		ch->mana -= skill_table[gsn_ssj4]->min_mana * 3;
		return;
	}

	if ( ch->mana < skill_table[gsn_ssj4]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
    WAIT_STATE( ch, skill_table[gsn_ssj4]->beats );
   if ( can_use_skill(ch, number_percent(), gsn_ssj4 ) )
	{
//	act( AT_RED, "You howl with anger as your hair turns black again and grow", ch, NULL, NULL, TO_CHAR );
//	act( AT_RED, "thick red fur all over your body, finally you sprout a", ch, NULL, NULL, TO_CHAR );
//	act( AT_RED, "tail and look up with glaring eyes inset within a red outline.", ch, NULL, NULL, TO_CHAR );
//	act( AT_RED, "$n howls with anger as $s hair turns black again and grows", ch, NULL, NULL, TO_NOTVICT );
//	act( AT_RED, "thick red fur all over $s body, finally $e sprouts a", ch, NULL, NULL, TO_NOTVICT );
//	act( AT_RED, "tail and looks up at you with glaring eyes inset within a red outline.", ch, NULL, NULL, TO_NOTVICT );
	act( AT_RED, "You howl with anger, your golden aura exploding and reforming as a fiery red.  "
                     "Your hair returns to its original shade and form as thick red fur begins "
                     "to sprout all over your body.", ch, NULL, NULL, TO_CHAR );
	act( AT_RED, "$n howls with anger, $s golden aura exploding and reforming as a fiery red.  "
                     "$n's hair returns to its original shade and form as thick red fur begins "
                     "to sprout all over $s body.", ch, NULL, NULL, TO_NOTVICT );
	xSET_BIT( (ch)->affected_by, AFF_SSJ4 );
	ch->pl = ch->exp * 30;
	transStatApply(ch, 30, 15, 8, 15);
	learn_from_success( ch, gsn_ssj4 );
        if( !IS_NPC( ch ) )
        {
          ch->pcdata->eyes      = 4;
          ch->pcdata->haircolor = 9;
        }
    }
	else
	{
	switch (number_range(1, 4))
	{
		default:
		act( AT_BLUE, "Your hair flashes black, but quickly returns to blonde.", ch, NULL, NULL, TO_CHAR );
		act( AT_BLUE, "$n's hair flashes black, but quickly returns to blonde.", ch, NULL, NULL, TO_NOTVICT );
		break;
		case 1:
		act( AT_BLUE, "Your hair flashes black, but quickly returns to blonde.", ch, NULL, NULL, TO_CHAR );
		act( AT_BLUE, "$n's hair flashes black, but quickly returns to blonde.", ch, NULL, NULL, TO_NOTVICT );
		break;
		case 2:
		act( AT_BLUE, "You almost pop a vein trying to transform in to a super Saiyan 4.", ch, NULL, NULL, TO_CHAR );
		act( AT_BLUE, "$n almost pops a vein trying to transform in to a super Saiyan 4.", ch, NULL, NULL, TO_NOTVICT );
		break;
		case 3:
		act( AT_BLUE, "Red fur begins to sprout all over your body, but quickly disappears.", ch, NULL, NULL, TO_CHAR );
		act( AT_BLUE, "Red fur begins to sprout all over $n's body, but quickly disappears.", ch, NULL, NULL, TO_NOTVICT );
		break;
		case 4:
		act( AT_BLUE, "Your aura flashes a fiery red, but quickly goes back to gold.", ch, NULL, NULL, TO_CHAR );
		act( AT_BLUE, "$n's aura flashes a fiery red, but quickly goes back to gold.", ch, NULL, NULL, TO_NOTVICT );
		break;
	}
	learn_from_failure( ch, gsn_ssj4 );
    }

	ch->mana -= skill_table[gsn_ssj4]->min_mana;
	return;
}

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

	double pl_mult = 0;
	int arg;
        bool affGrowth = FALSE;
        int sizeStr=0, sizeSpd=0, sizeCon=0, sizeInt=0;

	arg = atoi(argument);

        if( xIS_SET( (ch)->affected_by, AFF_GROWTH ) )
        {
          affGrowth = TRUE;
          sizeStr   = 10;
          sizeCon   = 5;
          sizeInt   = 5;
          sizeSpd   = -10;
        }
        if( xIS_SET( (ch)->affected_by, AFF_GIANT ) )
        {
          affGrowth = TRUE;
          sizeStr   = 25;
          sizeCon   = 15;
          sizeInt   = 10;
          sizeSpd   = -25;
        }

	if (xIS_SET((ch)->affected_by, AFF_SNAMEK))
	    {
		send_to_char( "You power down and return to normal.\n\r", ch );
		xREMOVE_BIT((ch)->affected_by, AFF_SNAMEK);
		transStatRemove(ch);
		ch->pl = ch->exp;
                if( affGrowth )
                {
                  transStatApply( ch, sizeStr, sizeSpd, sizeInt, sizeCon );
                }
		return;
    	}

	pl_mult = (double) pow(ch->exp, 0.373) * 0.01;
	if (pl_mult > 26)
		pl_mult = 26;
	if (pl_mult < 5)
		pl_mult = (double) 2 + pl_mult;
	else if (pl_mult < 6)
		pl_mult = (double) 1 + pl_mult;
	else if (pl_mult < 6.5)
		pl_mult = (double) 0.5 + pl_mult;

	if (arg > pl_mult)
		pl_mult = (int) pl_mult;
	else if (arg < 1)
		pl_mult = 1;
	else
		pl_mult = arg;

	if ( ch->mana < skill_table[gsn_snamek]->min_mana * pl_mult )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
    WAIT_STATE( ch, skill_table[gsn_snamek]->beats );
	if ( can_use_skill(ch, number_percent(), gsn_snamek ) )
	{
	act( AT_SKILL, "You draw upon the ancient knowledge of the Namekians to transform into a Super Namek.", ch, NULL, NULL, TO_CHAR );
	act( AT_SKILL, "$n draws upon the ancient knowledge of the Namekians to transform into a Super Namek.", ch, NULL, NULL, TO_NOTVICT );
	xSET_BIT( (ch)->affected_by, AFF_SNAMEK );


	ch->pl = ch->exp * pl_mult;
        if( affGrowth )
        {
	  transStatApply(ch, pl_mult/4+sizeStr, pl_mult/2+sizeSpd, pl_mult+sizeInt, pl_mult/4+sizeCon);
        }
        else
        {
	  transStatApply(ch, pl_mult/4, pl_mult/2, pl_mult, pl_mult/4);
        }

	learn_from_success( ch, gsn_snamek );
    }
	else
	{
	act( AT_SKILL, "You can not quite comprehend the ancient knowledge necessary to become a Super Namek.", ch, NULL, NULL, TO_CHAR );
	act( AT_SKILL, "$n can not quite comprehend the ancient knowledge necessary to become a Super Namek.", ch, NULL, NULL, TO_NOTVICT );
	learn_from_failure( ch, gsn_snamek );
    }

	ch->mana -= skill_table[gsn_snamek]->min_mana * pl_mult;
	return;
}

void do_icer_transform_2 (CHAR_DATA *ch, char *argument)
{
	if (xIS_SET((ch)->affected_by, AFF_ICER2)
		|| xIS_SET((ch)->affected_by, AFF_ICER3)
		|| xIS_SET((ch)->affected_by, AFF_ICER4)
		|| xIS_SET((ch)->affected_by, AFF_ICER5))
	    {
		send_to_char( "You power down and transform into your first form.\n\r", ch );
		if (xIS_SET((ch)->affected_by, AFF_ICER2))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER2);
		if (xIS_SET((ch)->affected_by, AFF_ICER3))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER3);
		if (xIS_SET((ch)->affected_by, AFF_ICER4))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER4);
		if (xIS_SET((ch)->affected_by, AFF_ICER5))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER5);
		ch->pl = ch->exp;
		transStatRemove(ch);
		return;
    	}

	if ( ch->mana < skill_table[gsn_icer2]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}

    WAIT_STATE( ch, skill_table[gsn_icer2]->beats );
	if ( can_use_skill(ch, number_percent(), gsn_icer2 ) )
	{
//	act( AT_SKILL, "The temperature in the room plummets as you transform into your second form.", ch, NULL, NULL, TO_CHAR );
//	act( AT_SKILL, "A dread chill emanates from you as your stature grows, your body and", ch, NULL, NULL, TO_CHAR );
//	act( AT_SKILL, "muscle mass increase and your horns become more prominent, completing your", ch, NULL, NULL, TO_CHAR );
//        act( AT_SKILL, "transformation to your second form.", ch, NULL, NULL, TO_CHAR );
        act( AT_SKILL, "A dread chill emanates from you as your form grows huge in size, your muscles bulge and your horns"
                       " become much more prominent, completing your transformation to your second form.",
                       ch, NULL, NULL, TO_CHAR );
//	act( AT_SKILL, "The temperature in the room plummets as $n transforms into $s second form.", ch, NULL, NULL, TO_NOTVICT );
//	act( AT_SKILL, "A dread chill emanates from $n as $s stature grows, $s body and muscle", ch, NULL, NULL, TO_NOTVICT );
//	act( AT_SKILL, "mass increases and $s horns become more prominent, completing $s", ch, NULL, NULL, TO_NOTVICT );
//	act( AT_SKILL, "transformation to $s second form.", ch, NULL, NULL, TO_NOTVICT );
        act( AT_SKILL, "A dread chill emanates from $n as $s form grows huge in size, $s muscles bulge and $s horns"
                       " become much more prominent, completing $s transformation to $s second form.",
                       ch, NULL, NULL, TO_NOTVICT );
	xSET_BIT( (ch)->affected_by, AFF_ICER2 );
	ch->pl = ch->exp * 7;
	transStatApply(ch, 4, 4, 2, 7);
	learn_from_success( ch, gsn_icer2 );
    }
	else
	{
	act( AT_SKILL, "The temperature dips a few degrees, but quickly returns to normal, as you are unable to transform.", ch, NULL, NULL, TO_CHAR );
	act( AT_SKILL, "The temperature dips a few degrees, but quickly returns to normal, as $n is unable to transform.", ch, NULL, NULL, TO_NOTVICT );
	learn_from_failure( ch, gsn_icer2 );
    }
	if (xIS_SET((ch)->affected_by, AFF_ICER3))
		xREMOVE_BIT((ch)->affected_by, AFF_ICER3);
	if (xIS_SET((ch)->affected_by, AFF_ICER4))
		xREMOVE_BIT((ch)->affected_by, AFF_ICER4);
	if (xIS_SET((ch)->affected_by, AFF_ICER5))
		xREMOVE_BIT((ch)->affected_by, AFF_ICER5);

	ch->mana -= skill_table[gsn_icer2]->min_mana;
	return;
}

void do_icer_transform_3 (CHAR_DATA *ch, char *argument)
{
	if (xIS_SET((ch)->affected_by, AFF_ICER3)
		|| xIS_SET((ch)->affected_by, AFF_ICER4)
		|| xIS_SET((ch)->affected_by, AFF_ICER5))
	    {
		send_to_char( "You power down and transform into your second form.\n\r", ch );
		if (xIS_SET((ch)->affected_by, AFF_ICER3))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER3);
		if (xIS_SET((ch)->affected_by, AFF_ICER4))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER4);
		if (xIS_SET((ch)->affected_by, AFF_ICER5))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER5);
		if (!xIS_SET((ch)->affected_by, AFF_ICER2))
			xSET_BIT( (ch)->affected_by, AFF_ICER2 );
		ch->pl = ch->exp * 7;
		transStatApply(ch, 4, 4, 2, 7);
		return;
    	}

	if ( ch->mana < skill_table[gsn_icer3]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}

	if (!xIS_SET((ch)->affected_by, AFF_ICER2))
	{
		send_to_char( "You must be in second form first.\n\r", ch);
		return;
	}

    WAIT_STATE( ch, skill_table[gsn_icer3]->beats );
	if ( can_use_skill(ch, number_percent(), gsn_icer3 ) )
	{
//	act( AT_SKILL, "The temperature in the room plummets as you transform into your third form.", ch, NULL, NULL, TO_CHAR );
//	act( AT_SKILL, "A cold breeze ruffles any loose items as your body shrinks a little, the back", ch, NULL, NULL, TO_CHAR );
//	act( AT_SKILL, "of your head elongates, your nose disappears, your lips form into what almost", ch, NULL, NULL, TO_CHAR );
//	act( AT_SKILL, "looks like a bill and your horns shrink, finishing your transformation to your third form."
//                     , ch, NULL, NULL, TO_CHAR );
        act( AT_SKILL, "A cold breeze swirls out from your form as you shrink slightly, your head elongates and your"
                       " mouth and nose form into a sort of beak.  Your horns shrink, leaving you looking like quite"
                       " a monster in your third form.", ch, NULL, NULL, TO_CHAR );
//	act( AT_SKILL, "The temperature in the room plummets as $n transforms into $s third form.", ch, NULL, NULL, TO_NOTVICT );
//	act( AT_SKILL, "A cold breeze ruffles loose items around $n as $s body shrinks a little, the back"
//                     , ch, NULL, NULL, TO_NOTVICT );
//	act( AT_SKILL, "of $s head elongates, $s nose disappears, $s lips form into what looks like a bill"
//                     , ch, NULL, NULL, TO_NOTVICT );
//	act( AT_SKILL, "and $s horns shrink, completing $s transformation to $s third form.", ch, NULL, NULL, TO_NOTVICT );
        act( AT_SKILL, "A cold breeze swirls out from $n's form as $e shrinks slightly, $s head elongates and $s"
                       " mouth and nose form into a sort of beak.  $n's horns shrink, leaving $m looking like quite"
                       " a monster in $s third form.", ch, NULL, NULL, TO_NOTVICT );
	xSET_BIT( (ch)->affected_by, AFF_ICER3 );
	xREMOVE_BIT((ch)->affected_by, AFF_ICER2);
	ch->pl = ch->exp * 14;
	transStatApply(ch, 7, 7, 4, 14);
	learn_from_success( ch, gsn_icer3 );
    }
	else
	{
	act( AT_SKILL, "The temperature dips a few degrees, but quickly returns to normal, as you are unable to transform.", ch, NULL, NULL, TO_CHAR );
	act( AT_SKILL, "The temperature dips a few degrees, but quickly returns to normal, as $n is unable to transform.", ch, NULL, NULL, TO_NOTVICT );
	learn_from_failure( ch, gsn_icer3 );
    }

	if (xIS_SET((ch)->affected_by, AFF_ICER4))
		xREMOVE_BIT((ch)->affected_by, AFF_ICER4);
	if (xIS_SET((ch)->affected_by, AFF_ICER5))
		xREMOVE_BIT((ch)->affected_by, AFF_ICER5);
	ch->mana -= skill_table[gsn_icer3]->min_mana;
	return;
}

void do_icer_transform_4 (CHAR_DATA *ch, char *argument)
{
	if (xIS_SET((ch)->affected_by, AFF_ICER4)
		|| xIS_SET((ch)->affected_by, AFF_ICER5))
	    {
		send_to_char( "You power down and transform into your third form.\n\r", ch );
		if (xIS_SET((ch)->affected_by, AFF_ICER2))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER2);
		if (xIS_SET((ch)->affected_by, AFF_ICER4))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER4);
		if (xIS_SET((ch)->affected_by, AFF_ICER5))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER5);
		if (!xIS_SET((ch)->affected_by, AFF_ICER3))
			xSET_BIT( (ch)->affected_by, AFF_ICER3 );
		ch->pl = ch->exp * 14;
		transStatApply(ch, 7, 7, 4, 14);
		return;
    	}

	if ( ch->mana < skill_table[gsn_icer4]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}

	if (!xIS_SET((ch)->affected_by, AFF_ICER3))
	{
		send_to_char( "You must be in third form first.\n\r", ch);
		return;
	}

    WAIT_STATE( ch, skill_table[gsn_icer4]->beats );
	if ( can_use_skill(ch, number_percent(), gsn_icer4 ) )
	{
//	act( AT_SKILL, "The temperature in the room plummets as you transform into your fourth form.", ch, NULL, NULL, TO_CHAR );
//	act( AT_SKILL, "With a sudden rush of freezing air your body reverts back to normal stature", ch, NULL, NULL, TO_CHAR );
//	act( AT_SKILL, "while at the same time your horns disappear, you skin becomes as smooth as", ch, NULL, NULL, TO_CHAR );
//	act( AT_SKILL, "glass and your facial features turn quite comely, bringing you to your fourth form.", ch, NULL, NULL, TO_CHAR );
        act( AT_SKILL, "With a sudden gust of freezing air your body reverts to a more normal shape and size.  "
                       "Your horns disappear completely now, your skin and features turning as smooth as glass, "
                       "leaving you looking rather sleek in your fourth form.", ch, NULL, NULL, TO_CHAR );
//	act( AT_SKILL, "The temperature in the room plummets as $n transforms into $s fourth form.", ch, NULL, NULL, TO_NOTVICT );
//	act( AT_SKILL, "A sudden rush of freezing air swirls as $n reverts back to normal stature,", ch, NULL, NULL, TO_NOTVICT );
//	act( AT_SKILL, "$s horns disappear, $s skin becomes smooth as glass and $s facial features", ch, NULL, NULL, TO_NOTVICT );
//	act( AT_SKILL, "turn quite comely, finishing $s transformation to $s fourth form.", ch, NULL, NULL, TO_NOTVICT );
        act( AT_SKILL, "With a sudden gust of freezing air $n's body reverts to a more normal shape and size.  "
                       "$n's horns disappear completely now, $s skin and features turning as smooth as glass, "
                       "leaving $m looking rather sleek in $s fourth form.", ch, NULL, NULL, TO_NOTVICT );
	xSET_BIT( (ch)->affected_by, AFF_ICER4 );
	xREMOVE_BIT((ch)->affected_by, AFF_ICER3);
	ch->pl = ch->exp * 20;
	transStatApply(ch, 10, 10, 5, 20);
	learn_from_success( ch, gsn_icer4 );
    }
	else
	{
	act( AT_SKILL, "The temperature dips a few degrees, but quickly returns to normal, as you are unable to transform.", ch, NULL, NULL, TO_CHAR );
	act( AT_SKILL, "The temperature dips a few degrees, but quickly returns to normal, as $n is unable to transform.", ch, NULL, NULL, TO_NOTVICT );
	learn_from_failure( ch, gsn_icer4 );
    }

	if (xIS_SET((ch)->affected_by, AFF_ICER5))
		xREMOVE_BIT((ch)->affected_by, AFF_ICER5);
	ch->mana -= skill_table[gsn_icer4]->min_mana;
	return;
}

void do_icer_transform_5 (CHAR_DATA *ch, char *argument)
{
	if (xIS_SET((ch)->affected_by, AFF_ICER5))
	    {
		send_to_char( "You power down and transform into your fourth form.\n\r", ch );
		if (xIS_SET((ch)->affected_by, AFF_ICER2))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER2);
		if (xIS_SET((ch)->affected_by, AFF_ICER3))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER3);
		if (xIS_SET((ch)->affected_by, AFF_ICER5))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER5);
		if (!xIS_SET((ch)->affected_by, AFF_ICER4))
			xSET_BIT( (ch)->affected_by, AFF_ICER4 );
		ch->pl = ch->exp * 20;
		transStatApply(ch, 10, 10, 5, 20);
		return;
    	}

	if ( ch->mana < skill_table[gsn_icer5]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}

	if (!xIS_SET((ch)->affected_by, AFF_ICER4))
	{
		send_to_char( "You must be in fourth form first.\n\r", ch);
		return;
	}

    WAIT_STATE( ch, skill_table[gsn_icer5]->beats );
	if ( can_use_skill(ch, number_percent(), gsn_icer5 ) )
	{
//	act( AT_SKILL, "The temperature in the room plummets as you transform into your fifth form.", ch, NULL, NULL, TO_CHAR );
//	act( AT_SKILL, "An arctic tempest billows around you as your stature and size increase greatly,", ch, NULL, NULL, TO_CHAR );
//	act( AT_SKILL, "armored-plates form at key points for extra protection, spikes bristle about", ch, NULL, NULL, TO_CHAR );
//	act( AT_SKILL, "your body, and a final armored mask slides into place over your face, ending", ch, NULL, NULL, TO_CHAR );
//	act( AT_SKILL, "the transformation to your fifth form.", ch, NULL, NULL, TO_CHAR );
        act( AT_SKILL, "An arctic tempest roars as your body grows huge, your muscles bulging.  Armored plates "
                       "slide over weak points, spikes bristling over your body for extra protection.  An armored "
                       "mask slides over your face, ending your transformation to your fifth form.",
                       ch, NULL, NULL, TO_CHAR );
//	act( AT_SKILL, "The temperature in the room plummets as $n transforms into $s fifth form.", ch, NULL, NULL, TO_NOTVICT );
//	act( AT_SKILL, "An arctic tempest billows around $n as $s stature and size increase greatly,", ch, NULL, NULL, TO_NOTVICT );
//	act( AT_SKILL, "armored-plates form at key points for extra protection, spikes bristle about", ch, NULL, NULL, TO_NOTVICT );
//	act( AT_SKILL, "$s body, and a final armored mask slides into place over $s face, ending", ch, NULL, NULL, TO_NOTVICT );
//	act( AT_SKILL, "the transformation to $s fifth form.", ch, NULL, NULL, TO_NOTVICT );
        act( AT_SKILL, "An arctic tempest roars as $n's body grows huge, $s muscles bulging.  Armored plates "
                       "slide over weak points, spikes bristling over $s body for extra protection.  An armored "
                       "mask slides over $n's face, ending $s transformation to $s fifth form.",
                       ch, NULL, NULL, TO_NOTVICT );
	xSET_BIT( (ch)->affected_by, AFF_ICER5 );
	xREMOVE_BIT((ch)->affected_by, AFF_ICER4);
	ch->pl = ch->exp * 26;
	transStatApply(ch, 13, 13, 7, 26);
	learn_from_success( ch, gsn_icer5 );
    }
	else
	{
	act( AT_SKILL, "The temperature dips a few degrees, but quickly returns to normal, as you are unable to transform.", ch, NULL, NULL, TO_CHAR );
	act( AT_SKILL, "The temperature dips a few degrees, but quickly returns to normal, as $n is unable to transform.", ch, NULL, NULL, TO_NOTVICT );
	learn_from_failure( ch, gsn_icer5 );
    }

	ch->mana -= skill_table[gsn_icer5]->min_mana;
	return;
}

void do_fly (CHAR_DATA *ch, char *argument)
{
	if (xIS_SET((ch)->affected_by, AFF_FLYING))
	    {
		send_to_char( "You float down and land on the ground.\n\r", ch );
		xREMOVE_BIT((ch)->affected_by, AFF_FLYING);
		return;
    	}

	if ( ch->mana < skill_table[gsn_fly]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
    WAIT_STATE( ch, skill_table[gsn_fly]->beats );
	if ( can_use_skill(ch, number_percent(), gsn_fly ) )
	{
	act( AT_SKILL, "You rise up into the currents of air....", ch, NULL, NULL, TO_CHAR );
	act( AT_SKILL, "$n rises up into the currents of air....", ch, NULL, NULL, TO_NOTVICT );
	xSET_BIT( (ch)->affected_by, AFF_FLYING );
	learn_from_success( ch, gsn_fly );
    }
	else
	{
	act( AT_SKILL, "You try to fly but you fall back down to the earth.", ch, NULL, NULL, TO_CHAR );
	act( AT_SKILL, "$n tries to fly but falls back down to the earth.", ch, NULL, NULL, TO_NOTVICT );
	learn_from_failure( ch, gsn_fly );
    }
	ch->mana -= skill_table[gsn_fly]->min_mana;

	return;
}

void do_energy_ball(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_energy_ball]->skill_level[ch->class] )
    {
	send_to_char("You can't do that.\n\r", ch );
	return;
    }

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

	if ( ch->mana < skill_table[gsn_energy_ball]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_energy_ball]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_energy_ball]->focus;

    WAIT_STATE( ch, skill_table[gsn_energy_ball]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_energy_ball ) )
    {
	dam = get_attmod(ch, victim) * number_range( 6, 8 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	act( AT_SKILL, "You hit $N with an energy ball. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_SKILL, "$n hits you with an energy ball. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	act( AT_SKILL, "$n hits $N with an energy ball. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
        dam = ki_absorb( victim, ch, dam, gsn_energy_ball );
	learn_from_success( ch, gsn_energy_ball );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You missed $N with your energy ball.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n misses you with $s energy ball.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n missed $N with an energy ball.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_energy_ball );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= skill_table[gsn_energy_ball]->min_mana;
    return;
}

void do_kamehameha(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

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

    if ((ch->race == 9)
    &&   (ch->exp < skill_table[gsn_genie_signature]->skill_level[ch->class]) )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }
    else
    {
      if ( (!IS_NPC(ch))
      &&   (ch->exp < skill_table[gsn_kamehameha]->skill_level[ch->class]) )
      {
	  send_to_char( "You can't do that.\n\r", ch );
	  return;
      }
    }

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

	if ( ch->mana < skill_table[gsn_kamehameha]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_kamehameha]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_kamehameha]->focus;

    WAIT_STATE( ch, skill_table[gsn_kamehameha]->beats );
    if (ch->race != 9)
    {
      if ( can_use_skill(ch, number_percent(),gsn_kamehameha ) )
      {
	  dam = get_attmod(ch, victim) * number_range( 20, 25 );
	  if (ch->charge > 0)
	  	dam = chargeDamMult(ch, dam);
	  act( AT_SKILL, "You put your arms back and cup your hands. 'KA-ME-HA-ME-HA!!!!'	", ch, NULL, victim, TO_CHAR );
	  act( AT_SKILL, "You push your hands forward, throwing a blue beam at $N. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_SKILL, "$n puts $s arms back and cups $s hands. 'KA-ME-HA-ME-HA!!!!'	", ch, NULL, victim, TO_VICT );
	  act( AT_SKILL, "$n pushes $s hands forward, throwing a blue beam at you. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_SKILL, "$n puts $s arms back and cups $s hands. 'KA-ME-HA-ME-HA!!!!'	", ch, NULL, victim, TO_NOTVICT );
	  act( AT_SKILL, "$n pushes $s hands forward, throwing a blue beam at $N. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

          dam = ki_absorb( victim, ch, dam, gsn_kamehameha );
	  learn_from_success( ch, gsn_kamehameha );
	  global_retcode = damage( ch, victim, dam, TYPE_HIT );
      }
      else
      {
	  act( AT_SKILL, "You missed $N with your kamehameha.", ch, NULL, victim, TO_CHAR );
	  act( AT_SKILL, "$n misses you with $s kamehameha.", ch, NULL, victim, TO_VICT );
	  act( AT_SKILL, "$n missed $N with a kamehameha.", ch, NULL, victim, TO_NOTVICT );
	  learn_from_failure( ch, gsn_kamehameha );
	  global_retcode = damage( ch, victim, 0, TYPE_HIT );
      }
    }
    else
    {
      if ( can_use_skill(ch, number_percent(),gsn_genie_signature ) )
      {
	  dam = get_attmod(ch, victim) * number_range( 20, 25 );
	  if (ch->charge > 0)
	  	dam = chargeDamMult(ch, dam);
	  act( AT_PINK, "You put your arms back and cup your hands. 'KA-ME-HA-ME-HA!!!!'	", ch, NULL, victim, TO_CHAR );
	  act( AT_PINK, "You push your hands forward, throwing a blue beam at $N. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_PINK, "$n puts $s arms back and cups $s hands. 'KA-ME-HA-ME-HA!!!!'	", ch, NULL, victim, TO_VICT );
	  act( AT_PINK, "$n pushes $s hands forward, throwing a blue beam at you. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_PINK, "$n puts $s arms back and cups $s hands. 'KA-ME-HA-ME-HA!!!!'	", ch, NULL, victim, TO_NOTVICT );
	  act( AT_PINK, "$n pushes $s hands forward, throwing a blue beam at $N. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

          dam = ki_absorb( victim, ch, dam, gsn_kamehameha );
	  learn_from_success( ch, gsn_genie_signature );
	  global_retcode = damage( ch, victim, dam, TYPE_HIT );
      }
      else
      {
	  act( AT_PURPLE, "You missed $N with your kamehameha.", ch, NULL, victim, TO_CHAR );
	  act( AT_PURPLE, "$n misses you with $s kamehameha.", ch, NULL, victim, TO_VICT );
	  act( AT_PURPLE, "$n missed $N with a kamehameha.", ch, NULL, victim, TO_NOTVICT );
	  learn_from_failure( ch, gsn_genie_signature );
	  global_retcode = damage( ch, victim, 0, TYPE_HIT );
      }
   }

	ch->mana -= skill_table[gsn_kamehameha]->min_mana;
    return;
}

void do_masenko(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

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

    if ((ch->race == 9)
    &&  (ch->exp < skill_table[gsn_genie_signature]->skill_level[ch->class]) )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }
    else
    {
      if ( (!IS_NPC(ch))
      &&   (ch->exp < skill_table[gsn_masenko]->skill_level[ch->class] ))
      {
	  send_to_char( "You can't do that.\n\r", ch );
	  return;
      }
    }


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

	if ( ch->mana < skill_table[gsn_masenko]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_masenko]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_masenko]->focus;

    WAIT_STATE( ch, skill_table[gsn_masenko]->beats );
    if (ch->race != 9)
    {
      if ( can_use_skill(ch, number_percent(),gsn_masenko ) )
      {
	  dam = get_attmod(ch, victim) * number_range( 10, 16 );
	  if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	  act( AT_SKILL, "You hold your arms high above your head, charging your ki.", ch, NULL, victim, TO_CHAR );
	  act( AT_SKILL, "You throw your hands at $N sending a yellow beam at $M, hitting $M in the chest. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_SKILL, "$n holds $s arms high above $s head, charging $s ki.", ch, NULL, victim, TO_VICT );
	  act( AT_SKILL, "$n throws $s hands at you sending a yellow beam at you, hitting you in the chest. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_SKILL, "$n holds $s arms high above $s head, charging $s ki.", ch, NULL, victim, TO_NOTVICT );
	  act( AT_SKILL, "$n throws $s hands at $N sending a yellow beam at $N, hitting $M in the chest. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

        dam = ki_absorb( victim, ch, dam, gsn_masenko );
	  learn_from_success( ch, gsn_masenko );
	  global_retcode = damage( ch, victim, dam, TYPE_HIT );
      }
      else
      {
  	  act( AT_SKILL, "You missed $N with your masenko blast.", ch, NULL, victim, TO_CHAR );
	  act( AT_SKILL, "$n misses you with $s masenko blast.", ch, NULL, victim, TO_VICT );
	  act( AT_SKILL, "$n missed $N with a masenko blast.", ch, NULL, victim, TO_NOTVICT );
	  learn_from_failure( ch, gsn_masenko );
	  global_retcode = damage( ch, victim, 0, TYPE_HIT );
      }
    }
    else
    {
      if ( can_use_skill(ch, number_percent(),gsn_genie_signature ) )
      {
	  dam = get_attmod(ch, victim) * number_range( 10, 16 );
	  if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	  act( AT_PINK, "You hold your arms high above your head, charging your ki.", ch, NULL, victim, TO_CHAR );
	  act( AT_PINK, "You throw your hands at $N sending a yellow beam at $M, hitting $M in the chest. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_PINK, "$n holds $s arms high above $s head, charging $s ki.", ch, NULL, victim, TO_VICT );
	  act( AT_PINK, "$n throws $s hands at you sending a yellow beam at you, hitting you in the chest. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_PINK, "$n holds $s arms high above $s head, charging $s ki.", ch, NULL, victim, TO_NOTVICT );
	  act( AT_PINK, "$n throws $s hands at $N sending a yellow beam at $N, hitting $M in the chest. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

        dam = ki_absorb( victim, ch, dam, gsn_masenko );
	  learn_from_success( ch, gsn_genie_signature );
	  global_retcode = damage( ch, victim, dam, TYPE_HIT );
      }
      else
      {
	  act( AT_PURPLE, "You missed $N with your masenko blast.", ch, NULL, victim, TO_CHAR );
	  act( AT_PURPLE, "$n misses you with $s masenko blast.", ch, NULL, victim, TO_VICT );
	  act( AT_PURPLE, "$n missed $N with a masenko blast.", ch, NULL, victim, TO_NOTVICT );
	  learn_from_failure( ch, gsn_genie_signature );
	  global_retcode = damage( ch, victim, 0, TYPE_HIT );
      }
   }


	ch->mana -= skill_table[gsn_masenko]->min_mana;
    return;
}

void do_sbc(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

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

    if ((ch->race == 9)
    &&  (ch->exp < skill_table[gsn_genie_signature]->skill_level[ch->class] ))
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }
    else
    {
      if ( (!IS_NPC(ch))
      &&  (ch->exp < skill_table[gsn_sbc]->skill_level[ch->class]) )
      {
	  send_to_char( "You can't do that.\n\r", ch );
	  return;
      }
    }

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

	if ( ch->mana < skill_table[gsn_sbc]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_sbc]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_sbc]->focus;

    WAIT_STATE( ch, skill_table[gsn_sbc]->beats );
    if (ch->race != 9)
    {
      if ( can_use_skill(ch, number_percent(),gsn_sbc ) )
      {
	  dam = get_attmod(ch, victim) * number_range( 22, 26 );
	  if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	  act( AT_SKILL, "You put two fingers to your forehead, crackling energy gathering at their tips.", ch, NULL, victim, TO_CHAR );
	  act( AT_SKILL, "Your thrust your fingers toward $N, "
                       "sending out a corkscrew beam. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_SKILL, "$n puts two fingers to $s forehead as crackling energy gathers at their tips.", ch, NULL, victim, TO_VICT );
	  act( AT_SKILL, "$n thrusts $s fingers toward $N, "
                       "sending out a corkscrew beam. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_SKILL, "$n puts two fingers to $s forehead as "
                       "crackling energy gathers at their tips.", ch, NULL, victim, TO_NOTVICT );
	  act( AT_SKILL, "$n throws $s fingers toward $N "
                       "sending out a corkscrew beam. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
        dam = ki_absorb( victim, ch, dam, gsn_sbc );
	  learn_from_success( ch, gsn_sbc );
	  global_retcode = damage( ch, victim, dam, TYPE_HIT );
      }
      else
      {
	  act( AT_SKILL, "You missed $N with your special beam cannon.", ch, NULL, victim, TO_CHAR );
	  act( AT_SKILL, "$n misses you with $s special beam cannon.", ch, NULL, victim, TO_VICT );
	  act( AT_SKILL, "$n missed $N with a special beam cannon.", ch, NULL, victim, TO_NOTVICT );
	  learn_from_failure( ch, gsn_sbc );
	  global_retcode = damage( ch, victim, 0, TYPE_HIT );
      }
    }
    else
    {
      if ( can_use_skill(ch, number_percent(),gsn_genie_signature ) )
      {
	  dam = get_attmod(ch, victim) * number_range( 22, 26 );
	  if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	  act( AT_PINK, "You put two fingers to your forehead, crackling energy gathering at their tips.", ch, NULL, victim, TO_CHAR );
	  act( AT_PINK, "Your thrust your fingers toward $N, "
                       "sending out a corkscrew beam. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_PINK, "$n puts two fingers to $s forehead as crackling energy gathers at their tips.", ch, NULL, victim, TO_VICT );
	  act( AT_PINK, "$n thrusts $s fingers toward $N, "
                       "sending out a corkscrew beam. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_PINK, "$n puts two fingers to $s forehead as "
                       "crackling energy gathers at their tips.", ch, NULL, victim, TO_NOTVICT );
	  act( AT_PINK, "$n throws $s fingers toward $N "
                       "sending out a corkscrew beam. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
        dam = ki_absorb( victim, ch, dam, gsn_sbc );
	  learn_from_success( ch, gsn_genie_signature );
	  global_retcode = damage( ch, victim, dam, TYPE_HIT );
      }
      else
      {
	  act( AT_PURPLE, "You missed $N with your special beam cannon.", ch, NULL, victim, TO_CHAR );
	  act( AT_PURPLE, "$n misses you with $s special beam cannon.", ch, NULL, victim, TO_VICT );
	  act( AT_PURPLE, "$n missed $N with a special beam cannon.", ch, NULL, victim, TO_NOTVICT );
	  learn_from_failure( ch, gsn_genie_signature );
	  global_retcode = damage( ch, victim, 0, TYPE_HIT );
      }
    }

	ch->mana -= skill_table[gsn_sbc]->min_mana;
    return;
}

void do_dd(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_dd]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

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

	if ( ch->mana < skill_table[gsn_dd]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_dd]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_dd]->focus;

    WAIT_STATE( ch, skill_table[gsn_dd]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_dd ) )
    {
	dam = get_attmod(ch, victim) * number_range( 12, 18 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
/*	act( AT_SKILL, "You hold your arm above your head and create a spinning ki disk.", ch, NULL, victim, TO_CHAR );
 *	act( AT_SKILL, "You throw it at $N, and it spins toward $m. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
 *	act( AT_SKILL, "$n holds $s arm above $s head and creates a spinning ki disk.", ch, NULL, victim, TO_VICT );
 *	act( AT_SKILL, "$n throws it at you, and it spins toward you. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
 *	act( AT_SKILL, "$n holds $s arm above $s head and creates a spinning ki disk.", ch, NULL, victim, TO_NOTVICT );
 *	act( AT_SKILL, "$n throws it at $N, and it spins toward $N. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );*/

	act( AT_SKILL, "You hold your hand aloft and create a spinning ki disk above your palm.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "You throw the whirling disk and it quickly "
                       "slices through the air on its way to $N. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_SKILL, "$n holds $s hand aloft and creates a spinning ki disk above $s palm.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n the whirling disk and it quickly slices "
                       "through the air on its way to you. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	act( AT_SKILL, "$n holds $s hand aloft and creates a spinning ki disk above $s palm.", ch, NULL, victim, TO_NOTVICT );
	act( AT_SKILL, "$n throws the whirling disk and it quickly "
                       "slices through the air on its way to $N. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	learn_from_success( ch, gsn_dd );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You missed $N with your destructo disk.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n misses you with $s destructo disk.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n missed $N with a destructo disk.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_dd );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= skill_table[gsn_dd]->min_mana;
    return;
}

void do_ff(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

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

    if ((ch->race == 9)
    &&   (ch->exp < skill_table[gsn_genie_finisher]->skill_level[ch->class]) )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }
    else
    {
      if ( (!IS_NPC(ch))
      &&   (ch->exp < skill_table[gsn_ff]->skill_level[ch->class]) )
      {
	  send_to_char( "You can't do that.\n\r", ch );
	  return;
      }
    }

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

	if ( ch->mana < skill_table[gsn_ff]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_ff]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_ff]->focus;

    WAIT_STATE( ch, skill_table[gsn_ff]->beats );
    if (ch->race != 9)
    {
      if ( can_use_skill(ch, number_percent(),gsn_ff ) )
      {
	  dam = get_attmod(ch, victim) * number_range( 56, 62 );
	  if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	  act( AT_SKILL, "Your body begins to surge with power, arms outstretched. Bringing your hands together, a clang like echo is heard all around the area. ", ch, NULL, victim, TO_CHAR );
	  act( AT_SKILL, "A swirling vortex of sparkling energy gathers then disappears into your hands, exploding forth like a raging storm towards $N. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_SKILL, "$n begins to surge with power, arms outstretched. Bringing $s hands together, a clang like echo is heard all around the area. ", ch, NULL, victim, TO_VICT );
	  act( AT_SKILL, "A swirling vortex of sparkling energy gathers then disappears into $s hands, exploding forth like a raging storm towards you. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_SKILL, "$n begins to surge with power, arms outstretched. Bringing $s hands together, a clang like echo is heard all around the area. ", ch, NULL, victim, TO_NOTVICT );
	  act( AT_SKILL, "A swirling vortex of sparkling energy gathers then disappears into $s hands, exploding forth like a raging storm towards $N. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

        dam = ki_absorb( victim, ch, dam, gsn_ff );
	  learn_from_success( ch, gsn_ff );
	  global_retcode = damage( ch, victim, dam, TYPE_HIT );
      }
      else
      {
	  act( AT_SKILL, "You missed $N with your final flash.", ch, NULL, victim, TO_CHAR );
	  act( AT_SKILL, "$n misses you with $s final flash.", ch, NULL, victim, TO_VICT );
	  act( AT_SKILL, "$n missed $N with a final flash.", ch, NULL, victim, TO_NOTVICT );
	  learn_from_failure( ch, gsn_ff );
	  global_retcode = damage( ch, victim, 0, TYPE_HIT );
      }
    }
    else
    {
      if ( can_use_skill(ch, number_percent(),gsn_genie_finisher ) )
      {
	  dam = get_attmod(ch, victim) * number_range( 56, 62 );
	  if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	  act( AT_PINK, "Your body begins to surge with power, arms outstretched. Bringing your hands together, a clang like echo is heard all around the area. ", ch, NULL, victim, TO_CHAR );
	  act( AT_PINK, "A swirling vortex of sparkling energy gathers then disappears into your hands, exploding forth like a raging storm towards $N. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_PINK, "$n begins to surge with power, arms outstretched. Bringing $s hands together, a clang like echo is heard all around the area. ", ch, NULL, victim, TO_VICT );
	  act( AT_PINK, "A swirling vortex of sparkling energy gathers then disappears into $s hands, exploding forth like a raging storm towards you. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_PINK, "$n begins to surge with power, arms outstretched. Bringing $s hands together, a clang like echo is heard all around the area. ", ch, NULL, victim, TO_NOTVICT );
	  act( AT_PINK, "A swirling vortex of sparkling energy gathers then disappears into $s hands, exploding forth like a raging storm towards $N. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

        dam = ki_absorb( victim, ch, dam, gsn_ff );
	  learn_from_success( ch, gsn_genie_finisher );
	  global_retcode = damage( ch, victim, dam, TYPE_HIT );
      }
      else
      {
	  act( AT_PURPLE, "You missed $N with your final flash.", ch, NULL, victim, TO_CHAR );
	  act( AT_PURPLE, "$n misses you with $s final flash.", ch, NULL, victim, TO_VICT );
	  act( AT_PURPLE, "$n missed $N with a final flash.", ch, NULL, victim, TO_NOTVICT );
	  learn_from_failure( ch, gsn_genie_finisher );
	  global_retcode = damage( ch, victim, 0, TYPE_HIT );
      }
    }

	ch->mana -= skill_table[gsn_ff]->min_mana;
    return;
}

void do_suppress(CHAR_DATA *ch, char *argument )
{
	long double arg = 0;

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

	if (argument[0] != '\0')
	{
		arg = is_number( argument ) ? atof( argument ) : -1;
		if ( atof(argument) < -1 && arg == -1 )
			arg = atof(argument);

		if (arg < 1)
		{
		    send_to_char( "You can not set your suppress level lower than 1.\n\r", ch );
		    return;
		}

		if (arg > ch->exp)
		{
		    send_to_char( "You can not set your suppress level higher than your base power.\n\r", ch );
		    return;
		}

		ch->pcdata->suppress = arg;
	    send_to_char( "Okay.  Suppress level set.\n\r", ch );
	    return;
	}

	if ( ch->mana < skill_table[gsn_suppress]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}

	if (ch->position == POS_EVASIVE || ch->position == POS_DEFENSIVE
		|| ch->position == POS_AGGRESSIVE || ch->position == POS_BERSERK
		|| ch->position == POS_FIGHTING)
	{
	    send_to_char( "You can't suppress while in battle.\n\r", ch );
	    return;
	}

    WAIT_STATE( ch, skill_table[gsn_suppress]->beats );

	if ( can_use_skill(ch, number_percent(), gsn_suppress ) )
	{
	if (ch->exp != ch->pl && xIS_SET(ch->affected_by, AFF_OOZARU))
	{
		send_to_char( "You can't while you are an Oozaru.\n\r", ch );
		return;
	}
	if ( xIS_SET((ch)->affected_by, AFF_SSJ)
		|| xIS_SET((ch)->affected_by, AFF_USSJ)
		|| xIS_SET((ch)->affected_by, AFF_USSJ2)
		|| xIS_SET((ch)->affected_by, AFF_SSJ2)
		|| xIS_SET((ch)->affected_by, AFF_SSJ3)
		|| xIS_SET((ch)->affected_by, AFF_SSJ4)
		|| xIS_SET((ch)->affected_by, AFF_KAIOKEN)
		|| xIS_SET((ch)->affected_by, AFF_HYPER)
		|| xIS_SET((ch)->affected_by, AFF_EXTREME)
		|| xIS_SET((ch)->affected_by, AFF_SNAMEK)
		|| xIS_SET((ch)->affected_by, AFF_ICER2)
		|| xIS_SET((ch)->affected_by, AFF_ICER3)
		|| xIS_SET((ch)->affected_by, AFF_ICER4)
		|| xIS_SET((ch)->affected_by, AFF_ICER5)
                || xIS_SET((ch)->affected_by, AFF_SEMIPERFECT )
                || xIS_SET((ch)->affected_by, AFF_PERFECT )
                || xIS_SET((ch)->affected_by, AFF_ULTRAPERFECT )
		|| xIS_SET((ch)->affected_by, AFF_MYSTIC)
                || xIS_SET((ch)->affected_by, AFF_EVILBOOST)
                || xIS_SET((ch)->affected_by, AFF_EVILSURGE)
                || xIS_SET((ch)->affected_by, AFF_EVILOVERLOAD)
                || xIS_SET((ch)->affected_by, AFF_EVIL_TRANS)
                || xIS_SET((ch)->affected_by, AFF_KID_TRANS)
                || xIS_SET((ch)->affected_by, AFF_SUPER_TRANS) )
		{
		if (xIS_SET((ch)->affected_by, AFF_SSJ))
                {
			xREMOVE_BIT((ch)->affected_by, AFF_SSJ);
                        if( !IS_NPC( ch ) )
                        {
                          ch->pcdata->haircolor = ch->pcdata->orignalhaircolor;
                          ch->pcdata->eyes      = ch->pcdata->orignaleyes;
                        }
                }
		if (xIS_SET((ch)->affected_by, AFF_USSJ))
			xREMOVE_BIT((ch)->affected_by, AFF_USSJ);
		if (xIS_SET((ch)->affected_by, AFF_USSJ2))
			xREMOVE_BIT((ch)->affected_by, AFF_USSJ2);
		if (xIS_SET((ch)->affected_by, AFF_SSJ2))
			xREMOVE_BIT((ch)->affected_by, AFF_SSJ2);
		if (xIS_SET((ch)->affected_by, AFF_SSJ3))
			xREMOVE_BIT((ch)->affected_by, AFF_SSJ3);
		if (xIS_SET((ch)->affected_by, AFF_SSJ4))
			xREMOVE_BIT((ch)->affected_by, AFF_SSJ4);
		if (xIS_SET((ch)->affected_by, AFF_KAIOKEN))
			xREMOVE_BIT((ch)->affected_by, AFF_KAIOKEN);
		if (xIS_SET((ch)->affected_by, AFF_SNAMEK))
			xREMOVE_BIT((ch)->affected_by, AFF_SNAMEK);
		if (xIS_SET((ch)->affected_by, AFF_EXTREME))
			xREMOVE_BIT((ch)->affected_by, AFF_EXTREME);
		if (xIS_SET((ch)->affected_by, AFF_HYPER))
			xREMOVE_BIT((ch)->affected_by, AFF_HYPER);
		if (xIS_SET((ch)->affected_by, AFF_ICER2))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER2);
		if (xIS_SET((ch)->affected_by, AFF_ICER3))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER3);
		if (xIS_SET((ch)->affected_by, AFF_ICER4))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER4);
		if (xIS_SET((ch)->affected_by, AFF_ICER5))
			xREMOVE_BIT((ch)->affected_by, AFF_ICER5);
		if (xIS_SET((ch)->affected_by, AFF_SEMIPERFECT))
			xREMOVE_BIT((ch)->affected_by, AFF_SEMIPERFECT);
		if (xIS_SET((ch)->affected_by, AFF_PERFECT))
			xREMOVE_BIT((ch)->affected_by, AFF_PERFECT);
		if (xIS_SET((ch)->affected_by, AFF_ULTRAPERFECT))
			xREMOVE_BIT((ch)->affected_by, AFF_ULTRAPERFECT);
		if (xIS_SET((ch)->affected_by, AFF_MYSTIC))
			xREMOVE_BIT((ch)->affected_by, AFF_MYSTIC);
		if (xIS_SET((ch)->affected_by, AFF_EVILBOOST))
			xREMOVE_BIT((ch)->affected_by, AFF_EVILBOOST);
                if (xIS_SET((ch)->affected_by, AFF_EVILSURGE))
                        xREMOVE_BIT((ch)->affected_by, AFF_EVILSURGE);
                if (xIS_SET((ch)->affected_by, AFF_EVILOVERLOAD))
                        xREMOVE_BIT((ch)->affected_by, AFF_EVILOVERLOAD);
		if (xIS_SET((ch)->affected_by, AFF_EVIL_TRANS))
			xREMOVE_BIT((ch)->affected_by, AFF_EVIL_TRANS);
                if (xIS_SET((ch)->affected_by, AFF_KID_TRANS))
                        xREMOVE_BIT((ch)->affected_by, AFF_KID_TRANS);
                if (xIS_SET((ch)->affected_by, AFF_SUPER_TRANS))
                        xREMOVE_BIT((ch)->affected_by, AFF_SUPER_TRANS);
		}
	ch->powerup = 0;
	send_to_pager_color( "&BYou power down and suppress your power.\n\r", ch );
	act( AT_BLUE, "$n takes a slow, deep breath and exhales calmly.", ch, NULL, NULL, TO_NOTVICT );
	if (xIS_SET((ch)->affected_by, AFF_HEART))
		xREMOVE_BIT(ch->affected_by, AFF_HEART);
	if ( ch->pcdata->suppress < 1 || ch->pcdata->suppress > ch->exp)
		ch->pcdata->suppress = ch->exp;

	ch->pl = ch->pcdata->suppress;
	transStatRemove(ch);
	xSET_BIT( ch->affected_by, AFF_SUPPRESS );
	heart_calc(ch, "");
	learn_from_success( ch, gsn_suppress );
    }
	else
	{
		act( AT_SKILL, "You try but can't seem to suppress your power.", ch, NULL, NULL, TO_CHAR );
		learn_from_failure( ch, gsn_suppress );
    }

	ch->mana -= skill_table[gsn_suppress]->min_mana;
	return;

}

void do_meditate(CHAR_DATA *ch, char *argument )
{
	float left = 0;
	float right = 0;

	if (IS_NPC(ch))
		return;

	left = (float) ch->mana / ch->max_mana;
	right = (float) ch->pcdata->learned[gsn_meditate] / 100;

	if (ch->fighting)
	{
		send_to_char( "&wYou can't concentrate enough for that.\n\r", ch );
		return;
	}

	if (left >= right)
	{
		send_to_char( "&wYou are already at peace with everything.\n\r", ch );
		return;
	}

    switch( ch->substate )
    {
	default:
	  if ( IS_NPC(ch)  && IS_AFFECTED( ch, AFF_CHARM ) )
	  {
	    send_to_char( "&wYou can't concentrate enough for that.\n\r", ch );
	    return;
	  }
          if ( ch->mount )
	  {
	    send_to_char( "&wYou can't do that while mounted.\n\r", ch );
	    return;
	  }
	  add_timer( ch, TIMER_DO_FUN, number_range(1, 3), do_meditate, 1);
	  send_to_char( "&wYou begin to meditate...\n\r", ch );
 	  act( AT_PLAIN, "$n begins to meditate...", ch, NULL, NULL, TO_ROOM );
	  return;

	case 1:
	if (ch->fighting)
	{
		send_to_char( "&wYou stop meditating...\n\r", ch );
		act( AT_PLAIN, "$n stops meditating...", ch, NULL, NULL, TO_ROOM );
		return;
	}

	if ( can_use_skill( ch, number_percent(), gsn_meditate ) )
	{
		send_to_char( "&wYou meditate peacefully, collecting energy from the cosmos\n\r", ch );
		learn_from_success( ch, gsn_meditate );
		ch->mana +=  (float) right / 50 * ch->max_mana;
	}
	else
	{
		send_to_char( "&wYou spend several minutes in deep concentration, but fail to collect any energy.\n\r", ch );
		learn_from_failure( ch, gsn_meditate );
    }

	if (left >= right)
	{
		send_to_char( "&wYou are now at peace with everything.\n\r", ch );
		return;
	}

		add_timer( ch, TIMER_DO_FUN, number_range(1, 3), do_meditate, 2);
	    return;
	case 2:
	if (ch->fighting)
	{
		send_to_char( "&wYou stop meditating...\n\r", ch );
		act( AT_PLAIN, "$n stops meditating...", ch, NULL, NULL, TO_ROOM );
		return;
	}

	if ( can_use_skill( ch, number_percent(), gsn_meditate ) )
	{
		send_to_char( "&wYou meditate peacefully, collecting energy from the cosmos\n\r", ch );
		learn_from_success( ch, gsn_meditate );
		ch->mana +=  (float) right / 50 * ch->max_mana;
	}
	else
	{
		send_to_char( "&wYou spend several minutes in deep concentration, but fail to collect any energy.\n\r", ch );
		learn_from_failure( ch, gsn_meditate );
    }

	if (left >= right)
	{
		send_to_char( "&wYou are now at peace with everything.\n\r", ch );
		return;
	}

		add_timer( ch, TIMER_DO_FUN, number_range(1, 3), do_meditate, 1);
	    return;
	case SUB_TIMER_DO_ABORT:
	  ch->substate = SUB_NONE;
	  send_to_char( "&wYou stop meditating...\n\r", ch );
	  act( AT_PLAIN, "$n stops meditating...", ch, NULL, NULL, TO_ROOM );
	  return;
    }
	return;
}

void do_scatter_shot(CHAR_DATA *ch, char *arg )
{
	char buf[MAX_STRING_LENGTH];
	char buf2[MAX_STRING_LENGTH];
	CHAR_DATA *victim;
	int shot = 0;
	int shots = 0;
	int dam = 0;
	int energy = 0;
	int damPerShot = 0;



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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_scatter_shot]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

	if ( arg[0] == '\0' || atoi(arg) <= 0)
    	{
		send_to_char( "Syntax: scatter <# of Shots>\n\r", ch );
		return;
    	}

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

	shot = atoi(arg);
	if (shot > 50)
		shot = 50;
	energy = shot * skill_table[gsn_scatter_shot]->min_mana;
	shots = shot;
	strcpy(buf, num_punct(shot));

	if ( ch->mana < energy )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < (skill_table[gsn_scatter_shot]->focus * (1+(shot/10))))
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= (skill_table[gsn_scatter_shot]->focus * (1+(shot/10)));

    WAIT_STATE( ch, (skill_table[gsn_scatter_shot]->beats * (1+(shot/10))) );
    if ( can_use_skill(ch, number_percent(),gsn_scatter_shot ) )
    {
	while (shots > 0)
	{
		switch (number_range( 1, 4))
		{
			default:
			case 1:
				break;
			case 2:
			case 3:
				dam += number_range( 0, 1 );
				break;
			case 4:
				dam += number_range( 0, 2 );
				break;
		}
		shots--;
	}
//	strcpy(buf2, num_punct(dam));
        damPerShot = number_range(1, 3);
	strcpy(buf2, num_punct(get_attmod(ch, victim) * dam * damPerShot ));

	act( AT_SKILL, "You power up and yell, 'SCATTER SHOT!'", ch, NULL, victim, TO_CHAR );
	act2( AT_SKILL, "You launch a barrage of $t energy balls towards $N, "
                        "all exploding on contact. &W[$T]", ch, buf, victim, TO_CHAR, buf2 );
	act( AT_SKILL, "$n powers up and yells, 'SCATTER SHOT!'", ch, NULL, victim, TO_VICT );
	act2( AT_SKILL, "$e launches a barrage of $t energy balls towards you, "
                        "all exploding on contact. &W[$T]", ch, buf, victim, TO_VICT, buf2 );
	act( AT_SKILL, "$n powers up and yells, 'SCATTER SHOT!'", ch, NULL, victim, TO_NOTVICT );
	act2( AT_SKILL, "$e launches a barrage of $t energy balls towards $N, "
                        "all exploding on contact. &W[$T]", ch, buf, victim, TO_NOTVICT, buf2 );

	learn_from_success( ch, gsn_scatter_shot );
	global_retcode = damage( ch, victim, (get_attmod(ch, victim) * dam * damPerShot), TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You launch a barrage of $t energy balls towards $N but $E is to fast to hit.", ch, buf, victim, TO_CHAR );
	act( AT_SKILL, "$n launches a barrage of $t energy balls towards $N but you are to fast to hit.", ch, buf, victim, TO_VICT );
	act( AT_SKILL, "$n launches a barrage of $t energy balls towards $N but $E is to fast to hit.", ch, buf, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_scatter_shot );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= energy;
    return;
}

void do_sense( CHAR_DATA *ch, char *argument )
{
    char arg[MAX_INPUT_LENGTH];
    CHAR_DATA *victim;
    char *msg;
    long double diff;

    one_argument( argument, arg );

    if ( arg[0] == '\0' )
    {
	send_to_char( "Sense whos power?\n\r", ch );
	return;
    }

    if ( ( victim = get_char_room( ch, arg ) ) == NULL )
    {
	send_to_char( "They must be too far away for you to sense.\n\r", ch );
	return;
    }
    if ( victim == ch )
    {
	pager_printf_color( ch, "You would get slaughtered in a battle against %s.\n\r", himher(ch, FALSE) );
	return;
    }

	if (victim->race == 4)
    {
	pager_printf_color( ch, "You can't sense any thing from %s.\n\r", himher(ch, FALSE) );
	return;
    }

    WAIT_STATE( ch, skill_table[gsn_sense]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_sense ) )
	{
    if (!IS_NPC(victim))
    	diff = (long double) victim->pl / ch->pl * 10;
    else
    	diff = (long double) victim->exp / ch->pl * 10;

	if ( diff < 1 ) msg = "$N has power... to sense? LOL! That's a good one!";
    else if ( diff <=   1 ) msg = "That fly buzzing around would be more challenging.";
    else if ( diff <=   2 ) msg = "Now where did that chicken go?";
    else if ( diff <=   3 ) msg = "You sense a feeble power coming from $N.";
    else if ( diff <=   4 ) msg = "You sense a laughable power coming from $N.";
    else if ( diff <=   5 ) msg = "You sense a very small power coming from $N.";
    else if ( diff <=   6 ) msg = "You sense an insignificant power coming from $N.";
    else if ( diff <=   7 ) msg = "You sense a small power coming from $N.";
    else if ( diff <=   8 ) msg = "You sense a minor power coming from $N.";
    else if ( diff <=   9 ) msg = "You sense a lesser power coming from $N.";
    else if ( diff <=  10 ) msg = "$E seems to be about as strong as you.";
    else if ( diff <=  20 ) msg = "You sense a greater power coming from $N.";
    else if ( diff <=  30 ) msg = "You sense a significant power coming from $N.";
    else if ( diff <=  40 ) msg = "You sense a substantial power coming from $N.";
    else if ( diff <=  50 ) msg = "You sense an imposing power coming from $N.";
    else if ( diff <=  60 ) msg = "You sense a disturbing power coming from $N.";
    else if ( diff <=  70 ) msg = "You sense a frightening power coming from $N.";
    else if ( diff <=  80 ) msg = "You sense a horrifying power coming from $N.";
    else if ( diff <=  90 ) msg = "Do you feel lucky, punk?";
    else if ( diff <= 100 ) msg = "Some times, talking is the best answer...";
    else if ( diff <= 250 ) msg = "Just walk away...";
    else if ( diff <= 500 ) msg = "Are you mad!?";
    else if ( diff <= 750 ) msg = "You ARE mad!";
    else if ( diff <= 1000 ) msg = "Why don't you dig a grave for yourself first?";
    else                    msg = "What do you want on your tombstone?";
    act( AT_CONSIDER, msg, ch, NULL, victim, TO_CHAR );
	learn_from_success( ch, gsn_sense );
	}
    else
    {
	pager_printf_color(ch, "You try, but you sense nothing from %s.\n\r", himher(victim, FALSE) );
	learn_from_failure( ch, gsn_sense );
	}

    return;
}

void do_ddd(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

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

    if ( !IS_NPC(ch) && ch->exp < skill_table[gsn_ddd]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
	}

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

	if ( ch->mana < skill_table[gsn_ddd]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_ddd]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_ddd]->focus;

    WAIT_STATE( ch, skill_table[gsn_ddd]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_ddd ) )
    {
	switch (number_range(1,100))
	{
    case 100:
 	if (IS_NPC(victim) || (!IS_NPC(victim) && (!xIS_SET(ch->act, PLR_SPAR) || !xIS_SET(ch->act, PLR_SPAR) )))
 	{

		/* Redone so that instant death can't be abused to instant kill
		 * players over 2x their power. -- Islvin
		 */
		if (victim->pl / ch->pl >= 2)
		{
			act( AT_SKILL, "You charge two spinning energy disks above your head and hurl them towards $N.", ch, NULL, victim, TO_CHAR );
			act( AT_SKILL, "They fly staight towards $N, but their damage is absorbed by $s powerful aura.", ch, NULL, victim, TO_CHAR );
			act( AT_SKILL, "$n charges two spinning energy disks above $s head and hurls them towards you.", ch, NULL, victim, TO_VICT );
			act( AT_SKILL, "They fly staight towards $N, but their damage is absorbed by $s powerful aura.", ch, NULL, victim, TO_VICT );
			act( AT_SKILL, "$n charges two spinning energy disks above $s head and hurl them towards $N.", ch, NULL, victim, TO_NOTVICT );
			act( AT_SKILL, "They fly staight towards $N, but their damage is absorbed by $s powerful aura.", ch, NULL, victim, TO_NOTVICT );
			dam = 0;
			break;
		}

/* Redone so it _is_ instant death -- Melora
 * 	if (victim->max_hit >= victim->hit)
 * 		dam = victim->max_hit * 2;
 * 	else
 * 		dam = victim->hit * 2;
 */
		dam = 999999999;
	act( AT_SKILL, "You charge two spinning energy disks above your head and hurl them towards $N.", ch, NULL, victim, TO_CHAR );
	act( AT_RED, "THEY BOTH CUT STRAIGHT THROUGH $N!!!  Killing $M instantly.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n charges two spinning energy disks above $s head and hurls them towards you.", ch, NULL, victim, TO_VICT );
	act( AT_RED, "THEY BOTH CUT STRAIGHT THROUGH YOU!!!  Killing you instantly.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n charges two spinning energy disks above $s head and hurl them towards $N.", ch, NULL, victim, TO_NOTVICT );
	act( AT_RED, "THEY BOTH CUT STRAIGHT THROUGH $N!!!  Killing $M instantly.", ch, NULL, victim, TO_NOTVICT );

	learn_from_success( ch, gsn_ddd );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    break;
    }
	default:
	dam = get_attmod(ch, victim) * number_range( 24, 30 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	act( AT_SKILL, "You charge two spinning energy disks above your head and hurl them towards $N. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_SKILL, "$n charges two spinning energy disks above $s head and hurls them towards you. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	act( AT_SKILL, "$n charges two spinning energy disks above $s head and hurl them towards $N. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	learn_from_success( ch, gsn_ddd );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    break;
    }
    }
    else
    {
	act( AT_SKILL, "You missed $N with your dual destructo disk.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n misses you with $s dual destructo disk.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n missed $N with a dual destructo disk.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_ddd );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= skill_table[gsn_ddd]->min_mana;
    return;
}

void do_death_ball(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

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

    if ((ch->race == 9)
    &&   (ch->exp < skill_table[gsn_genie_finisher]->skill_level[ch->class]) )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }
    else
    {
      if ( (!IS_NPC(ch))
      &&   (ch->exp < skill_table[gsn_death_ball]->skill_level[ch->class]) )
      {
	  send_to_char( "You can't do that.\n\r", ch );
	  return;
      }
    }


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

	if ( ch->mana < skill_table[gsn_death_ball]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_death_ball]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_death_ball]->focus;

    WAIT_STATE( ch, skill_table[gsn_death_ball]->beats );
    if (ch->race != 9)
    {
      if ( can_use_skill(ch, number_percent(),gsn_death_ball ) )
      {
	  switch (number_range(1,100))
	  {
      case 100:
 	  if (IS_NPC(victim) || (!IS_NPC(victim) && (!xIS_SET(ch->act, PLR_SPAR) || !xIS_SET(ch->act, PLR_SPAR)) ))
 	  {

		/* Redone so it can't be used to kill players
		 * above 5x their pl. Was going to do 2x like
		 * DDD, but if I did that, it'd remove the challenge
		 * from Coolers. -- Islvin
		 */
		if (victim->pl / ch->pl >= 5)
		{
			act( AT_SKILL, "You charge a huge ball of energy on the tip of your finger and then direct it quickly towards $n.", ch, NULL, victim, TO_CHAR );
			act( AT_SKILL, "$n is enveloped by the death ball, but when all is done, seems unaffected.", ch, NULL, victim, TO_CHAR );
			act( AT_SKILL, "$n charges a huge ball of energy on the tip of $s finger and then directs it quickly towards you.", ch, NULL, victim, TO_VICT );
			act( AT_SKILL, "You are enveloped by the death ball, but seem unaffected when it's over.", ch, NULL, victim, TO_VICT );
			act( AT_SKILL, "$n charges a huge ball of energy on the tip of $s finger and then directs it quickly towards $N.", ch, NULL, victim, TO_NOTVICT );
			act( AT_RED, "$N is enveloped by the death ball, but when all is done, seems unaffected.", ch, NULL, victim, TO_NOTVICT );
			dam = 0;
			break;
		}

/* Redo damage so it _is_ instant death
 * Melora
 * 	if (victim->max_hit >= victim->hit)
 * 		dam = victim->max_hit * 2;
 * 	else
 * 		dam = victim->hit * 2;
 */
		dam = 999999999;
	  act( AT_SKILL, "You charge a huge ball of energy on the tip of your finger and then direct it quickly towards $N.", ch, NULL, victim, TO_CHAR );
	  act( AT_RED, "$N is slowly enveloped by the death ball, killing $M instantly.", ch, NULL, victim, TO_CHAR );
	  act( AT_SKILL, "$n charges a huge ball of energy on the tip of $s finger and then directs it quickly towards you.", ch, NULL, victim, TO_VICT );
	  act( AT_RED, "You are slowly enveloped by the death ball, killing you instantly.", ch, NULL, victim, TO_VICT );
	  act( AT_SKILL, "$n charges a huge ball of energy on the tip of $s finger and then directs it quickly towards $N.", ch, NULL, victim, TO_NOTVICT );
	  act( AT_RED, "$N is slowly enveloped by the death ball, killing $M instantly.", ch, NULL, victim, TO_NOTVICT );

	  learn_from_success( ch, gsn_death_ball );
	  global_retcode = damage( ch, victim, dam, TYPE_HIT );
      break;
	  }
	  default:
	  dam = get_attmod(ch, victim) * number_range( 55, 65 );
	  if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	  act( AT_SKILL, "You raise your arm to the heavens, palm open. A swirling vortex of hellish light gathers into a ball, hovering lifelessly above. You point, effortlessly, at $N sending them to their impending demise. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_SKILL, "$n raises $m arm to the heavens, palm open. A swirling vortex of hellish light gathers into a ball, hovering lifelessly above. $n points effortlessly, sending you to your impending demise. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_SKILL, "$n raises $m arm to the heavens, palm open. A swirling vortex of hellish light gathers into a ball, hovering lifelessly above. $n points effortlessly, at $N sending them to their impending demise. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

        dam = ki_absorb( victim, ch, dam, gsn_death_ball );
	  learn_from_success( ch, gsn_death_ball );
	  global_retcode = damage( ch, victim, dam, TYPE_HIT );
      break;
   	  }
      }
      else
      {
	  act( AT_SKILL, "You missed $N with your death ball.", ch, NULL, victim, TO_CHAR );
	  act( AT_SKILL, "$n misses you with $s death ball.", ch, NULL, victim, TO_VICT );
	  act( AT_SKILL, "$n missed $N with a death ball.", ch, NULL, victim, TO_NOTVICT );
	  learn_from_failure( ch, gsn_death_ball );
	  global_retcode = damage( ch, victim, 0, TYPE_HIT );
      }
    }
    else
    {
      if ( can_use_skill(ch, number_percent(),gsn_genie_finisher ) )
      {
	  switch (number_range(1,100))
	  {
      case 100:
 	  if (IS_NPC(victim) || (!IS_NPC(victim) && (!xIS_SET(ch->act, PLR_SPAR) || !xIS_SET(ch->act, PLR_SPAR)) ))
 	  {
		if (victim->pl / ch->pl >= 5)
		{
			act( AT_PINK, "You charge a huge ball of energy on the tip of your finger and then direct it quickly towards $n.", ch, NULL, victim, TO_CHAR );
			act( AT_PINK, "$n is enveloped by the death ball, but when all is done, seems unaffected.", ch, NULL, victim, TO_CHAR );
			act( AT_PINK, "$n charges a huge ball of energy on the tip of $s finger and then directs it quickly towards you.", ch, NULL, victim, TO_VICT );
			act( AT_PINK, "You are enveloped by the death ball, but seem unaffected when it's over.", ch, NULL, victim, TO_VICT );
			act( AT_PINK, "$n charges a huge ball of energy on the tip of $s finger and then directs it quickly towards $N.", ch, NULL, victim, TO_NOTVICT );
			act( AT_RED, "$N is enveloped by the death ball, but when all is done, seems unaffected.", ch, NULL, victim, TO_NOTVICT );
			dam = 0;
			break;
		}

		dam = 999999999;
	  act( AT_PINK, "You charge a huge ball of energy on the tip of your finger and then direct it quickly towards $N.", ch, NULL, victim, TO_CHAR );
	  act( AT_RED, "$N is slowly enveloped by the death ball, killing $M instantly.", ch, NULL, victim, TO_CHAR );
	  act( AT_PINK, "$n charges a huge ball of energy on the tip of $s finger and then directs it quickly towards you.", ch, NULL, victim, TO_VICT );
	  act( AT_RED, "You are slowly enveloped by the death ball, killing you instantly.", ch, NULL, victim, TO_VICT );
	  act( AT_PINK, "$n charges a huge ball of energy on the tip of $s finger and then directs it quickly towards $N.", ch, NULL, victim, TO_NOTVICT );
	  act( AT_RED, "$N is slowly enveloped by the death ball, killing $M instantly.", ch, NULL, victim, TO_NOTVICT );

	  learn_from_success( ch, gsn_genie_finisher );
	  global_retcode = damage( ch, victim, dam, TYPE_HIT );
      break;
	  }
	  default:
	  dam = get_attmod(ch, victim) * number_range( 55, 65 );
	  if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	  act( AT_PINK, "You raise your arm to the heavens, palm open. A swirling vortex of hellish light gathers into a ball, hovering lifelessly above. You point, effortlessly, at $N sending them to their impending demise. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_PINK, "$n raises $m arm to the heavens, palm open. A swirling vortex of hellish light gathers into a ball, hovering lifelessly above. $n points effortlessly, sending you to your impending demise. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_PINK, "$n raises $m arm to the heavens, palm open. A swirling vortex of hellish light gathers into a ball, hovering lifelessly above. $n points effortlessly, at $N sending them to their impending demise. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

        dam = ki_absorb( victim, ch, dam, gsn_death_ball );
	  learn_from_success( ch, gsn_genie_finisher );
	  global_retcode = damage( ch, victim, dam, TYPE_HIT );
      break;
   	  }
      }
      else
      {
	  act( AT_PURPLE, "You missed $N with your death ball.", ch, NULL, victim, TO_CHAR );
	  act( AT_PURPLE, "$n misses you with $s death ball.", ch, NULL, victim, TO_VICT );
	  act( AT_PURPLE, "$n missed $N with a death ball.", ch, NULL, victim, TO_NOTVICT );
	  learn_from_failure( ch, gsn_genie_finisher );
	  global_retcode = damage( ch, victim, 0, TYPE_HIT );
      }
    }
	  ch->mana -= skill_table[gsn_death_ball]->min_mana;
    return;
}

void do_eye_beam(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_eye_beam]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

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

	if ( ch->mana < skill_table[gsn_eye_beam]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_eye_beam]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_eye_beam]->focus;

    WAIT_STATE( ch, skill_table[gsn_eye_beam]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_eye_beam ) )
    {
	dam = get_attmod(ch, victim) * number_range( 12, 14 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	act( AT_SKILL, "Your eyes begin to glow as two beams shoot out from them at $N. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_SKILL, "$n's eyes begin to glow as two beams shoot out from them at you. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	act( AT_SKILL, "$n's eyes begin to glow as two beams shoot out from them at $N. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

        dam = ki_absorb( victim, ch, dam, gsn_eye_beam );
	learn_from_success( ch, gsn_eye_beam );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You missed $N with your eye beam.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n misses you with $s eye beam.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n missed $N with a eye beam.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_eye_beam );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= skill_table[gsn_eye_beam]->min_mana;
    return;
}

void do_finger_beam(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

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

    if ((ch->race == 9)
    &&   (ch->exp < skill_table[gsn_genie_signature]->skill_level[ch->class]) )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }
    else
    {
      if ( (!IS_NPC(ch))
      &&   (ch->exp < skill_table[gsn_finger_beam]->skill_level[ch->class]) )
      {
	  send_to_char( "You can't do that.\n\r", ch );
	  return;
      }
    }

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

	if ( ch->mana < skill_table[gsn_finger_beam]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_finger_beam]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_finger_beam]->focus;

    WAIT_STATE( ch, skill_table[gsn_finger_beam]->beats );
    if (ch->race != 9)
    {
      if ( can_use_skill(ch, number_percent(),gsn_finger_beam ) )
      {
	  dam = get_attmod(ch, victim) * number_range( 16, 22 );
	  if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	  act( AT_SKILL, "You point your hand towards $N, firing a beam of pink energy from the tip of your finger. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_SKILL, "$n points $s hand towards you, firing a beam of pink energy from the tip of $s finger. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_SKILL, "$n points $s hand towards $N, firing a beam of pink energy from the tip of $s finger. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

        dam = ki_absorb( victim, ch, dam, gsn_finger_beam );
	  learn_from_success( ch, gsn_finger_beam );
	  global_retcode = damage( ch, victim, dam, TYPE_HIT );
      }
      else
      {
	  act( AT_SKILL, "You missed $N with your finger beam.", ch, NULL, victim, TO_CHAR );
	  act( AT_SKILL, "$n misses you with $s finger beam.", ch, NULL, victim, TO_VICT );
	  act( AT_SKILL, "$n missed $N with a finger beam.", ch, NULL, victim, TO_NOTVICT );
	  learn_from_failure( ch, gsn_finger_beam );
	  global_retcode = damage( ch, victim, 0, TYPE_HIT );
      }
    }
    else
    {
      if ( can_use_skill(ch, number_percent(),gsn_genie_signature ) )
      {
	  dam = get_attmod(ch, victim) * number_range( 16, 22 );
	  if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	  act( AT_PINK, "You point your hand towards $N, firing a beam of pink energy from the tip of your finger. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_PINK, "$n points $s hand towards you, firing a beam of pink energy from the tip of $s finger. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_PINK, "$n points $s hand towards $N, firing a beam of pink energy from the tip of $s finger. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

        dam = ki_absorb( victim, ch, dam, gsn_finger_beam );
	  learn_from_success( ch, gsn_genie_signature );
	  global_retcode = damage( ch, victim, dam, TYPE_HIT );
      }
      else
      {
	  act( AT_PURPLE, "You missed $N with your finger beam.", ch, NULL, victim, TO_CHAR );
	  act( AT_PURPLE, "$n misses you with $s finger beam.", ch, NULL, victim, TO_VICT );
	  act( AT_PURPLE, "$n missed $N with a finger beam.", ch, NULL, victim, TO_NOTVICT );
	  learn_from_failure( ch, gsn_genie_signature );
	  global_retcode = damage( ch, victim, 0, TYPE_HIT );
      }
    }

	ch->mana -= skill_table[gsn_finger_beam]->min_mana;
    return;
}

void do_tribeam(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_tribeam]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

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

	if ( ch->mana < skill_table[gsn_tribeam]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_tribeam]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_tribeam]->focus;

    WAIT_STATE( ch, skill_table[gsn_tribeam]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_tribeam ) )
    {
	dam = get_attmod(ch, victim) * number_range( 65, 75 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	act( AT_SKILL, "You form your fingers and thumbs into a triangle, lining up $N in your sights. You mentally zoom in on them, focusing all your inner ki into this finishing blast.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "The powerful energy gathers in the triangle-shaped void between your hands. You yell out, \"TRI-BEAM\" sending an ultra powerful beam of energy too quick to spot at $N. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_SKILL, "$n forms $s fingers and thumbs into a triangle, lining you up in $s sights. $e seems to go into a trance-like state as massive energy charges into the space between $s hands.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "The powerful energy gathers in the triange-shaped void between $n's hands. $e yells out, \"TRI-BEAM\", hitting you with a shockingly powerful beam of energy. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	act( AT_SKILL, "$n forms $s fingers and thumbs into a triangle, lining $N up in $s sights. $e seems to go into a trance-like state as massive energy charges into the space between $s hands.", ch, NULL, victim, TO_NOTVICT );
	act( AT_SKILL, "The powerful energy gathers in the triange-shaped void between $n's hands. $e yells out, \"TRI-BEAM\", hitting $N with a massive beam of invisible energy. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	learn_from_success( ch, gsn_tribeam );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You missed $N with your tri-beam attack.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n misses you with $s tri-beam attack.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n missed $N with a tri-beam attack.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_tribeam );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= skill_table[gsn_tribeam]->min_mana;
    return;
}

void do_solar_flare(CHAR_DATA *ch, char *argument )
{
	AFFECT_DATA af;
	CHAR_DATA *vch, *vch_next;

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_solar_flare]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }
    if ( xIS_SET(ch->in_room->room_flags, ROOM_ARENA)
      || xIS_SET(ch->in_room->room_flags, ROOM_SAFE))
    {
      send_to_char( "There's no need to use that here.\n\r", ch );
      return;
    }
    if ( who_fighting( ch ) == NULL )
    {
	send_to_char( "You aren't fighting anyone.\n\r", ch );
	return;
    }
	if ( ch->mana < skill_table[gsn_solar_flare]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_solar_flare]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_solar_flare]->focus;

    WAIT_STATE( ch, skill_table[gsn_solar_flare]->beats );

    if ( can_use_skill(ch, number_percent(),gsn_solar_flare ) )
    {
	act( AT_SKILL, "You put your hands to your face and yell out 'SOLAR FLARE!' emitting a blinding flash of light.", ch, NULL, NULL, TO_CHAR );
	act( AT_SKILL, "$n puts $s hands to $s face and yells out 'SOLAR FLARE!' blinding everyone in the room!", ch, NULL, NULL, TO_NOTVICT );

	learn_from_success( ch, gsn_solar_flare );
    for ( vch = ch->in_room->first_person; vch; vch = vch_next )
    {

	vch_next = vch->next_in_room;
        if( !IS_AWAKE( vch ) )
          continue;

        if( number_range( 1, 100 ) < ( get_curr_int( vch ) / 10 ) )
        {
          send_to_char( "You manage to look away at the last moment and shield "
                        "your eyes.\n\r", vch );
          continue;
        }

	if (ch != vch)
	{
		af.type      = gsn_solar_flare;
		af.duration  = 5;
                af.location  = APPLY_HITROLL;
                af.modifier  = -6;
		af.bitvector = meb(AFF_BLIND);
		affect_to_char( vch, &af );
	}

    }

    }
    else
    {
	act( AT_SKILL, "You put your hands to your face but forget the words.  Nothing happens.", ch, NULL, NULL, TO_CHAR );
	act( AT_SKILL, "$n raises $s hands to $s head, gets a stupid look on $s face, then stands there.", ch, NULL, NULL, TO_NOTVICT );
	learn_from_failure( ch, gsn_solar_flare );
    }
	ch->mana -= skill_table[gsn_solar_flare]->min_mana;
	return;
}

void do_hyper(CHAR_DATA *ch, char *argument )
{
	if (xIS_SET((ch)->affected_by, AFF_HYPER))
	    {
		send_to_char( "You power down and return to normal.\n\r", ch );
		xREMOVE_BIT((ch)->affected_by, AFF_HYPER);
		ch->pl = ch->exp;
		transStatRemove(ch);
		return;
    	}

	if (xIS_SET((ch)->affected_by, AFF_EXTREME))
    {
		send_to_char( "You can't use the hyper technique while using extreme.\n\r", ch );
		return;
	}

	if (xIS_SET((ch)->affected_by, AFF_KAIOKEN))
    {
		send_to_char( "You can't use the hyper technique while using kaioken.\n\r", ch );
		return;
	}
	if ( ch->mana < skill_table[gsn_hyper]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
    WAIT_STATE( ch, skill_table[gsn_hyper]->beats );
	if ( can_use_skill(ch, number_percent(), gsn_hyper ) )
	{
	act( AT_SKILL, "You clench your fists and yell out as all your muscles bulge and your aura explodes outward.", ch, NULL, NULL, TO_CHAR );
	act( AT_SKILL, "$n clenches $s fists and yells out as all of $s muscles bulge and $s aura explodes outward.", ch, NULL, NULL, TO_NOTVICT );
	xSET_BIT( (ch)->affected_by, AFF_HYPER );
	if (xIS_SET((ch)->affected_by, AFF_HEART))
		xREMOVE_BIT(ch->affected_by, AFF_HEART);
	ch->pl = ch->exp * 16;
	transStatApply(ch, 18, 12, 6, 24);
	heart_calc(ch, "");
	learn_from_success( ch, gsn_hyper );
    }
	else
	{
	act( AT_SKILL, "You clench your fists and yell out, but nothing happens.", ch, NULL, NULL, TO_CHAR );
	act( AT_SKILL, "$n clenchs $s fists and yells out, but nothing happens.", ch, NULL, NULL, TO_NOTVICT );
	learn_from_failure( ch, gsn_hyper );
    }

	ch->mana -= skill_table[gsn_hyper]->min_mana;
	return;
}

void do_instant_trans(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
	CHAR_DATA *fch;
	CHAR_DATA *fch_next;
	ROOM_INDEX_DATA *prev_room;

	if ( ch->mana < skill_table[gsn_instant_trans]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}

    if( ch->fighting )
    {
        send_to_char( "You can't find enough time to concentrate.\n\r", ch );
        return;
    }

    WAIT_STATE( ch, skill_table[gsn_instant_trans]->beats );

    if ( (victim = get_char_ki_world(ch, argument)) == NULL
    ||   !can_astral(ch, victim)
	||   !in_hard_range(ch, victim->in_room->area)
	||   !in_soft_range(ch, victim->in_room->area)
	||	 xIS_SET(victim->in_room->room_flags, ROOM_PROTOTYPE )
	||   victim->race == race_lookup( "android" )
	||   IS_IMMORTAL(victim) )
    {
	    send_to_char( "You can't seem to sense their energy anywhere.\n\r", ch );
		return;
    }


	if ( !IS_NPC(victim) && !victim->desc )
	{
		send_to_char("You cannot IT to someone who has lost link.\n\r",ch);
		return;
	}

	if ( can_use_skill(ch, number_percent(), gsn_instant_trans ) )
	{
	learn_from_success( ch, gsn_instant_trans );
	act( AT_MAGIC, "You disappear in a flash of light!", ch, NULL, NULL, TO_CHAR );
	act( AT_MAGIC, "$n disappears in a flash of light!", ch, NULL, NULL, TO_ROOM );
    prev_room = ch->in_room;
    char_from_room( ch );
    if ( ch->mount )
    {
		char_from_room( ch->mount );
		char_to_room( ch->mount, victim->in_room );
    }
    char_to_room( ch, victim->in_room );
    for ( fch = prev_room->first_person; fch; fch = fch_next )
    {
		fch_next = fch->next_in_room;
		if ( ( fch != ch ) && fch->master && fch->master == ch )
        {
			char_from_room (fch);
	    	act( AT_ACTION, "You disappear in a flash of light!", fch, NULL, ch, TO_CHAR );
	    	act( AT_ACTION, "$n disappears in a flash of light!", fch, NULL, ch, TO_ROOM );
			char_to_room( fch, victim->in_room );
			act( AT_MAGIC, "You appear in a flash of light!", fch, NULL, ch, TO_CHAR );
		 	act( AT_MAGIC, "$n appears in a flash of light!", fch, NULL, ch, TO_ROOM );
		    do_look( fch, "auto" );
        }
    }
	act( AT_MAGIC, "You appear in a flash of light!", ch, NULL, NULL, TO_CHAR );
 	act( AT_MAGIC, "$n appears in a flash of light!", ch, NULL, NULL, TO_ROOM );
    do_look( ch, "auto" );
	}
	else
	{
	 	learn_from_failure( ch, gsn_instant_trans );
	    send_to_char( "&BYou can't seem to sense their energy anywhere.\n\r", ch );
	}

	ch->mana -= skill_table[gsn_instant_trans]->min_mana;
    return;

}

void chargeDrain(CHAR_DATA *ch)
{
    SKILLTYPE *skill = skill_table[ch->skillGsn];

	if(!skill)
	{
		bug("chargeDrain: no skill gsn. %s (sn %d)",ch->name,ch->skillGsn);
		return;
	}

	ch->mana -= skill->min_mana;
	ch->focus -= skill->focus / 2;
	ch->mana = URANGE(0, ch->mana, ch->max_mana);
	ch->focus = URANGE(0, ch->focus, get_curr_int(ch));
	return;
}
void do_charge(CHAR_DATA *ch, char *argument )
{
    char arg[MAX_INPUT_LENGTH];
    SKILLTYPE *skill = NULL;
	int chargeGsn = 0;

        if( IS_NPC( ch ) )
          return;

	if (ch->pcdata->learned[gsn_charge2] <= 0)
	{
		send_to_char( "&wYou must learn charge level 1 before you can charge attacks.\n\r", ch );
		return;
	}

	if (!ch->fighting && ch->charge > 0)
	{
		send_to_char( "&wHmm... you seem to have lost your victim...\n\r", ch );
		ch->substate = SUB_NONE;
		ch->skillGsn = -1;
		ch->charge = 0;
		ch->timerDelay = 0;
		ch->timerType = 0;
		ch->timerDo_fun = NULL;
		return;
	}

	if (!ch->fighting)
	{
		send_to_char( "&wYou aren't fighting anything.\n\r", ch );
		ch->substate = SUB_NONE;
		ch->skillGsn = -1;
		ch->charge = 0;
		ch->timerDelay = 0;
		ch->timerType = 0;
		ch->timerDo_fun = NULL;
		return;
	}

    one_argument( argument, arg );

    switch (ch->charge)
    {
    	case 0:
    		chargeGsn = gsn_charge2;
    		break;
    	case 1:
    		chargeGsn = gsn_charge2;
    		break;
    	case 2:
    		chargeGsn = gsn_charge3;
    		break;
    	case 3:
    		chargeGsn = gsn_charge4;
    		break;
    	case 4:
    		chargeGsn = gsn_charge5;
    		break;
    	default:
    		chargeGsn = -1;
    		break;
    }

	/* energy and focus checks for charge and the attack */

    switch( ch->substate )
    {
	default:
//		bug( "do_charge: illegal substate" );
		return;

	case SUB_NONE:
	if ( IS_NPC(ch)  && IS_AFFECTED( ch, AFF_CHARM ) )
	{
		send_to_char( "&wYou can't concentrate enough for that.\n\r", ch );
		return;
	}
	if ( ch->mount )
	{
		send_to_char( "&wYou can't do that while mounted.\n\r", ch );
		return;
	}
        if (  ch->position ==  POS_AGGRESSIVE
           || ch->position ==  POS_BERSERK
           )
        {
            send_to_char( "&wYou can't concentrate enough for that.\n\r", ch );
	    return;
        }

	ch->skillGsn = skill_lookup( arg );
	if ( ch->skillGsn > 0
        && ( ( ch->pcdata
            && ch->pcdata->learned[ch->skillGsn] > 0 ) ) )
        {
		skill = skill_table[ch->skillGsn];
        }
	else
	{
		send_to_char( "&wYou don't know any skill like that.\n\r", ch );
		return;
	}

	if (skill->canCharge == 0)
	{
		send_to_char( "&wYou can't charge that.\n\r", ch );
		return;
	}

	if (ch->mana < (skill->min_mana*2))
	{
		send_to_char( "&wYou need more energy before you can charge that.\n\r", ch );
		return;
	}
	if (ch->focus < (skill->focus*1.5))
	{
		send_to_char( "&wYou need to focus more before you can charge that.\n\r", ch );
		return;
	}

    WAIT_STATE( ch, 10 );
	ch->charge = 0;
	learn_from_success( ch, chargeGsn );
	ch->substate = SUB_CMD_LOOP_TIMER;
	ch->timerDelay = number_range(1,2);
	ch->timerType = 1;
	ch->timerDo_fun = do_charge;
	pager_printf(ch, "&wYou begin to charge your %s...\n\r", skill->name );
	act( AT_PLAIN, "$n begins to charge up an attack...", ch, NULL, NULL, TO_ROOM );
	return;

	case SUB_CMD_LOOP_TIMER:
	skill = skill_table[ch->skillGsn];
	if ( chargeGsn != -1 && ch->pcdata->learned[chargeGsn] > 0
		&& can_use_skill( ch, number_percent(), chargeGsn )
		&& ch->mana >= (skill->min_mana*2) && ch->focus >= (skill->focus*1.5) )
	{
		pager_printf(ch, "&wYou channel more energy in to your %s.\n\r", skill_table[ch->skillGsn]->name );
		act( AT_PLAIN, "$n continues charging up $s attack.", ch, NULL, NULL, TO_ROOM );
		learn_from_success( ch, chargeGsn );
		/* subtract focus and energy */
		ch->charge++;
		chargeDrain(ch);
		ch->timerDelay = number_range(1,2);
		ch->timerType = 1;
		ch->timerDo_fun = do_charge;
	    return;
	}
	else
	{
		if (ch->mana < skill->min_mana)
			pager_printf(ch, "&wYou finish channeling all your available energy in to %s, and fire it!\n\r", skill_table[ch->skillGsn]->name );
		else if (ch->mana < skill->min_mana)
			pager_printf(ch, "&wYou lose your focus and %s fires!\n\r", skill_table[ch->skillGsn]->name );
		else
			pager_printf(ch, "&wYou can't control your %s any more and it fires!\n\r", skill_table[ch->skillGsn]->name );
		if (chargeGsn != -1)
			learn_from_failure( ch, chargeGsn );
		/* do attack */
    	break;
    }

	case SUB_TIMER_DO_ABORT:
	{
		if (!ch->fighting)
		{
			bug("skills_dbs:3749");
			pager_printf(ch, "&wYou power down your %s since you're not fighting any more.", skill_table[ch->skillGsn]->name);
			ch->timerDelay = 0;
			ch->timerType = 0;
			ch->substate = SUB_NONE;
			ch->skillGsn = -1;
			ch->charge = 0;
			ch->timerDo_fun = NULL;
			return;
		}
		if (!ch->fighting->who)
				bug("skills_dbs:3759");
		if (!ch->fighting->who->name)
				bug("skills_dbs:3761");
		if (!ch->skillGsn)
				bug("skills_dbs:3763");
		if (!skill_table[ch->skillGsn]->name)
				bug("skills_dbs:3765");
/* There was a bug that people can exploit when killing mobs.
 * They could charge, then do 'k (mob)'.  It'd break the charge,
 * and immediately engage them in combat with the mob.  Mostly
 * used against fighters in COU, Coolers, and the larger auto-repop
 * mobs.
 * My fix for this created a bug where people could use a timer
 * to set themselves into a 'charge loop' so to speak.  Could just
 * keep doing 'charge (skill)' in a spar, and they'd never attack
 * their partner--very useful for letting someone spam, but also
 * enabled them to cheat.
 * So, if any more changes are made to this part, take this into
 * consideration.  --Islvin
 */
		if (xIS_SET(ch->act, PLR_SPAR))
		{
			pager_printf(ch, "&wYou fire your charged up %s at %s!\n\r",skill_table[ch->skillGsn]->name, ch->fighting->who->name);
			if (chargeGsn != -1)
				learn_from_success( ch, chargeGsn );
			break;
		}
			pager_printf(ch, "&wIn an effort to multitask, you fumble your charge.\n\r", skill_table[ch->skillGsn]->name);
			ch->timerDelay = 0;
			ch->timerType = 0;
			ch->substate = SUB_NONE;
			ch->skillGsn = -1;
			ch->charge = 0;
			ch->timerDo_fun = NULL;
			if (chargeGsn != -1)
				learn_from_failure( ch, chargeGsn );
			return;

    }
	}

	/* fire!!! */
	ch->timerDelay = 0;
	ch->timerType = 0;

	ch->substate = SUB_NONE;
	skill = skill_table[ch->skillGsn];
	if (!check_skill(ch, skill_table[ch->skillGsn]->name, "", TRUE)
		&& !check_ability(ch, skill_table[ch->skillGsn]->name, "", TRUE))
	{
		bug( "Couldn't find called skill in do_charge. %s (sn %d)", ch->name, ch->skillGsn);
		pager_printf(ch, "&wYou forgot what you were charging...?\n\r" );
		act( AT_PLAIN, "$n forgot what $e was charging...?", ch, NULL, NULL, TO_ROOM );
		ch->skillGsn = -1;
		ch->charge = 0;
		return;
	}
	ch->skillGsn = -1;
	ch->charge = 0;
	ch->timerDo_fun = NULL;
	return;
}

ch_ret spell_sensu_bean( int sn, int level, CHAR_DATA *ch, void *vo )
{
	ch->hit = ch->max_hit;
	ch->mana += ch->max_mana * 0.25;
	ch->mana = URANGE(0,ch->mana,ch->max_mana);
	act( AT_MAGIC, "A warm feeling fills your body.", ch, NULL, NULL, TO_CHAR );
	return rNONE;
}

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

    af.type = gsn_sleep;
    af.duration = number_range( 1, 20 );
    af.location = APPLY_NONE;
    af.bitvector = meb( AFF_SLEEP );
    af.modifier = -1;

    affect_to_char( ch, &af ); 
    act( AT_MAGIC, "An overwhelming urge to sleep washes over you.", ch, NULL, NULL, TO_CHAR );
    return rNONE;
}

ch_ret spell_poison( int sn, int level, CHAR_DATA *ch, void *vo )
{
	act( AT_MAGIC, "Your stomach aches and you feel ill.", ch, NULL, NULL, TO_CHAR );
	return rNONE;
}

ch_ret spell_paralyze( int sn, int level, CHAR_DATA *ch, void *vo )
{
	act( AT_MAGIC, "Your limbs begin to act sluggishly.", ch, NULL, NULL, TO_CHAR );
	return rNONE;
}


void do_multi_disk(CHAR_DATA *ch, char *arg )
{
	char buf[MAX_STRING_LENGTH];
	char buf2[MAX_STRING_LENGTH];
	CHAR_DATA *victim;
	int shot = 0;
	int shots = 0;
	int dam = 0;
        int dam2 = 0;
	int energy = 0;



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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_multi_disk]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

	if ( arg[0] == '\0' || atoi(arg) <= 0)
    	{
		send_to_char( "Syntax: multi <# of Disks>\n\r", ch );
		return;
    	}

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

	shot = atoi(arg);
	if (shot > 50)
		shot = 50;
        if( shot < 2 )
          shot = 2;
	energy = shot * skill_table[gsn_multi_disk]->min_mana;
	shots = shot;
	strcpy(buf, num_punct(shot));

	if ( ch->mana < energy )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < (skill_table[gsn_multi_disk]->focus * (1+(shot/10))))
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= (skill_table[gsn_multi_disk]->focus * (1+(shot/10)));

//    WAIT_STATE( ch, (skill_table[gsn_multi_disk]->beats * (1+(shot/10))) );
    WAIT_STATE( ch, ( skill_table[gsn_multi_disk]->beats ) );

    if ( can_use_skill(ch, number_percent(),gsn_multi_disk ) )
    {
	switch(number_range(1,100))
	{
	case 100:
		if (IS_NPC(victim) || (!IS_NPC(victim) && (!xIS_SET(ch->act, PLR_SPAR) || !xIS_SET(ch->act, PLR_SPAR) )))
 		{

		/* Redone so that instant death can't be abused to instant kill
		 * players over 2x their power. -- Islvin
		 */
		if (victim->pl / ch->pl >= 2)
		{
			act( AT_SKILL, "You raise your hand above your head, forming a disc of pure energy, and throw it at $N.", ch, NULL, victim, TO_CHAR );
			act( AT_SKILL, "The disc flies straight toward $N, breaking apart into smaller pieces... but they're all absorbed by $s aura.", ch, NULL, victim, TO_CHAR );
			act( AT_SKILL, "$N raises $s hand above $s head, forming a disc of pure energy, and throws it at you.", ch, NULL, victim, TO_VICT );
			act( AT_SKILL, "The disc flies straight toward you, breaking apart into smaller pieces... but they're all absorbed by your aura.", ch, NULL, victim, TO_VICT );
			act( AT_SKILL, "$n raises $s hand above $s head, forming a disc of pure energy, and throws it at $N.", ch, NULL, victim, TO_NOTVICT );
			act( AT_SKILL, "The disc flies straight toward $N, breaking apart into smaller pieces... but they're all absorbed by $s aura.", ch, NULL, victim, TO_NOTVICT );
			dam = 0;
			break;
		}
		dam = 999999999;
		act( AT_SKILL, "You raise your hand above your head, forming a disc of pure energy, and throw it at $N.", ch, NULL, victim, TO_CHAR );
		act( AT_RED, "The disc flies straight toward $N, breaking apart into smaller pieces which cut through $m, killing $m instantly!!", ch, NULL, victim, TO_CHAR );
		act( AT_SKILL, "$N raises $s hand above $s head, forming a disc of pure energy, and throws it at you.", ch, NULL, victim, TO_VICT );
		act( AT_RED, "The disc flies straight toward you, breaking apart into smaller pieces which cut through you, killing you instantly!!", ch, NULL, victim, TO_VICT );
		act( AT_SKILL, "$n raises $s hand above $s head, forming a disc of pure energy, and throws it at $N.", ch, NULL, victim, TO_NOTVICT );
		act( AT_RED, "The disc flies straight toward $N, breaking apart into smaller pieces which cut through $m, killing $m instantly!!", ch, NULL, victim, TO_NOTVICT );

	learn_from_success( ch, gsn_multi_disk );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    break;
    }
	default:
	while (shots > 0)
	{
/* Changed to increase damage -- Islvin
		switch (number_range( 1, 4))
		{
			default:
			case 1:
				break;
			case 2:
			case 3:
				dam += number_range( 0, 1 );
				break;
			case 4:
				dam += number_range( 0, 2 );
				break;
		}
*/
		switch (number_range( 1, 3))
		{
			default:
			case 1:
				break;
			case 2:
				dam += number_range( 0, 1 );
				break;
			case 3:
				dam += number_range( 0, 2 );
				break;
		}

		shots--;
	}
        dam2 = number_range( 5, 8 );
	strcpy(buf2, num_punct(get_attmod(ch, victim) * dam * dam2 ));

	act( AT_SKILL, "You raise your hand above your head, palm up, and bring a crackling disk of", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "energy forth.  The disk hums as you eye $N and send it spinning $S way.", ch, NULL, victim, TO_CHAR );
        act2( AT_SKILL, "Mid-flight the disk breaks into $t smaller disks, each spinning madly", ch, buf, victim, TO_CHAR, NULL );
	act2( AT_SKILL, "as they home in on $N. &W[$t]", ch, buf2, victim, TO_CHAR, NULL );
	act( AT_SKILL, "$n raises $s hand above $s head, palm up, and brings a crackling disk of", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "energy forth.  The disk hums as $e eyes you and sends it spinning your way.", ch, NULL, victim, TO_VICT );
        act2( AT_SKILL, "Mid-flight the disk breaks into $t smaller disks, each spinning madly", ch, buf, victim, TO_VICT, NULL );
	act2( AT_SKILL, "as they home in on you. &W[$t]", ch, buf2, victim, TO_VICT, NULL );
	act( AT_SKILL, "$n raises $s hand above $s head, palm up, and brings a crackling disk of", ch, NULL, victim, TO_NOTVICT );
	act( AT_SKILL, "energy forth.  The disk hums as $e eyes $N and sends it spinning $N's way.", ch, NULL, victim, TO_NOTVICT );
        act2( AT_SKILL, "Mid-flight the disk breaks into $t smaller disks, each spinning madly", ch, buf, victim, TO_NOTVICT, NULL );
	act2( AT_SKILL, "as they home in on $N. &W[$t]", ch, buf2, victim, TO_NOTVICT, NULL );

	learn_from_success( ch, gsn_multi_disk );
	global_retcode = damage( ch, victim, (get_attmod(ch, victim) * dam * number_range(2, 5)), TYPE_HIT );
	break;
	}
    }
    else
    {
	act( AT_SKILL, "You launch a crackling disk of energy toward $N but it breaks up halfway there.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n launches a crackling disk of energy toward $N but it breaks up halfway there.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n launches a crackling disk of energy toward $N but it breaks up halfway there.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_multi_disk );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= energy;
    return;
}

void do_ki_heal( CHAR_DATA *ch, char *argument )
{
  CHAR_DATA *victim;
  char       arg[MAX_STRING_LENGTH];
  int        healTo = 100;

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

  if ( !IS_NPC(ch)
  &&   ch->exp < skill_table[gsn_ki_heal]->skill_level[ch->class] )
  {
    send_to_char( "You can't do that.\n\r", ch );
    return;
  }

  argument = one_argument( argument, arg );

  if ( arg[0] == '\0' )
  {
    send_to_char( "Syntax: heal <target> [<amount>]\n\r"
                  "    or: heal <target> full\n\r", ch );
    return;
  }

  if( ( victim = get_char_room( ch, arg ) ) == NULL )
  {
    send_to_char( "I see no one here with that name.\n\r", ch );
    return;
  }

  if( victim->race == race_lookup( "android" ) )
  {
    send_to_char( "You can't heal a being without Ki.\n\r", ch );
    return;
  }

  if( victim->hit >= victim->max_hit )
  {
    send_to_char( "There's no need to heal them.\n\r", ch );
    return;
  }

  if( argument[0] != '\0' )
  {
    if( strcmp( argument, "full" ) )
    {
      healTo = victim->max_hit - victim->hit;
    }
    if( atoi( argument ) > 0 && atoi( argument ) < 100 )
    {
      healTo = atoi( argument );
    }
  }
  if( healTo > (victim->max_hit - victim->hit) )
    healTo = victim->max_hit - victim->hit;

  if( !IS_NPC( ch ) && (ch->pcdata->learned[gsn_ki_heal] < 95)
   && (healTo > ch->pcdata->learned[gsn_ki_heal]) )
  {
    send_to_char( "You aren't skilled enough to heal that amount.\n\r", ch );
    return;
  }

  if( ch->mana < (healTo * skill_table[gsn_ki_heal]->min_mana) )
  {
    send_to_char( "You don't have enough energy to heal anyone.\n\r", ch );
    return;
  }

  if( who_fighting( victim ) != NULL )
  {
    send_to_char( "You'll have to wait until they aren't fighting.\n\r", ch );
    return;
  }

  if( who_fighting( ch ) != NULL )
  {
    send_to_char( "You're a bit busy to do that right now.\n\r", ch );
    return;
  }

  if( victim == ch )
  {
    send_to_char( "You can't heal yourself.\n\r", ch );
    return;
  }

  if ( can_use_skill(ch, number_percent(),gsn_ki_heal ) )
  {
    act( AT_WHITE, "You lay your palms upon $N's wounds, a soft white glow forming as you use your energy to heal $M."
                 , ch, NULL, victim, TO_CHAR );
    act( AT_WHITE, "$n lays $s palms upon your wounds, a soft white glow forming as $e uses $s energy to heal you."
                 , ch, NULL, victim, TO_VICT );
    act( AT_WHITE, "$n lays $s palms upon $N's wounds, a soft white glow forming as $e uses $s energy to heal $N."
                 , ch, NULL, victim, TO_NOTVICT );

    victim->hit += healTo;
    if( victim->hit > victim->max_hit )
    {
      victim->hit = victim->max_hit;
    }
    learn_from_success( ch, gsn_ki_heal );
    ch->mana -= (healTo * skill_table[gsn_ki_heal]->min_mana);
  }
  else
  {
    act( AT_WHITE, "You lay your palms upon $N's wounds, but nothing happens.", ch, NULL, victim, TO_CHAR );
    act( AT_WHITE, "$n lays $s plams upon your wounds, but nothing happens.", ch, NULL, victim, TO_VICT );
    act( AT_WHITE, "$n lays $s palms upon $N's wounds, but nothing happens.", ch, NULL, victim, TO_NOTVICT );
    learn_from_failure( ch, gsn_ki_heal );
    ch->mana -= (healTo * skill_table[gsn_ki_heal]->min_mana)/2;
  }


}

void do_growth( CHAR_DATA *ch, char *argument )
{
  int strMod = 10;
  int conMod = 5;
  int intMod = 5;
  int spdMod = -10;

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

  if ( !IS_NPC(ch)
  &&   ch->exp < skill_table[gsn_growth]->skill_level[ch->class] )
  {
    send_to_char( "You can't do that.\n\r", ch );
    return;
  }

  if( xIS_SET( (ch)->affected_by, AFF_GROWTH ) &&
     !xIS_SET( (ch)->affected_by, AFF_GIANT ) )
  {
    act( AT_SKILL, "You shrink and return to your original size.", ch, NULL, NULL, TO_CHAR );
    act( AT_SKILL, "$n shrinks and returns to $s original size.", ch, NULL, NULL, TO_NOTVICT );
    transStatRemove(ch);
    xREMOVE_BIT( (ch)->affected_by, AFF_GROWTH );
    return;
  }

  if( xIS_SET( (ch)->affected_by, AFF_GROWTH ) &&
      xIS_SET( (ch)->affected_by, AFF_GIANT ) )
  {
    send_to_char( "You must revert back from giant size before doing this.\n\r", ch );
    return;
  }

  if( ch->mana < skill_table[gsn_growth]->min_mana )
  {
    send_to_char( "You don't have enough energy.\n\r", ch );
    return;
  }

  if ( can_use_skill(ch, number_percent(),gsn_growth ) )
  {
    act( AT_SKILL, "Your body surges with power, suddenly expanding and growing to at least twice your normal size."
                 , ch, NULL, NULL, TO_CHAR );
    act( AT_SKILL, "$n's body surges with power, suddenly expanding and growing to at least twice $s normal size."
                 , ch, NULL, NULL, TO_NOTVICT );

    learn_from_success( ch, gsn_growth );
    xSET_BIT( (ch)->affected_by, AFF_GROWTH );
    transStatApply(ch, strMod, spdMod, intMod, conMod);
  }
  else
  {
    act( AT_SKILL, "You expand slightly before shrinking back to your normal size and stature.", ch, NULL, NULL, TO_CHAR );
    act( AT_SKILL, "$n expands slightly before shrinking back to $s normal size and stature.", ch, NULL, NULL, TO_NOTVICT );
    learn_from_failure( ch, gsn_growth );
  }
  ch->mana -= skill_table[gsn_growth]->min_mana;
}

void do_giant_size( CHAR_DATA *ch, char *argument )
{
  int strMod = 25;
  int conMod = 15;
  int intMod = 10;
  int spdMod = -25;

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

  if ( !IS_NPC(ch)
  &&   ch->exp < skill_table[gsn_giant]->skill_level[ch->class] )
  {
    send_to_char( "You can't do that.\n\r", ch );
    return;
  }

  if( xIS_SET( (ch)->affected_by, AFF_GROWTH ) &&
      xIS_SET( (ch)->affected_by, AFF_GIANT ) )
  {
    act( AT_SKILL, "You shrink and return to your original size.", ch, NULL, NULL, TO_CHAR );
    act( AT_SKILL, "$n shrinks and returns to $s original size.", ch, NULL, NULL, TO_NOTVICT );
    transStatRemove(ch);
    xREMOVE_BIT( (ch)->affected_by, AFF_GIANT );
    xREMOVE_BIT( (ch)->affected_by, AFF_GROWTH );
    return;
  }

  if( !xIS_SET( (ch)->affected_by, AFF_GROWTH ) )
  {
    send_to_char( "You must first grow before you can use this.\n\r", ch );
    return;
  }

  if( ch->mana < skill_table[gsn_giant]->min_mana )
  {
    send_to_char( "You don't have enough energy.\n\r", ch );
    return;
  }

  if ( can_use_skill(ch, number_percent(),gsn_giant ) )
  {
    transStatRemove(ch);
    act( AT_SKILL, "You expand even further than before, transforming yourself into a Namekian giant."
                 , ch, NULL, NULL, TO_CHAR );
    act( AT_SKILL, "$n expands even further than before, transforming $mself into a Namekian giant."
                 , ch, NULL, NULL, TO_NOTVICT );

    learn_from_success( ch, gsn_giant );
    ch->mana -= skill_table[gsn_giant]->min_mana;
    xSET_BIT( (ch)->affected_by, AFF_GIANT );
    transStatApply(ch, strMod, spdMod, intMod, conMod);
  }
  else
  {
    act( AT_SKILL, "Your body fills with energy but you can't seem to grow any larger.", ch, NULL, NULL, TO_CHAR );
    act( AT_SKILL, "$n fills $s body with energy but can't seem to grow any larger.", ch, NULL, NULL, TO_NOTVICT );
    learn_from_failure( ch, gsn_giant );
    ch->mana -= skill_table[gsn_giant]->min_mana;
  }
}

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

	CHAR_DATA *victim;
	MOB_INDEX_DATA *pMobIndex;

	if ( IS_NPC(ch))
	{
		send_to_char( "NPC's can't do that.\n\r", ch );
		return;
	}

	if ( !IS_NPC(ch)
	&&   ch->exp < skill_table[gsn_split_form]->skill_level[ch->class] )
	{
		send_to_char( "You can't do that.\n\r", ch );
		return;
	}

	if( IS_IMMORTAL( ch ) && get_trust( ch ) < 59 )
	{
		send_to_char( "You can't split-form.\n\r", ch );
		return;
	}

        if( IS_NPC( ch ) && ch->pIndexData->vnum == 610 )
        {
            send_to_char( "You aren't allowed to do that.\n\r", ch );
            return;
        }

	if( xIS_SET( (ch)->affected_by, AFF_SPLIT_FORM ) )
	{
		reuniteSplitForms(ch);
		return;
	}

	if( xIS_SET( (ch)->affected_by, AFF_TRI_FORM ) ||
	    xIS_SET( (ch)->affected_by, AFF_MULTI_FORM ) )
	{
		reuniteSplitForms(ch);
		return;
	}

	if( ch->mana < skill_table[gsn_split_form]->min_mana )
	{
		pager_printf_color(ch, "You must have at least %s energy to split.\n\r", num_punct(skill_table[gsn_split_form]->min_mana) );
		return;
	}

	if ( ( pMobIndex = get_mob_index( 610 ) ) == NULL )
	{
	    bug("do_split_form: mob does not exist");
	    send_to_char( "Hmm... Something went wrong...\n\r", ch );
	    return ;
	}

	victim = create_mobile( pMobIndex );
	char_to_room( victim, ch->in_room );

	if ( can_use_skill(ch, number_percent(),gsn_split_form ) )
	{
		statsToMob(ch, victim, gsn_split_form, FALSE);  // Split without error
		act( AT_SKILL, "Powering up, your body begins to separate and with a booming yell you create a double of your self!", ch, NULL, NULL, TO_CHAR );
		act( AT_SKILL, "$n powers up as $s body begins to separate and with a booming yell two $n's now exist!", ch, NULL, NULL, TO_NOTVICT );
		learn_from_success( ch, gsn_split_form );
	}
	else
	{
		statsToMob(ch, victim, gsn_split_form, TRUE);  // Doh!  They botched it :(
		act( AT_SKILL, "You begin to create a double of your self, but just before the final separation you lose focus and something goes wrong.", ch, NULL, NULL, TO_CHAR );
		act( AT_SKILL, "$n begins to create a double of $s self, but just before the final separation $e loses focus and something goes wrong.", ch, NULL, NULL, TO_NOTVICT );
		learn_from_failure( ch, gsn_split_form );
	}

	ch->mana = ch->mana/2;
	add_follower( victim, ch );
	victim->master = ch;
	victim->leader = ch;
	ch->leader = ch;
	xSET_BIT( ch->affected_by, AFF_SPLIT_FORM);
	xSET_BIT( victim->affected_by, AFF_SPLIT_FORM);

	return;
}

void do_tri_form(CHAR_DATA *ch, char *argument )
{
	return;
}

void do_multi_form(CHAR_DATA *ch, char *argument )
{
	return;
}

void do_destructive_wave(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_destructive_wave]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

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

	if ( ch->mana < skill_table[gsn_destructive_wave]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_destructive_wave]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_destructive_wave]->focus;

    WAIT_STATE( ch, skill_table[gsn_destructive_wave]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_destructive_wave ) )
    {
	dam = get_attmod(ch, victim) * number_range( 15, 20 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	act( AT_SKILL, "You hold one arm straight, palm facing $N, your free hand grasping your forearm to steady your aim.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "A large ball of energy forms in front of your palm, blasting out towards $N. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_SKILL, "$n holds one arm straight, palm facing you, $s free hand grasping $s forearm to steady $s aim.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "A large ball of energy forms in front of $n's palm, blasting out towards you. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	act( AT_SKILL, "$n holds one arm straight, palm facing $N, $s free hand grasping $s forearm to steady $s aim.", ch, NULL, victim, TO_NOTVICT );
	act( AT_SKILL, "A large ball of energy forms in front of $n's palm, blasting out towards $N. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

        dam = ki_absorb( victim, ch, dam, gsn_destructive_wave );
	learn_from_success( ch, gsn_destructive_wave );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You missed $N with your destructive wave attack.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n misses you with $s destructive wave attack.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n missed $N with a destructive wave attack.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_destructive_wave );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= skill_table[gsn_destructive_wave]->min_mana;
	return;
}

void do_dodon_ray(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

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

    if ((ch->race == 9)
    &&   (ch->exp < skill_table[gsn_genie_signature]->skill_level[ch->class]) )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }
    else
    {
      if ( (!IS_NPC(ch))
      &&   (ch->exp < skill_table[gsn_dodon_ray]->skill_level[ch->class]) )
      {
	  send_to_char( "You can't do that.\n\r", ch );
	  return;
      }
    }

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

	if ( ch->mana < skill_table[gsn_dodon_ray]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_dodon_ray]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_dodon_ray]->focus;

    WAIT_STATE( ch, skill_table[gsn_dodon_ray]->beats );
    if (ch->race != 9)
    {
      if ( can_use_skill(ch, number_percent(),gsn_dodon_ray ) )
      {
	  dam = get_attmod(ch, victim) * number_range( 22, 26 );
	  if (ch->charge > 0)
	  	dam = chargeDamMult(ch, dam);

	  act( AT_SKILL, "You point your first finger towards $N, thumb pointing upwards, forming a pretend gun.", ch, NULL, victim, TO_CHAR );
	  act( AT_SKILL, "A very real, very bright beam of energy zaps from your extended finger, your hand recoiling as the ray fires. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_SKILL, "$n points $s first finger towards you, thumb pointing upwards, forming a pretend gun.", ch, NULL, victim, TO_VICT );
	  act( AT_SKILL, "A very real, very bright beam of energy zaps from $n's extended finger, $s hand recoiling as the ray fires. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_SKILL, "$n points $s first finger towards $N, thumb pointing upwards, forming a pretend gun.", ch, NULL, victim, TO_NOTVICT );
	  act( AT_SKILL, "A very real, very bright beam of energy zaps from $n's extended finger, $s hand recoiling as the ray fires. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	  learn_from_success( ch, gsn_dodon_ray );
	  global_retcode = damage( ch, victim, dam, TYPE_HIT );
      }
      else
      {
	  act( AT_SKILL, "You missed $N with your dodon ray attack.", ch, NULL, victim, TO_CHAR );
	  act( AT_SKILL, "$n misses you with $s dodon ray attack.", ch, NULL, victim, TO_VICT );
	  act( AT_SKILL, "$n missed $N with a dodon ray attack.", ch, NULL, victim, TO_NOTVICT );
	  learn_from_failure( ch, gsn_dodon_ray );
	  global_retcode = damage( ch, victim, 0, TYPE_HIT );
      }
    }
    else
    {
      if ( can_use_skill(ch, number_percent(),gsn_genie_signature ) )
      {
	  dam = get_attmod(ch, victim) * number_range( 22, 26 );
	  if (ch->charge > 0)
	  	dam = chargeDamMult(ch, dam);

	  act( AT_PINK, "You point your first finger towards $N, thumb pointing upwards, forming a pretend gun.", ch, NULL, victim, TO_CHAR );
	  act( AT_PINK, "A very real, very bright beam of energy zaps from your extended finger, your hand recoiling as the ray fires. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_PINK, "$n points $s first finger towards you, thumb pointing upwards, forming a pretend gun.", ch, NULL, victim, TO_VICT );
	  act( AT_PINK, "A very real, very bright beam of energy zaps from $n's extended finger, $s hand recoiling as the ray fires. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_PINK, "$n points $s first finger towards $N, thumb pointing upwards, forming a pretend gun.", ch, NULL, victim, TO_NOTVICT );
	  act( AT_PINK, "A very real, very bright beam of energy zaps from $n's extended finger, $s hand recoiling as the ray fires. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	  learn_from_success( ch, gsn_genie_signature );
	  global_retcode = damage( ch, victim, dam, TYPE_HIT );
      }
      else
      {
	  act( AT_PURPLE, "You missed $N with your dodon ray attack.", ch, NULL, victim, TO_CHAR );
	  act( AT_PURPLE, "$n misses you with $s dodon ray attack.", ch, NULL, victim, TO_VICT );
	  act( AT_PURPLE, "$n missed $N with a dodon ray attack.", ch, NULL, victim, TO_NOTVICT );
	  learn_from_failure( ch, gsn_genie_signature );
	  global_retcode = damage( ch, victim, 0, TYPE_HIT );
      }
    }

	ch->mana -= skill_table[gsn_dodon_ray]->min_mana;
	return;
}

void do_spirit_ball(CHAR_DATA *ch, char *argument )
{
   CHAR_DATA *victim;
    int dam = 0;

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_spirit_ball]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

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

	if ( ch->mana < skill_table[gsn_spirit_ball]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_spirit_ball]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_spirit_ball]->focus;

    WAIT_STATE( ch, skill_table[gsn_spirit_ball]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_spirit_ball ) )
    {
	dam = get_attmod(ch, victim) * number_range( 26, 32 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);

	act( AT_SKILL, "You grab your wrist tightly with your other hand, concentrating your ki into a brilliant ball of energy that floats above your palm, your fingers curling upwards.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "The ball of white light zips through the air as you gesture with two fingers, controlling its path as it zigzags wildly, finally smashing into $N with a blinding explosion. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_SKILL, "$n grabs $s wrist tightly with $s other hand, concentrating $s ki into a brilliant ball of energy that floats above $s palm, $s fingers curling upwards.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "The ball of white light zips through the air as $n gestures with two fingers, controlling its path as it zigzags wildly, finally smashing into you with a blinding explosion. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	act( AT_SKILL, "$n grabs $s wrist tightly with $s other hand, concentrating $s ki into a brilliant ball of energy that floats above $s palm, $s fingers curling upwards.", ch, NULL, victim, TO_NOTVICT );
	act( AT_SKILL, "The ball of white light zips through the air as $n gestures with two fingers, controlling its path as it zigzags wildly, finally smashing into $N with a blinding explosion. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	learn_from_success( ch, gsn_spirit_ball );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You missed $N with your spirit ball attack.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n misses you with $s spirit ball attack.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n missed $N with a spirit ball attack.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_spirit_ball );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= skill_table[gsn_spirit_ball]->min_mana;
	return;
}

void do_big_bang(CHAR_DATA *ch, char *argument )
{
   CHAR_DATA *victim;
    int dam = 0;

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_big_bang]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

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

	if ( ch->mana < skill_table[gsn_big_bang]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_big_bang]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_big_bang]->focus;

    WAIT_STATE( ch, skill_table[gsn_big_bang]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_big_bang ) )
    {
	dam = get_attmod(ch, victim) * number_range( 33, 40 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);

	act( AT_SKILL, "Turning one side of your body towards $N, you raise your hand, palm facing $M.  A huge ball of blue energy begins to form.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "You shout, 'BIG BANG!' as the ball of ki fires from your palm, leaving a trail of energy behind as it rockets towards $N. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_SKILL, "Turning one side of $n's body towards you, $e raise $s hand, palm facing you.  A huge ball of blue energy begins to form.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n shouts, 'BIG BANG!' as the ball of ki fires from $s palm, leaving a trail of energy behind as it rockets towards you. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	act( AT_SKILL, "Turning one side of $n's body towards you, $e raises $s hand, palm facing $N.  A huge ball of blue energy begins to form.", ch, NULL, victim, TO_NOTVICT );
	act( AT_SKILL, "$n shouts, 'BIG BANG!' as the ball of ki fires from $s palm, leaving a trail of energy behind as it rockets towards $N. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

        dam = ki_absorb( victim, ch, dam, gsn_big_bang );
	learn_from_success( ch, gsn_big_bang );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You missed $N with your big bang attack.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n misses you with $s big bang attack.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n missed $N with a big bang attack.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_big_bang );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= skill_table[gsn_big_bang]->min_mana;
	return;
}

void do_gallic_gun(CHAR_DATA *ch, char *argument )
{
   CHAR_DATA *victim;
    int dam = 0;

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_gallic_gun]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

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

	if ( ch->mana < skill_table[gsn_gallic_gun]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_gallic_gun]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_gallic_gun]->focus;

    WAIT_STATE( ch, skill_table[gsn_gallic_gun]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_gallic_gun ) )
    {
	dam = get_attmod(ch, victim) * number_range( 29, 33 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);

	act( AT_SKILL, "You pull your hands to one side of your body, a dark purple sphere of energy flaring up suddenly around you.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "You thrust both hands towards $N, a beam of ki blasting from your purple aura, screaming, 'Gallic Gun...FIRE!' &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_SKILL, "$n pulls $s hands to one side of $s body, a dark purple sphere of energy flaring up suddenly around $m.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n thrusts both hands towards you, a beam of ki blasting from $s purple aura, screaming, 'Gallic Gun...FIRE!' &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	act( AT_SKILL, "$n pulls $s hands to one side of $s body, a dark purple sphere of energy flaring up suddenly around $m.", ch, NULL, victim, TO_NOTVICT );
	act( AT_SKILL, "$n thrusts both hands towards $N, a beam of ki blasting from $s purple aura, screaming, 'Gallic Gun...FIRE! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	learn_from_success( ch, gsn_gallic_gun );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You missed $N with your gallic gun attack.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n misses you with $s gallic gun attack.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n missed $N with a gallic gun attack.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_gallic_gun );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= skill_table[gsn_gallic_gun]->min_mana;
	return;
}

void do_burning_attack(CHAR_DATA *ch, char *argument )
{
   CHAR_DATA *victim;
    int dam = 0;

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_burning_attack]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

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

	if ( ch->mana < skill_table[gsn_burning_attack]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_burning_attack]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_burning_attack]->focus;

    WAIT_STATE( ch, skill_table[gsn_burning_attack]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_burning_attack ) )
    {
	dam = get_attmod(ch, victim) * number_range( 24, 28 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);

	act( AT_SKILL, "You hold your hands in front of you, fingers splayed around a diamond shape formed by thumbs and fingers.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "Suddenly you begin to gesture wildly, hands blurring through the air in a flurry of movement.  You freeze, hands forming the same diamond shape, a pulsing ball of light appearing and launching towards $N with surprising speed. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_SKILL, "$n holds $s hands in front of $mself, fingers splayed around a diamond shape formed by thumbs and fingers.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "Suddenly $n begins to gesture wildly, hands blurring through the air in a flurry of movement.  $n freezes, hands forming the same diamond shape, a pulsing ball of light appearing and launching towards you with surprising speed. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	act( AT_SKILL, "$n holds $s hands in front of $mself, fingers splayed around a diamond shape formed by thumbs and fingers.", ch, NULL, victim, TO_NOTVICT );
	act( AT_SKILL, "Suddenly $n begins to gesture wildly, hands blurring through the air in a flurry of movement.  $n freezes, hands forming the same diamond shape, a pulsing ball of light appearing and launching towards $N with surprising speed. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	learn_from_success( ch, gsn_burning_attack );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You missed $N with your burning attack.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n misses you with $s burning attack.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n missed $N with a burning attack.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_burning_attack );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= skill_table[gsn_burning_attack]->min_mana;
	return;
}

void do_finishing_buster(CHAR_DATA *ch, char *argument )
{
   CHAR_DATA *victim;
    int dam = 0;

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_finishing_buster]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

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

	if ( ch->mana < skill_table[gsn_finishing_buster]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_finishing_buster]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_finishing_buster]->focus;

    WAIT_STATE( ch, skill_table[gsn_finishing_buster]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_finishing_buster ) )
    {
	dam = get_attmod(ch, victim) * number_range( 56, 60 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);

	act( AT_SKILL, "You raise both hands over your head, gathering your energy.  A large, blue ball of ki gathers above your head, crackling with electricity.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "You fling the ball of energy towards $N, putting your whole body into the motion.  'Finishing Buster!'  The sphere flies quickly, smashing soundly into $N. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_SKILL, "$n raises both hands over $s head, gathering $s energy.  A large, blue ball of ki gathers above $s head, crackling with electricity.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n flings the ball of energy towards you, putting $s whole body into the motion.  'Finishing Buster!'  The sphere flies quickly, smashing soundly into you. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	act( AT_SKILL, "$n raises both hands over $s head, gathering $s energy.  A large, blue ball of ki gathers above $s head, crackling with electricity.", ch, NULL, victim, TO_NOTVICT );
	act( AT_SKILL, "$n flings the ball of energy towards $N, putting $s whole body into the motion.  'Finishing Buster!'  The sphere flies quickly, smashing soundly into $N. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	learn_from_success( ch, gsn_finishing_buster );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You missed $N with your finishing buster attack.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n misses you with $s finishing buster attack.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n missed $N with a finishing buster attack.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_finishing_buster );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= skill_table[gsn_finishing_buster]->min_mana;
	return;
}

void do_heaven_splitter_cannon(CHAR_DATA *ch, char *argument )
{
   CHAR_DATA *victim;
    int dam = 0;

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

    if ((ch->race == 9)
    &&   (ch->exp < skill_table[gsn_genie_finisher]->skill_level[ch->class]) )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }
    else
    {
      if ( (!IS_NPC(ch))
      &&   (ch->exp < skill_table[gsn_heaven_splitter_cannon]->skill_level[ch->class]) )
      {
	  send_to_char( "You can't do that.\n\r", ch );
	  return;
      }
    }

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

	if ( ch->mana < skill_table[gsn_heaven_splitter_cannon]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_heaven_splitter_cannon]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_heaven_splitter_cannon]->focus;

    WAIT_STATE( ch, skill_table[gsn_heaven_splitter_cannon]->beats );
    if (ch->race != 9)
    {
      if ( can_use_skill(ch, number_percent(),gsn_heaven_splitter_cannon ) )
      {
	  dam = get_attmod(ch, victim) * number_range( 54, 58 );
 	  if (ch->charge > 0)
 		dam = chargeDamMult(ch, dam);

	  act( AT_SKILL, "You cup both hands, holding them close together, right in front of your stomach.  A blindingly bright ball of green energy begins forming, growing ever larger.", ch, NULL, victim, TO_CHAR );
	  act( AT_SKILL, "With a howl, you thrust both hands forward, flinging the huge ball of energy into $N and creating an enourmous explosion. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_SKILL, "$n cups both hands, holding them close together, right in front of $s stomach.  A blindingly bright ball of green energy begins forming, growing ever larger.", ch, NULL, victim, TO_VICT );
	  act( AT_SKILL, "With a howl, $n thrusts both hands forward, flinging the huge ball of energy into you and creating an enourmous explosion. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_SKILL, "$n cups both hands, holding them close together, right in front of $s stomach.  A blindingly bright ball of green energy begins forming, growing ever larger.", ch, NULL, victim, TO_NOTVICT );
	  act( AT_SKILL, "With a howl, $n thrusts both hands forward, flinging the huge ball of energy into $N and creating an enourmous explosion. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	  learn_from_success( ch, gsn_heaven_splitter_cannon );
	  global_retcode = damage( ch, victim, dam, TYPE_HIT );
      }
      else
      {
	  act( AT_SKILL, "You missed $N with your heaven-splitter cannon attack.", ch, NULL, victim, TO_CHAR );
	  act( AT_SKILL, "$n misses you with $s heaven-splitter cannon attack.", ch, NULL, victim, TO_VICT );
	  act( AT_SKILL, "$n missed $N with a heaven-splitter cannon attack.", ch, NULL, victim, TO_NOTVICT );
	  learn_from_failure( ch, gsn_heaven_splitter_cannon );
	  global_retcode = damage( ch, victim, 0, TYPE_HIT );
      }
    }
    else
    {
      if ( can_use_skill(ch, number_percent(),gsn_genie_finisher ) )
      {
	  dam = get_attmod(ch, victim) * number_range( 54, 58 );
 	  if (ch->charge > 0)
 		dam = chargeDamMult(ch, dam);

	  act( AT_PINK, "You cup both hands, holding them close together, right in front of your stomach.  A blindingly bright ball of green energy begins forming, growing ever larger.", ch, NULL, victim, TO_CHAR );
	  act( AT_PINK, "With a howl, you thrust both hands forward, flinging the huge ball of energy into $N and creating an enourmous explosion. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_PINK, "$n cups both hands, holding them close together, right in front of $s stomach.  A blindingly bright ball of green energy begins forming, growing ever larger.", ch, NULL, victim, TO_VICT );
	  act( AT_PINK, "With a howl, $n thrusts both hands forward, flinging the huge ball of energy into you and creating an enourmous explosion. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_PINK, "$n cups both hands, holding them close together, right in front of $s stomach.  A blindingly bright ball of green energy begins forming, growing ever larger.", ch, NULL, victim, TO_NOTVICT );
	  act( AT_PINK, "With a howl, $n thrusts both hands forward, flinging the huge ball of energy into $N and creating an enourmous explosion. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	  learn_from_success( ch, gsn_genie_finisher );
	  global_retcode = damage( ch, victim, dam, TYPE_HIT );
      }
      else
      {
	  act( AT_PURPLE, "You missed $N with your heaven-splitter cannon attack.", ch, NULL, victim, TO_CHAR );
	  act( AT_PURPLE, "$n misses you with $s heaven-splitter cannon attack.", ch, NULL, victim, TO_VICT );
	  act( AT_PURPLE, "$n missed $N with a heaven-splitter cannon attack.", ch, NULL, victim, TO_NOTVICT );
	  learn_from_failure( ch, gsn_genie_finisher );
	  global_retcode = damage( ch, victim, 0, TYPE_HIT );
      }
    }

	ch->mana -= skill_table[gsn_heaven_splitter_cannon]->min_mana;
	return;
}

void do_hellzone_grenade(CHAR_DATA *ch, char *arg )
{
	char buf[MAX_STRING_LENGTH];
	char buf2[MAX_STRING_LENGTH];
	CHAR_DATA *victim;
	int shot = 0;
	int shots = 0;
	int dam = 0;
	int energy = 0;
	int damPerShot = 0;



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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_hellzone_grenade]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

	if ( arg[0] == '\0' || atoi(arg) <= 0)
    	{
		send_to_char( "Syntax: 'hellzone grenade' <# of Shots>\n\r", ch );
		return;
    	}

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

	shot = atoi(arg);
	if (shot > 50)
		shot = 50;
	energy = shot * skill_table[gsn_hellzone_grenade]->min_mana;
	shots = shot;
	strcpy(buf, num_punct(shot));

	if ( ch->mana < energy )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < (skill_table[gsn_hellzone_grenade]->focus * (1+(shot/10))))
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= (skill_table[gsn_hellzone_grenade]->focus * (1+(shot/10)));

    WAIT_STATE( ch, (skill_table[gsn_hellzone_grenade]->beats * (1+(shot/10))) );
    if ( can_use_skill(ch, number_percent(),gsn_hellzone_grenade ) )
    {
	while (shots > 0)
	{
		switch (number_range( 1, 4))
		{
			default:
			case 1:
				break;
			case 2:
				dam += number_range( 0, 1 );
				break;
			case 3:
				dam += 1;
				break;
			case 4:
				dam += number_range( 1, 2 );
				break;
		}
		shots--;
	}
        damPerShot = number_range(1, 3);
	strcpy(buf2, num_punct(get_attmod(ch, victim) * dam * damPerShot ));

	act( AT_SKILL, "You power up, launching $t energy balls that all seem to miss $N by a huge margin.", ch, buf, victim, TO_CHAR );
	act( AT_SKILL, "Suddenly, the balls freeze in midair, trapping $N in a deadly pattern.  The energy balls converge on $N, making $m the center of a gigantic explosion. &W[$t]", ch, buf2, victim, TO_CHAR );
	act( AT_SKILL, "$n powers up, launching $t energy balls that all seem to miss you by a huge margin.", ch, buf, victim, TO_VICT );
	act( AT_SKILL, "Suddenly, the balls freeze in midair, trapping you in a deadly pattern.  The energy balls converge on you, making you the center of a gigantic explosion. &W[$t]", ch, buf2, victim, TO_VICT );
	act( AT_SKILL, "$n powers up, launching $t energy balls that all seem to miss $N by a huge margin.", ch, buf, victim, TO_VICT );
	act( AT_SKILL, "Suddenly, the balls freeze in midair, trapping $N in a deadly pattern.  The energy balls converge on $N, making you the center of a gigantic explosion. &W[$t]", ch, buf2, victim, TO_VICT );
    act( AT_SKILL, "$n powers up, launching $t energy balls that all seem to miss $N by a huge margin.", ch, num_punct(dam), victim, TO_NOTVICT );
    act( AT_SKILL, "Suddenly, the balls freeze in midair, trapping $N in a deadly pattern.  The energy balls converge on $N, making $M the center of a gigantic explosion. &W[$t]", ch, buf2, victim, TO_NOTVICT );

	learn_from_success( ch, gsn_hellzone_grenade );
	global_retcode = damage( ch, victim, (get_attmod(ch, victim) * dam * damPerShot), TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You launch a barrage of $t energy balls towards $N but $E is to fast to hit.", ch, buf, victim, TO_CHAR );
	act( AT_SKILL, "$n launches a barrage of $t energy balls towards $N but you are to fast to hit.", ch, buf, victim, TO_VICT );
	act( AT_SKILL, "$n launches a barrage of $t energy balls towards $N but $E is to fast to hit.", ch, buf, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_hellzone_grenade );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= energy;
	return;
}

void do_makosen(CHAR_DATA *ch, char *argument )
{
   CHAR_DATA *victim;
    int dam = 0;

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_makosen]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

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

	if ( ch->mana < skill_table[gsn_makosen]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_makosen]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_makosen]->focus;

    WAIT_STATE( ch, skill_table[gsn_makosen]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_makosen ) )
    {
	dam = get_attmod(ch, victim) * number_range( 23, 27 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);

	act( AT_SKILL, "You pull both hands to one side of your body, cupping them as a ball of ki begins forming.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "'Makosen!'  You thrust your hands in front of you, firing a thin beam of energy towards $N. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_SKILL, "$n pulls both hands to one side of $s body, cupping them as a ball of ki begins forming.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "'Makosen!'  $n thrusts $s hands in front of $m, firing a thin beam of energy towards you. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	act( AT_SKILL, "$n pulls both hands to one side of $s body, cupping them as a ball of ki begins forming.", ch, NULL, victim, TO_NOTVICT );
	act( AT_SKILL, "'Makosen!'  $n thrusts $s hands in front of $m, firing a thin beam of energy towards $N. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	learn_from_success( ch, gsn_makosen );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You missed $N with your makosen attack.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n misses you with $s makosen attack.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n missed $N with a makosen attack.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_makosen );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= skill_table[gsn_makosen]->min_mana;
	return;
}

void do_trap_ball(CHAR_DATA *ch, char *argument )
{
   CHAR_DATA *victim;
    int dam = 0;

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_trap_ball]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

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

	if ( ch->mana < skill_table[gsn_trap_ball]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_trap_ball]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_trap_ball]->focus;

    WAIT_STATE( ch, skill_table[gsn_trap_ball]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_trap_ball ) )
    {
	dam = get_attmod(ch, victim) * number_range( 32, 36 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);

	act( AT_SKILL, "You form an energy ball, tossing it at $N.  As it impacts $M, the ball expands, trapping $M within it.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "You bat and toss the giant cage around, leaving $N trapped inside of the deadly cage.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "The energy ball trapping $N bumps into a piece of scenery, suddenly exploding and freeing $M. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_SKILL, "$n forms an energy ball, tossing it at you.  As it impacts you, the ball expands, trapping you within it.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n bats and tosses the giant cage around, leaving you trapped inside of the deadly cage.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "The energy ball trapping you bumps into a piece of scenery, suddenly exploding and freeing you. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	act( AT_SKILL, "$n forms an energy ball, tossing it at $N.  As it impacts $M, the ball expands, trapping $N within it.", ch, NULL, victim, TO_NOTVICT );
	act( AT_SKILL, "$n bats and tosses the giant cage around, leaving $N trapped inside of the deadly cage.", ch, NULL, victim, TO_NOTVICT );
	act( AT_SKILL, "The energy ball trapping $N bumps into a piece of scenery, suddenly exploding and freeing $N. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	learn_from_success( ch, gsn_trap_ball );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You missed $N with your trap ball attack.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n misses you with $s trap ball attack.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n missed $N with a trap ball attack.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_trap_ball );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= skill_table[gsn_trap_ball]->min_mana;
	return;
}

void do_scattered_finger_beam(CHAR_DATA *ch, char *arg )
{
	char buf[MAX_STRING_LENGTH];
	char buf2[MAX_STRING_LENGTH];
	CHAR_DATA *victim;
	int shot = 0;
	int shots = 0;
	int dam = 0;
        int dam2 = 0;
	int energy = 0;



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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_scattered_finger_beam]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

	if ( arg[0] == '\0' || atoi(arg) <= 0)
    	{
		send_to_char( "Syntax: 'scattered finger beam' <# of beams>\n\r", ch );
		return;
    	}

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

	shot = atoi(arg);
	if (shot > 50)
		shot = 50;
        if( shot < 2 )
          shot = 2;
	energy = shot * skill_table[gsn_scattered_finger_beam]->min_mana;
	shots = shot;
	strcpy(buf, num_punct(shot));

	if ( ch->mana < energy )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < (skill_table[gsn_scattered_finger_beam]->focus * (1+(shot/10))))
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= (skill_table[gsn_scattered_finger_beam]->focus * (1+(shot/10)));

    WAIT_STATE( ch, ( skill_table[gsn_scattered_finger_beam]->beats ) );

    if ( can_use_skill(ch, number_percent(),gsn_scattered_finger_beam ) )
    {
	while (shots > 0)
	{
		switch (number_range( 1, 3))
		{
			default:
			case 1:
				break;
			case 2:
				dam += number_range( 0, 1 );
				break;
			case 3:
				dam += number_range( 0, 2 );
				break;
		}
		shots--;
	}
        dam2 = number_range( 5, 8 );
	strcpy(buf2, num_punct(get_attmod(ch, victim) * dam * dam2 ));

	act( AT_SKILL, "You point one finger from each hand at $N, repeatedly jabbing them at $M.", ch, NULL, victim, TO_CHAR );
    act2( AT_SKILL, "$N is staggered as $t tiny beams of energy are fired at $S from your stabbing fingers. &W[$T]", ch, buf, victim, TO_CHAR, buf2 );
	act( AT_SKILL, "$n points one finger from each hand at you, repeatedly jabbing them at you.", ch, NULL, victim, TO_VICT );
    act2( AT_SKILL, "You stagger as $t tiny beams of energy are fired at you from $n's stabbing fingers. &W[$T]", ch, buf, victim, TO_VICT, buf2 );
	act( AT_SKILL, "$n points one finger from each hand at $N, repeatedly jabbing them at $M.", ch, NULL, victim, TO_NOTVICT );
    act2( AT_SKILL, "$N staggers as $t tiny beams of energy are fired at $M from $n's stabbing fingers. &W[$T]", ch, buf, victim, TO_NOTVICT, buf2 );

	learn_from_success( ch, gsn_scattered_finger_beam );
	global_retcode = damage( ch, victim, (get_attmod(ch, victim) * dam * number_range(3, 5)), TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "$t beams of energy fly from your finger towards $N but $E is too fast to hit.", ch, buf, victim, TO_CHAR );
	act( AT_SKILL, "$t beams of energy fly from $n's finger towards you but you dodge them.", ch, buf, victim, TO_VICT );
	act( AT_SKILL, "$t beams of energy fly from $n's finger towards $N but $E is too fast to hit.", ch, buf, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_scattered_finger_beam );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= energy;
	return;
}

/*void do_mystic(CHAR_DATA *ch, char *argument )
{
	return;
}*/

void do_bbk(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_bbk]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

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

	if ( ch->mana < skill_table[gsn_bbk]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_bbk]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_bbk]->focus;

    WAIT_STATE( ch, skill_table[gsn_bbk]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_bbk ) )
    {
//	dam = get_attmod(ch, victim) * number_range( 40, 44 );
	dam = get_attmod(ch, victim) * number_range( 70, 80 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
/*	act( AT_SKILL, "You hold one arm foward and create a blue ball of ki in your palm.", ch, NULL, victim, TO_CHAR );
 *	act( AT_SKILL, "The ball turns into a large beam and heads at $N. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
 *	act( AT_SKILL, "$n holds one arm foward and creates a blue ball of ki in $s palm.", ch, NULL, victim, TO_VICT );
 *	act( AT_SKILL, "The ball turns into a large beam and heads at you. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
 *	act( AT_SKILL, "$n holds one arm foward and creates a blue ball of ki in $s palm.", ch, NULL, victim, TO_NOTVICT );
 *	act( AT_SKILL, "The ball turns into a large beam and heads at $N. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT ); */
	act( AT_SKILL, "You hold one hand forward and create a large blue ball of ki in your palm.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "The ball turns into a large beam, "
                       "blasting from your hand toward $N. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_SKILL, "$n holds one hand forward and creates a large blue ball of ki in $s palm.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "The ball turns into a large beam, "
                       "blasting from $n's hand toward you. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	act( AT_SKILL, "$n holds one hand forward and creates a large blue ball of ki in $s palm.", ch, NULL, victim, TO_NOTVICT );
	act( AT_SKILL, "The ball turns into a large beam, "
                       "blasting from $n's hand toward $N. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

        dam = ki_absorb( victim, ch, dam, gsn_bbk );
	learn_from_success( ch, gsn_bbk );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You missed $N with your big bang kamehameha.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n misses you with $s big bang kamehameha.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n missed $N with a big bang kamehameha.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_bbk );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= skill_table[gsn_bbk]->min_mana;
    return;
}

void do_spirit_bomb(CHAR_DATA *ch, char *arg )
{
	CHAR_DATA *victim;
	CHAR_DATA *vch;
	CHAR_DATA *gvch_prev;
	int dam = 0;
	int damPercent = 0;
        float numFound = 1.0;
	int damMult = 0;
	bool max = FALSE;
	char size[MAX_STRING_LENGTH];
	char facialExpression[MAX_STRING_LENGTH];
	char engeryColor[MAX_STRING_LENGTH];
	char failVerb[MAX_STRING_LENGTH];
	
	size[0] = '\0';
	facialExpression[0] = '\0';
	engeryColor[0] = '\0';
	failVerb[0] = '\0';

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_spirit_bomb]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

	if ( arg[0] == '\0')
    	{
		send_to_char( "Syntax: 'spirit bomb' <damage/MAX>\n\r", ch );
		return;
    	}

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

	if ( ch->mana < skill_table[gsn_spirit_bomb]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}

	if (!strcmp(arg, "max"))
	{
		max = TRUE;
		damPercent = 100;
	}
	else if (is_number(arg))
	{
		damPercent = atoi(arg);
		if (damPercent < 75 || damPercent > 99)
		{
			send_to_char( "Percent must be 75 - 99.\n\r", ch );
			return;
    	}
    }
	else
    {
		send_to_char( "Syntax: 'spirit bomb' <percent/MAX>\n\r", ch );
		return;
    }
	
    if ( can_use_skill(ch, number_percent(),gsn_spirit_bomb ) )
    {
	for ( vch = last_char; vch; vch = gvch_prev )
	{
		if ( vch == first_char && vch->prev )
		{
			bug( "do_spirit_bomb: first_char->prev != NULL... fixed", 0 );
			vch->prev = NULL;
		}
		gvch_prev = vch->prev;
		
		if (ch->in_room->area != vch->in_room->area)
			continue;
		
		if (vch == victim)
			continue;

                if( vch->race == race_lookup( "android" ) )
                        continue;

		if (IS_GOOD(ch) && !IS_EVIL(vch))
		{
			if (IS_NPC(vch))
//				damMult += get_npc_rank(vch) / 2;
				numFound += 0.45;
			else
//				damMult += get_true_rank(vch);
				numFound += (get_true_rank(vch) > 10 ? 1.0 : 0.65);
		}
		else if (IS_EVIL(ch) && !IS_GOOD(vch))
		{
			if (IS_NPC(vch))
//				damMult += get_npc_rank(vch) / 2;
				numFound += 0.45;
			else
//				damMult += get_true_rank(vch);
				numFound += (get_true_rank(vch) > 10 ? 1.0 : 0.65);
		}
		else
		{
			if (IS_NPC(vch))
//				damMult += get_npc_rank(vch) / 2;
				numFound += 0.45;
			else
//				damMult += get_true_rank(vch);
				numFound += (get_true_rank(vch) > 10 ? 1.0 : 0.65);
		}
	}
        damMult = (int)numFound;

	if(ch->focus < damPercent)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= damPercent;
	
	dam = number_range(15, 20);
	dam *= damMult;
	dam *= damPercent;
	dam /= 1000;

	if (dam <= 15)
		strcpy(size, "tiny");
	else if (dam <= 25)
		strcpy(size, "small");
	else if (dam <= 35)
		strcpy(size, "little");
	else if (dam <= 45)
		strcpy(size, "large");
	else if (dam <= 50)
		strcpy(size, "big");
	else if (dam <= 75)
		strcpy(size, "huge");
	else if (dam <= 100)
		strcpy(size, "great");
	else if (dam <= 250)
		strcpy(size, "enormous");
	else if (dam <= 500)
		strcpy(size, "massive");
	else if (dam <= 750)
		strcpy(size, "gigantic");
	else if (dam <= 1000)
		strcpy(size, "immense");
	else if (dam <= 2500)
		strcpy(size, "monstrous");
	else if (dam <= 5000)
		strcpy(size, "mammoth");
	else if (dam <= 7500)
		strcpy(size, "vast");
	else if (dam <= 10000)
		strcpy(size, "gargantuan");
	else
		strcpy(size, "colossal");
	/* after the adjectives becase pl diffrence shouldn't affect
	   the size of the attack -Goku */
	dam = get_attmod(ch, victim) * dam;
	
	if (IS_GOOD(ch))
	{
		strcpy(facialExpression, "smile");
		strcpy(engeryColor, "bluish");
	}
	else if (IS_EVIL(ch))
	{
		strcpy(facialExpression, "smirk");
		strcpy(engeryColor, "reddish");
	}
	else
	{
		strcpy(facialExpression, "grimace");
		strcpy(engeryColor, "whitish");
	}

	act( AT_SKILL, "You raise your hands above your head, motes of $t energy beginning to form above your palms.", ch, engeryColor, victim, TO_CHAR );
	act( AT_SKILL, "$n raises $s hands above $s head, motes of $t energy beginning to form above $n's palms.", ch, engeryColor, victim, TO_VICT );
	act( AT_SKILL, "$n raises $s hands above $s head, motes of $t energy beginning to form above $n's palms.", ch, engeryColor, victim, TO_NOTVICT );
	if (IS_GOOD(ch))
	{
		do_say(ch, "&YThe stars, the trees, all living things...lend me your energy!");
	}
	else if (IS_EVIL(ch))
	{
		do_say(ch, "&YThe stars, the storm, crash of death....give me your power!");
	}
	else
	{
		do_say(ch, "&YThe stars, the planets, the spark of life...I need your energy!");
	}

	act2( AT_SKILL, "A $t ball of swirling $T energy forms above your upturned palms, growing slowly larger as you draw in more energy from the cosmos.", ch, size, victim, TO_CHAR, engeryColor );
	act( AT_SKILL, "You $t as you toss the brilliant sphere of pure ki towards $N.", ch, facialExpression, victim, TO_CHAR );
	act( AT_SKILL, "$N is slowly engulfed by the spirit bomb, ripped apart by the gathered energy. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );

	act2( AT_SKILL, "A $t ball of swirling $T energy forms above $n's upturned palms, growing slowly larger as $e draws in more energy from the cosmos.", ch, size, victim, TO_VICT, engeryColor );
	act( AT_SKILL, "$n $ts as $e tosses the brilliant sphere of pure ki towards you.", ch, facialExpression, victim, TO_VICT );
	act( AT_SKILL, "You are slowly engulfed by the spirit bomb, ripped apart by the gathered energy. &W[$t]", ch, num_punct(dam), victim, TO_VICT );

	act2( AT_SKILL, "A $t ball of swirling $T energy forms above $n's upturned palms, growing slowly larger as $e draws in more energy from the cosmos.", ch, size, victim, TO_NOTVICT, engeryColor );
	act( AT_SKILL, "$n $ts as $e tosses the brilliant sphere of pure ki towards $N.", ch, facialExpression, victim, TO_NOTVICT );
	act( AT_SKILL, "$N is slowly engulfed by the spirit bomb, ripped apart by the gathered energy. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	learn_from_success( ch, gsn_spirit_bomb );
	global_retcode = damage( ch, victim, (get_attmod(ch, victim) * dam * number_range(2, 5)), TYPE_HIT );
    }
    else
    {

		if (IS_GOOD(ch))
		{
			strcpy(failVerb, "cry for help");
		}
		else if (IS_EVIL(ch))
		{
			strcpy(failVerb, "plea for assistance");
		}
		else
		{
			strcpy(failVerb, "demand for power");
		}


	act( AT_SKILL, "Only a few dots of energy gather before quickly dispersing, your $t going unanswered.", ch, failVerb, victim, TO_CHAR );
	act( AT_SKILL, "Only a few dots of energy gather before quickly dispersing, $n's $t going unanswered.", ch, failVerb, victim, TO_VICT );
	act( AT_SKILL, "Only a few dots of energy gather before quickly dispersing, $n's $t going unanswered.", ch, failVerb, victim, TO_NOTVICT );

	learn_from_failure( ch, gsn_spirit_bomb );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
 
    WAIT_STATE( ch, ( skill_table[gsn_spirit_bomb]->beats ) );
	ch->mana -= skill_table[gsn_spirit_bomb]->min_mana;
	return;
}

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

	if (xIS_SET((ch)->affected_by, AFF_KAIOKEN))
        {
		send_to_char( "You can't transform in to a super saiyan while using kaioken.\n\r", ch );
		return;
	}
        if( xIS_SET( (ch)->affected_by, AFF_SSJ )
         && xIS_SET( (ch)->affected_by, AFF_USSJ ) 
         && !xIS_SET( (ch)->affected_by, AFF_USSJ2 ) )
        {
          send_to_char( "Your bulging muscles retract as you power down.\n\r", ch );
          xREMOVE_BIT( (ch)->affected_by, AFF_USSJ );
          transStatRemove( ch );
	  ch->pl = ch->exp * 10;
	  transStatApply(ch, 10, 5, 3, 5);
          return;
        }
        else
        if( xIS_SET( (ch)->affected_by, AFF_SSJ2 )
         || xIS_SET( (ch)->affected_by, AFF_SSJ3 )
         || xIS_SET( (ch)->affected_by, AFF_SSJ4 ) )

	{
          send_to_char( "You are already powered up beyond this technique.\n\r", ch );
		return;
    	}
        else
        if( xIS_SET( (ch)->affected_by, AFF_SSJ )
         && xIS_SET( (ch)->affected_by, AFF_USSJ ) 
         && xIS_SET( (ch)->affected_by, AFF_USSJ2 ) )
        {
          send_to_char( "You have to power out of USSJ2 to do this.\n\r", ch );
          return;
        }

        if( !xIS_SET( (ch)->affected_by, AFF_SSJ ) )
        {
          send_to_char( "You need to be powered up to super saiyan to use this!\n\r", ch );
          return;
        }
	if (xIS_SET((ch)->affected_by, AFF_OOZARU))
	    {
		send_to_char( "You can't transform while you are an Oozaru.\n\r", ch );
		return;
		}

	if ( ch->mana < skill_table[gsn_ussj]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}

    WAIT_STATE( ch, skill_table[gsn_ussj]->beats );
   if ( can_use_skill(ch, number_percent(), gsn_ussj ) )
	{
	act( AT_YELLOW, "You draw in energy, forcing it directly into your body.  Your muscles bulge as your hair "
                        "turns slightly spikier.", ch, NULL, NULL, TO_CHAR );
	act( AT_YELLOW, "$n draws in energy, forcing it directly into $s body.  $n's muscles bulge as $s hair "
                        "turns slightly spikier.", ch, NULL, NULL, TO_NOTVICT );
	xSET_BIT( (ch)->affected_by, AFF_USSJ );
	ch->pl = ch->exp * 12;
	transStatApply(ch, 16, 5, 3, 5);
	learn_from_success( ch, gsn_ussj );
    }
	else
        {
		act( AT_BLUE, "You grunt in exertion and your muscles bulge for a moment.", ch, NULL, NULL, TO_CHAR );
		act( AT_BLUE, "$n grunts in exertion and $s muscles bulge for a moment.", ch, NULL, NULL, TO_NOTVICT );
	        learn_from_failure( ch, gsn_ussj );
        }

	ch->mana -= skill_table[gsn_ussj]->min_mana;
	return;
}

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

	if (xIS_SET((ch)->affected_by, AFF_KAIOKEN))
        {
		send_to_char( "You can't transform in to a super saiyan while using kaioken.\n\r", ch );
		return;
	}
        if( xIS_SET( (ch)->affected_by, AFF_SSJ )
         && xIS_SET( (ch)->affected_by, AFF_USSJ ) 
         && xIS_SET( (ch)->affected_by, AFF_USSJ2 ) )
        {
          send_to_char( "Your bulging muscles retract a little as you power down.\n\r", ch );
          xREMOVE_BIT( (ch)->affected_by, AFF_USSJ2 );
          transStatRemove( ch );
	  ch->pl = ch->exp * 12;
	  transStatApply(ch, 16, 5, 3, 5);
          return;
        }
        else
        if( xIS_SET( (ch)->affected_by, AFF_SSJ2 )
         || xIS_SET( (ch)->affected_by, AFF_SSJ3 )
         || xIS_SET( (ch)->affected_by, AFF_SSJ4 ) )

	{
          send_to_char( "You are already powered up beyond this technique.\n\r", ch );
		return;
    	}

        if( !xIS_SET( (ch)->affected_by, AFF_SSJ ) 
         && !xIS_SET( (ch)->affected_by, AFF_USSJ ) )
        {
          send_to_char( "You need to be powered up to ultra super saiyan to use this!\n\r", ch );
          return;
        }

        if( xIS_SET( (ch)->affected_by, AFF_SSJ ) 
         && !xIS_SET( (ch)->affected_by, AFF_USSJ ) )
        {
          send_to_char( "You need to be powered up to ultra super saiyan to use this!\n\r", ch );
          return;
        }

	if (xIS_SET((ch)->affected_by, AFF_OOZARU))
	    {
		send_to_char( "You can't transform while you are an Oozaru.\n\r", ch );
		return;
		}

	if ( ch->mana < skill_table[gsn_ussj2]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}

    WAIT_STATE( ch, skill_table[gsn_ussj2]->beats );
   if ( can_use_skill(ch, number_percent(), gsn_ussj2 ) )
	{
	act( AT_YELLOW, "You draw in massive amounts of energy, forcing it directly into your body.  Your muscles "
                        "bulge to inhuman sizes, your hair becomes wildly spiked.", ch, NULL, NULL, TO_CHAR );
	act( AT_YELLOW, "$n draws in massive amounts of energy, forcing it directly into $s body.  $n's muscles "
                        "bulge to inhuman sizes, $s hair becomes wildly spiked.", ch, NULL, NULL, TO_NOTVICT );
	xSET_BIT( (ch)->affected_by, AFF_USSJ2 );
	ch->pl = ch->exp * 14;
	transStatApply(ch, 24, -15, 5, 8);
	learn_from_success( ch, gsn_ussj2 );
    }
	else
        {
		act( AT_BLUE, "You grunt in massive exertion and your muscles bulge for a moment.", ch, NULL, NULL, TO_CHAR );
		act( AT_BLUE, "$n grunts in massive exertion and $s muscles bulge for a moment.", ch, NULL, NULL, TO_NOTVICT );
	        learn_from_failure( ch, gsn_ussj2 );
        }

	ch->mana -= skill_table[gsn_ussj2]->min_mana;
	return;
}


void do_extreme(CHAR_DATA *ch, char *argument)
{
	if (xIS_SET((ch)->affected_by, AFF_EXTREME))
	{
		send_to_char("You power down and return to normal.\n\r", ch);
		xREMOVE_BIT((ch)->affected_by, AFF_EXTREME);
		ch->pl = ch->exp;
		transStatRemove(ch);
		return;
	}
	
	if (IS_SET(ch->pcdata->combatFlags, CMB_NO_HEART))
	{
		send_to_char("You must first disable heart to use the 'Extreme Technique.'\n\r",ch);
		return;
	}
	if (xIS_SET((ch)->affected_by, AFF_KAIOKEN))
	{
		send_to_char("You cannot use the 'Extreme Technique' in combination with kaioken.\n\r", ch);
		return;
	}
	if (xIS_SET((ch)->affected_by, AFF_HYPER))
	{
		send_to_char("You may not be in 'Hyper' to use the 'Extreme Technique'.\n\r", ch);
		return;
	}
	if (ch->mana < skill_table[gsn_extreme]->min_mana)
	{
	    send_to_char("You don't have enough energy.\n\r", ch);
	    return;
	}

	WAIT_STATE(ch, skill_table[gsn_extreme]->beats);
	if (can_use_skill(ch, number_percent(), gsn_extreme) )
	{
		act(AT_WHITE, "You close your eyes and concentrate, focusing all your energy and will to live on one point in your body.  A dot of light forms on your forehead, a bright white light spreading out and bathing you in its glow as your hidden power awakens.", ch, NULL, NULL, TO_CHAR);
		act(AT_WHITE, "$n closes $s eyes and concentrates, focusing all of $s energy and will to live on one point in $s body.  A dot of light forms on $n's forehead, a bright white light spreading out and bathing $s in its glow as $s hidden power awakens.", ch, NULL, NULL, TO_NOTVICT);
		xSET_BIT((ch)->affected_by, AFF_EXTREME);
		ch->pl = ch->exp * 25;
		transStatApply(ch, 20, 15, 12, 30);
		learn_from_success(ch, gsn_extreme);
	}

	else
	{
		act( AT_WHITE, "You close your eyes and concentrate, but can't seem to properly focus your immense energies.", ch, NULL, NULL, TO_CHAR );
		act( AT_WHITE, "$n closes $s eyes and concentrates, but can't seem to properly focus $s immense energies.", ch, NULL, NULL, TO_NOTVICT );
		learn_from_failure( ch, gsn_extreme );
	}

	ch->mana -= skill_table[gsn_extreme]->min_mana;
	return;
}

void do_kairestore( CHAR_DATA *ch, char *argument )
{
    char arg[MAX_INPUT_LENGTH];
    char arg2[MAX_INPUT_LENGTH];
//    bool boost = FALSE;

    set_char_color( AT_SKILL, ch );
    set_pager_color( AT_SKILL, ch );
    argument = one_argument( argument, arg );

    argument = one_argument( argument, arg2 );
/*
    if( number_range( 1, 3 ) == 3 )
    {
	send_to_char( "Boosting restore!\n\r", ch );
	boost = TRUE;
    }
*/
    CHAR_DATA *vch;
    CHAR_DATA *vch_next;

    if( !ch->pcdata )
	return;

    if( get_true_rank( ch ) < 11 )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

    if( IS_NPC( ch ) )
	return;

    if( sysdata.kaiRestoreTimer > 0 )
    {
	pager_printf( ch, "You can't restore for another %d minutes.  (Overall timer)\n\r", sysdata.kaiRestoreTimer );
	return;
    }

    if( ch->pcdata->eKTimer > 0 && !IS_IMMORTAL(ch) )
    {
	pager_printf( ch, "You can't restore for another %d minutes.  (Personal timer)\n\r", ch->pcdata->eKTimer );
	return;
    }

    if( ch->mana < 50000 )
    {
	send_to_char( "You need 50,000 energy to restore.\n\r", ch );
	return;
    }

    ch->mana -= 50000;
    ch->pcdata->eKTimer = 360;
    sysdata.kaiRestoreTimer = 20;
    save_char_obj( ch );
    send_to_char( "Beginning kairestore...\n\r", ch);
    for ( vch = first_char; vch; vch = vch_next )
    {
	vch_next = vch->next;
	if ( !IS_NPC( vch ) )
	{
/*	    if ( boost )
		vch->hit = vch->max_hit * 1.5;
	    else
*/		vch->hit = vch->max_hit;
	    vch->mana = vch->max_mana;
	    vch->move = vch->max_move;
	    update_pos (vch);
	    heart_calc(vch, "");
	    if( ch->pcdata->kaiRestoreMsg
		&& ch->pcdata->kaiRestoreMsg[0] != '\0'
		&& str_cmp( "(null)", ch->pcdata->kaiRestoreMsg ) )
		act( AT_LBLUE, ch->pcdata->kaiRestoreMsg, ch, NULL, vch, TO_VICT);
	    else
	    {
		act( AT_LBLUE, "An avatar of $n appears and performs some arcane symbols while", ch, NULL, vch, TO_VICT );
		act( AT_LBLUE, "muttering unheard words, and suddenly you feel refreshed as the", ch, NULL, vch, TO_VICT );
		act( AT_LBLUE, "avatar vanishes into nothingness.", ch, NULL, vch, TO_VICT );
	    }
	}
    }
    send_to_char( "All restored.\n\r", ch );
}

void do_setrestoremessage( CHAR_DATA *ch, char *argument )
{
    if ( !IS_NPC(ch) )
    {
	smash_tilde( argument );
	if( argument[0] == '\0' )
	{
	    pager_printf( ch, "Your current message is:\n\r%s\n\r", ch->pcdata->kaiRestoreMsg );
	    pager_printf( ch, "Use any argument to set your message.\n\r" );
	    pager_printf( ch, "Use clear to set it to the default.\n\r" );
	    return;
	}
	DISPOSE( ch->pcdata->kaiRestoreMsg );
	if( !str_cmp( argument, "clear" ) )
	{
	    ch->pcdata->kaiRestoreMsg = str_dup( "(null)" );
	    send_to_char_color( "&YKai restore message reset.\n\r", ch );
	    return;
	}
	else
	{
	    if( has_phrase( "$n", argument ) || has_phrase( strupper( ch->name ), strupper( argument ) ) )
		ch->pcdata->kaiRestoreMsg = str_dup( argument );
	    else
	    {
		send_to_char( "You must have your name in your message.\n\r", ch );
		return;
	    }
	}
	send_to_char_color( "&YKai restore message set.\n\r", ch );
    }
    return;
}

void do_wizard_switch( CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *maj;
    char arg[MAX_INPUT_LENGTH];

    one_argument( argument, arg );

    if ( ( maj = get_char_world( ch, arg ) ) == NULL )
	return;

    if ( !IS_NPC(maj) )
	return;

    ch->desc->character = maj;
//    ch->desc->original = ch;
    maj->level = ch->level;
    maj->desc = ch->desc;
    ch->desc = NULL;
    maj->pcdata = ch->pcdata;
    ch->pcdata = NULL;
    ch->pIndexData = maj->pIndexData;
    maj->pIndexData = NULL;
    xREMOVE_BIT( maj->act, ACT_IS_NPC );
    xSET_BIT( ch->act, ACT_IS_NPC );
}

void do_kaicreate( CHAR_DATA *ch, char *argument )
{
    char arg[MAX_INPUT_LENGTH];
    int vnum;
    OBJ_DATA *obj;

    argument = one_argument( argument, arg );

    if ( IS_NPC(ch) )
	return;

    if ( ch->mana <= skill_table[gsn_kaicreate]->min_mana )
    {
	send_to_char( "&WYou don't have enough energy!&D\n\r", ch );
	return;
    }

    if ( !str_cmp( arg, "uniform" ) )
	vnum = OBJ_VNUM_KAIUNI;
    else if ( !str_cmp( arg, "helmet" ) )
	vnum = OBJ_VNUM_KAIHELM;
    else if ( !str_cmp( arg, "earrings" ) )
	vnum = OBJ_VNUM_KAIEAR;
    else
    {
	send_to_char( "&WYou can create: uniform, helmet, earrings.&D\n\r", ch );
	return;
    }

    WAIT_STATE( ch, skill_table[gsn_kaicreate]->beats );
    if ( can_use_skill( ch, number_percent(), gsn_kaicreate ) )
    {
	obj = create_object( get_obj_index( vnum ), 0 );
	obj_to_char( obj, ch );
	act( AT_SKILL, "You make $p&G appear in a puff of smoke!", ch, obj, NULL, TO_CHAR );
	act( AT_SKILL, "$n makes $p&G appear in a puff of smoke!", ch, obj, NULL, TO_NOTVICT );
	learn_from_success( ch, gsn_kaicreate );
    }
    else
    {
	act( AT_SKILL, "You try to create some gear, but fail!", ch, NULL, NULL, TO_CHAR );
	act( AT_SKILL, "$n tries to create some gear, but fails!", ch, NULL, NULL, TO_NOTVICT );
	learn_from_failure( ch, gsn_kaicreate );
    }

    ch->mana -= skill_table[gsn_kaicreate]->min_mana;
    return;
}

void do_mystic( CHAR_DATA *ch, char *argument )
{
    char arg[MAX_INPUT_LENGTH];
    int pl_mult, pl_max;
    double val;

    argument = one_argument( argument, arg );

    if ( IS_NPC(ch) )
	return;

    if ( arg[0] == '\0' )
    {
	if ( !xIS_SET( ch->affected_by, AFF_MYSTIC ) )
	{
	    send_to_char( "&WSyntax: mystic <3 - 27>&D\n\r", ch );
	    return;
	}
	else
	{
	    act( AT_WHITE, "You power out of mystic.", ch, NULL, NULL, TO_CHAR );
	    act( AT_WHITE, "$n powers out of mystic.", ch, NULL, NULL, TO_NOTVICT );
	    xREMOVE_BIT( ch->affected_by, AFF_MYSTIC );
	    ch->pl = ch->exp;
	    transStatRemove( ch );
	    return;
	}
    }

    pl_mult = atoi( arg );

    if ( pl_mult < 3 || pl_mult > 27 )
    {
	send_to_char( "&WSyntax: mystic <3 - 27>&D\n\r", ch );
	return;
    }

    if ( pl_mult == (int)((ch->pl/ch->exp)*1.02) && xIS_SET( ch->affected_by, AFF_MYSTIC ) )
    {
	ch_printf( ch, "&WYou're already mystic %d, there, buddy.&D\n\r", pl_mult );
	return;
    }

    val = ( pow( ch->exp, 0.383 ) * 0.01 );
    pl_max = (int)val;

    if ( pl_mult > pl_max )
    {
	send_to_char( "&WYou can't attain that high of a multiplier yet.&D\n\r", ch );
	return;
    }

    if ( ch->mana <= (pl_mult * skill_table[gsn_mystic]->min_mana) )
    {
	send_to_char( "&WYou don't have enough energy.&D\n\r", ch );
	return;
    }

    WAIT_STATE( ch, skill_table[gsn_mystic]->beats );
    if ( can_use_skill( ch, number_percent(), gsn_mystic ) )
    {
	if ( pl_mult > ( ch->pl / ch->exp ) )
	{
	    act( AT_WHITE, "Your muscles surge with power and make ripping sounds as they expand, and white arcs of lightning spark around your body before magnificent white flames erupt around you.", ch, NULL, NULL, TO_CHAR );
	    act( AT_WHITE, "$n's muscles surge with power and make ripping sounds as they expand, and white arcs of lightning spark around $s body before magnificent white flames erupt around $m.", ch, NULL, NULL, TO_NOTVICT );
	}
	else
	{
	    act( AT_WHITE, "Your muscles shrink a bit, and your aura becomes less intense as you lower your power.", ch, NULL, NULL, TO_CHAR );
	    act( AT_WHITE, "$n's muscles shrink a bit, and $s aura becomes less intense as $e lowers $s power.", ch, NULL, NULL, TO_NOTVICT );
	}
	ch->pl = ch->exp * pl_mult;
	transStatApply( ch, pl_mult/4, pl_mult/2, pl_mult, pl_mult );
	xSET_BIT( ch->affected_by, AFF_MYSTIC );
	learn_from_success( ch, gsn_mystic );
    }
    else
    {
	act( AT_WHITE, "You try to power up into mystic, but fail.", ch, NULL, NULL, TO_CHAR );
	act( AT_WHITE, "$n tries to power up into mystic, but fails.", ch, NULL, NULL, TO_NOTVICT );
	learn_from_failure( ch, gsn_mystic );
    }

    ch->mana -= pl_mult * skill_table[gsn_mystic]->min_mana;
    return;
}

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

    if ( xIS_SET( ch->affected_by, AFF_TIMESTOP ) )
    {
        act( AT_SKILL, "Time resumes.", ch, NULL, NULL, TO_CHAR );
        act( AT_SKILL, "Time around $n returns to normal.", ch, NULL, NULL, TO_NOTVICT );
        xREMOVE_BIT( ch->affected_by, AFF_TIMESTOP );
        return;
    }

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

    if ( !IS_NPC(ch) && ch->pcdata->timestop > 0 )
    {
        send_to_char( "You can't do that again yet.\n\r", ch );
        return;
    }

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

    if ( ch->mana < skill_table[gsn_timestop]->min_mana )
    {
        send_to_char( "You don't have enough energy.\n\r", ch );
        return;
    }

    if (ch->focus < skill_table[gsn_timestop]->focus)
    {
	send_to_char( "You need to focus more.\n\r", ch );
	return;
    }

    if ( can_use_skill( ch, number_percent(), gsn_timestop ) )
    {
        act( AT_SKILL, "You hold up your palm toward $N and focus on $M. Time around $M seems to stop...", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n holds up $s palm toward you and focuses. Time around you seems to stop...", ch, NULL, victim, TO_VICT );
        act( AT_SKILL, "$n holds up $s palm toward $N and focuses on $M. Time around $M seems to stop...", ch, NULL, victim, TO_NOTVICT );
        add_timer( victim, TIMER_ASUPRESSED, 5, NULL, 1 );
        add_timer( victim, TIMER_DO_FUN, 5, do_timestop, 1 );
        WAIT_STATE( victim, 5 * PULSE_VIOLENCE );
        xSET_BIT( victim->affected_by, AFF_TIMESTOP );
        if( !IS_NPC(ch) )
            ch->pcdata->timestop = 45;
        // Kludge on 3x gains.
        learn_from_success( ch, gsn_timestop );
        learn_from_success( ch, gsn_timestop );
        learn_from_success( ch, gsn_timestop );
    }
    else
    {
        act( AT_SKILL, "You hold up your palms and focus on $N. Nothing happens.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n holds up $s palms and focuses on you. Nothing happens.", ch, NULL, victim, TO_VICT );
        act( AT_SKILL, "$n holds up $s palms and focuses on $N. Nothing happens.", ch, NULL, victim, TO_NOTVICT );
        // Kludge again.
        learn_from_failure( ch, gsn_timestop );
        learn_from_failure( ch, gsn_timestop );
    }

    ch->mana -= skill_table[gsn_timestop]->min_mana;
    ch->focus -= skill_table[gsn_timestop]->focus;
    return;
}

void do_teleport( CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    CHAR_DATA *fch, *fch_next;
    ROOM_INDEX_DATA *room;
    char arg[MAX_INPUT_LENGTH];

    argument = one_argument( argument, arg );

    if ( IS_NPC(ch) )
	return;

    if ( ch->mana < skill_table[gsn_teleport]->min_mana )
    {
	send_to_char( "You don't have enough energy.\n\r", ch );
	return;
    }

    if ( ( who_fighting( ch ) ) != NULL )
    {
	send_to_char( "You can't do that while fighting.\n\r", ch );
	return;
    }

    if ( ( victim = get_char_world( ch, arg ) ) == NULL
	|| !can_astral( ch, victim )
	|| !in_soft_range( ch, victim->in_room->area )
	|| !in_hard_range( ch, victim->in_room->area )
	|| xIS_SET( victim->in_room->room_flags, ROOM_PROTOTYPE )
	|| IS_IMMORTAL( victim )
	|| ( !IS_NPC( victim ) && !victim->desc ) )
    {
	send_to_char( "You can't seem to find them.\n\r", ch );
	return;
    }

    if ( !victim->in_room )
    {
	send_to_char( "Oh god, a bug! Tell Horus!\n\r", ch );
	return;
    }

    room = ch->in_room;
    WAIT_STATE( ch, skill_table[gsn_teleport]->beats );
    if ( can_use_skill( ch, number_percent(), gsn_teleport ) )
    {
	act( AT_WHITE, "You disappear with a bang!", ch, NULL, NULL, TO_CHAR );
	act( AT_WHITE, "$n disappears with a bang!", ch, NULL, NULL, TO_NOTVICT );
	char_from_room( ch );
	if ( ch->mount )
	{
	    char_from_room( ch->mount );
	    char_to_room( ch->mount, victim->in_room );
	}
	char_to_room( ch, victim->in_room );
	act( AT_WHITE, "You reappear next to $N.", ch, NULL, victim, TO_CHAR );
	act( AT_WHITE, "$n appears with a bang!", ch, NULL, NULL, TO_NOTVICT );
	do_look( ch, "auto" );
	for ( fch = room->first_person; fch; fch = fch_next )
	{
	    fch_next = fch->next_in_room;
	    if ( fch != ch && fch->master && fch->master == ch )
	    {
		act( AT_WHITE, "You disappear with a bang!", fch, NULL, NULL, TO_CHAR );
		act( AT_WHITE, "$n disappears with a bang!", fch, NULL, NULL, TO_NOTVICT );
		char_from_room( fch );
		char_to_room( fch, victim->in_room );
		act( AT_WHITE, "You reappear next to $N.", fch, NULL, ch, TO_CHAR );
		act( AT_WHITE, "$n appears with a bang!", fch, NULL, NULL, TO_NOTVICT );
		do_look( fch, "auto" );
	    }
	}
	learn_from_success( ch, gsn_teleport );
    }
    else
    {
	act( AT_WHITE, "You can't seem to get a lock on them.", ch, NULL, NULL, TO_CHAR );
	act( AT_WHITE, "$n tries to teleport, but fails.", ch, NULL, NULL, TO_NOTVICT );
	learn_from_failure( ch, gsn_teleport );
    }

    ch->mana -= skill_table[gsn_teleport]->min_mana;
    return;
}

void do_shockwave( CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam;

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

    if ((ch->race == 9)
    &&   (ch->exp < skill_table[gsn_genie_signature]->skill_level[ch->class]) )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }
    else
    {
      if ( (!IS_NPC(ch))
      &&  ( ch->exp < skill_table[gsn_shockwave]->skill_level[ch->class]) )
      {
	  send_to_char( "You can't do that.\n\r", ch );
	  return;
      }
    }

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

    if ( ch->mana <= skill_table[gsn_shockwave]->min_mana )
    {
	send_to_char( "You don't have enough energy.\n\r", ch );
	return;
    }

    if ( ch->focus < skill_table[gsn_shockwave]->focus )
    {
	send_to_char( "You need to focus more.\n\r", ch );
	return;
    }

    WAIT_STATE( ch, skill_table[gsn_shockwave]->beats );
    if (ch->race != 9)
    {
      if ( can_use_skill(ch, number_percent(),gsn_shockwave ) )
      {
	  dam = get_attmod( ch, victim ) * number_range( 19, 24 );
	  if ( ch->charge > 0 )
	    dam = chargeDamMult( ch, dam );

	  act( AT_SKILL, "You hold your arms up at chest height, palms forward, and focus on $N.", ch, NULL, victim, TO_CHAR );
	  act( AT_SKILL, "You thrust your arms forward sending an invisible wave of extreme force at $N! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_SKILL, "$n holds $s arms up at chest height, palms forward, and focuses on you.", ch, NULL, victim, TO_VICT );
	  act( AT_SKILL, "$n thrusts $s arms forward, sending an invisible wave of extreme force at you! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_SKILL, "$n holds $s arms up at chest height, palms forward, and focuses on $N.", ch, NULL, victim, TO_NOTVICT );
	  act( AT_SKILL, "$n thrusts $s arms forward, sending an invisible wave of extreme force at $N! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	  dam = ki_absorb( victim, ch, dam, gsn_shockwave );
	  learn_from_success( ch, gsn_shockwave );
	  global_retcode = damage( ch, victim, dam, gsn_shockwave );
      }
      else
      {
	  act( AT_SKILL, "You missed $N with your shockwave.", ch, NULL, victim, TO_CHAR );
	  act( AT_SKILL, "$n missed you with $s shockwave.", ch, NULL, victim, TO_VICT );
	  act( AT_SKILL, "$n missed $N with a shockwave.", ch, NULL, victim, TO_NOTVICT );

	  learn_from_failure( ch, gsn_shockwave );
	  global_retcode = damage( ch, victim, 0, gsn_shockwave );
      }
    }
    else
    {
      if ( can_use_skill(ch, number_percent(),gsn_genie_signature ) )
      {
	  dam = get_attmod( ch, victim ) * number_range( 19, 24 );
	  if ( ch->charge > 0 )
	    dam = chargeDamMult( ch, dam );

	  act( AT_PINK, "You hold your arms up at chest height, palms forward, and focus on $N.", ch, NULL, victim, TO_CHAR );
	  act( AT_PINK, "You thrust your arms forward sending an invisible wave of extreme force at $N! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_PINK, "$n holds $s arms up at chest height, palms forward, and focuses on you.", ch, NULL, victim, TO_VICT );
	  act( AT_PINK, "$n thrusts $s arms forward, sending an invisible wave of extreme force at you! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_PINK, "$n holds $s arms up at chest height, palms forward, and focuses on $N.", ch, NULL, victim, TO_NOTVICT );
	  act( AT_PINK, "$n thrusts $s arms forward, sending an invisible wave of extreme force at $N! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	  dam = ki_absorb( victim, ch, dam, gsn_shockwave );
	  learn_from_success( ch, gsn_genie_signature );
	  global_retcode = damage( ch, victim, dam, gsn_shockwave );
      }
      else
      {
	  act( AT_PURPLE, "You missed $N with your shockwave.", ch, NULL, victim, TO_CHAR );
	  act( AT_PURPLE, "$n missed you with $s shockwave.", ch, NULL, victim, TO_VICT );
	  act( AT_PURPLE, "$n missed $N with a shockwave.", ch, NULL, victim, TO_NOTVICT );

	  learn_from_failure( ch, gsn_genie_signature );
	  global_retcode = damage( ch, victim, 0, gsn_shockwave );
      }
    }

    ch->mana -= skill_table[gsn_shockwave]->min_mana;
    ch->focus -= skill_table[gsn_shockwave]->focus;
    return;
}

void do_divine_fate( CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam;

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

    if ((ch->race == 9)
    &&   (ch->exp < skill_table[gsn_genie_finisher]->skill_level[ch->class]) )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }
    else
    {
      if ( (!IS_NPC(ch))
      &&   (ch->exp < skill_table[gsn_divine_fate]->skill_level[ch->class]) )
      {
	  send_to_char( "You can't do that.\n\r", ch );
	  return;
      }
    }

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

    if ( ch->mana <= skill_table[gsn_divine_fate]->min_mana )
    {
	send_to_char( "You don't have enough energy.\n\r", ch );
	return;
    }

    if ( ch->focus < skill_table[gsn_divine_fate]->focus )
    {
	send_to_char( "You need to focus more.\n\r", ch );
	return;
    }

    WAIT_STATE( ch, skill_table[gsn_divine_fate]->beats );
    if (ch->race != 9)
    {
      if ( can_use_skill(ch, number_percent(),gsn_divine_fate ) )
      {
	  dam = get_attmod( ch, victim ) * number_range( 57, 63 );
	  if ( ch->charge > 0 )
	    dam = chargeDamMult( ch, dam );

	  act( AT_SKILL, "You hold your hands together in a prayer like fashion and begin to glow brightly, your hands shine profusely and ki begins to gather above you. A massive yellow ball of energy begins swirling into existence overhead draining the nearby energy of plants and the planet itself.", ch, NULL, victim, TO_CHAR );
	  act( AT_SKILL, "The ball reaches an enormous size and screeches toward $N, exploding in a shower of sparks upon impact. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_SKILL, "$n holds $s hands together in a prayer like fashion and begins to glow brightly, $s hands shine profusely and ki begins to gather above $m. A massive yellow ball of energy begins swirling into existence overhead draining the nearby energy of plants and the planet itself.", ch, NULL, victim, TO_VICT );
	  act( AT_SKILL, "The ball reaches an enormous size and screeches toward you, exploding in a shower of sparks upon impact. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_SKILL, "$n holds $s hands together in a prayer like fashion and begins to glow brightly, $s hands shine profusely and ki begins to gather above $m. A massive yellow ball of energy begins swirling into existence overhead draining the nearby energy of plants and the planet itself.", ch, NULL, victim, TO_NOTVICT );
	  act( AT_SKILL, "The ball reaches an enormous size and screeches toward $N, exploding in a shower of sparks upon impact. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	  dam = ki_absorb( victim, ch, dam, gsn_divine_fate );
	  learn_from_success( ch, gsn_divine_fate );
	  global_retcode = damage( ch, victim, dam, gsn_divine_fate );
      }
      else
      {
	  act( AT_SKILL, "You miss $N with your divine fate.", ch, NULL, victim, TO_CHAR );
	  act( AT_SKILL, "$n misses you with $s divine fate.", ch, NULL, victim, TO_VICT );
	  act( AT_SKILL, "$n misses $N with a divine fate.", ch, NULL, victim, TO_NOTVICT );

	  learn_from_failure( ch, gsn_divine_fate );
	  global_retcode = damage( ch, victim, 0, gsn_divine_fate );
      }
    }
    else
    {
      if ( can_use_skill(ch, number_percent(),gsn_genie_finisher ) )
      {
	  dam = get_attmod( ch, victim ) * number_range( 57, 63 );
	  if ( ch->charge > 0 )
	    dam = chargeDamMult( ch, dam );

	  act( AT_PINK, "You hold your hands together in a prayer like fashion and begin to glow brightly, your hands shine profusely and ki begins to gather above you. A massive yellow ball of energy begins swirling into existence overhead draining the nearby energy of plants and the planet itself.", ch, NULL, victim, TO_CHAR );
	  act( AT_PINK, "The ball reaches an enormous size and screeches toward $N, exploding in a shower of sparks upon impact. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_PINK, "$n holds $s hands together in a prayer like fashion and begins to glow brightly, $s hands shine profusely and ki begins to gather above $m. A massive yellow ball of energy begins swirling into existence overhead draining the nearby energy of plants and the planet itself.", ch, NULL, victim, TO_VICT );
	  act( AT_PINK, "The ball reaches an enormous size and screeches toward you, exploding in a shower of sparks upon impact. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_PINK, "$n holds $s hands together in a prayer like fashion and begins to glow brightly, $s hands shine profusely and ki begins to gather above $m. A massive yellow ball of energy begins swirling into existence overhead draining the nearby energy of plants and the planet itself.", ch, NULL, victim, TO_NOTVICT );
	  act( AT_PINK, "The ball reaches an enormous size and screeches toward $N, exploding in a shower of sparks upon impact. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	  dam = ki_absorb( victim, ch, dam, gsn_divine_fate );
	  learn_from_success( ch, gsn_genie_finisher );
	  global_retcode = damage( ch, victim, dam, gsn_divine_fate );
      }
      else
      {
	  act( AT_PURPLE, "You miss $N with your divine fate.", ch, NULL, victim, TO_CHAR );
	  act( AT_PURPLE, "$n misses you with $s divine fate.", ch, NULL, victim, TO_VICT );
	  act( AT_PURPLE, "$n misses $N with a divine fate.", ch, NULL, victim, TO_NOTVICT );

	  learn_from_failure( ch, gsn_genie_finisher );
	  global_retcode = damage( ch, victim, 0, gsn_divine_fate );
      }
    }

    ch->mana -= skill_table[gsn_divine_fate]->min_mana;
    ch->focus -= skill_table[gsn_divine_fate]->focus;
    return;
}

void do_heavenly_orbs( CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0, balls; /* LOL DAM BALLS */
    char arg[MAX_INPUT_LENGTH];
    char buf[MAX_STRING_LENGTH];

    argument = one_argument( argument, arg );
    buf[0] = '\0';

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

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

    balls = atoi( arg );

    if ( balls < 1 || balls > 45 )
    {
	send_to_char( "&WSyntax: 'heavenly orbs' <1 - 45>&D\n\r", ch );
	return;
    }

    if ( ch->mana <= (skill_table[gsn_horbs]->min_mana * balls) )
    {
	send_to_char( "You don't have enough energy.\n\r", ch );
	return;
    }

    if ( ch->focus < (int)(skill_table[gsn_horbs]->focus * balls / 1.75) )
    {
 	send_to_char( "You need to focus more.\n\r", ch );
	return;
    }

    WAIT_STATE( ch, skill_table[gsn_horbs]->beats + balls/10 );
    if ( can_use_skill( ch, number_percent(), gsn_horbs ) )
    {
	sprintf( buf, "%d", balls );
	while ( balls > 0 )
	{
	    switch( number_range( 1, 4 ) )
	    {
		case 1: dam += 1; break;
		case 2: dam += 2; break;
		case 3: dam += 0; break;
		case 4: dam += number_range( 0, 2 ); break;
		default: break;
	    }
	    balls--;
	}

	dam = ( get_attmod( ch, victim ) * (1+dam) * 1.5 );
	act( AT_SKILL, "You flail your arms about for several moments, but nothing seems to happen. Suddenly, $t bright cyan orbs appear all around $N!", ch, buf, victim, TO_CHAR );
	act( AT_SKILL, "The orbs hover in the air ominously for a moment, before you yell \"Atone for your sinful ways, $N!\". The heavenly orbs fly toward $N and smash into $S body! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_SKILL, "$n flails $s arms about for several moments, but nothing seems to happen. Suddenly, $t bright cyan orbs appear all around you!", ch, buf, victim, TO_VICT );
	act( AT_SKILL, "The orbs hover in the air ominously for a moment, before $n yells \"Atone for your sinful ways, $N!\". The heavenly orbs fly toward you and smash into your body! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	act( AT_SKILL, "$n flails $s arms about for several moments, but nothing seems to happen. Suddenly, $t bright cyan orbs appear all around $N!", ch, buf, victim, TO_NOTVICT );
	act( AT_SKILL, "The orbs hover in the air ominously for a moment, before $n yells \"Atone for your sinful ways, $N!\". The heavenly orbs fly toward $N and smash into $S body! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	dam = ki_absorb( victim, ch, dam, gsn_horbs );
	learn_from_success( ch, gsn_horbs );
	global_retcode = damage( ch, victim, dam, gsn_horbs );
    }
    else
    {
	act( AT_SKILL, "You miss $N with your heavenly orbs.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n misses you with $s heavenly orbs.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n misses $N with $s heavenly orbs.", ch, NULL, victim, TO_NOTVICT );

	learn_from_failure( ch, gsn_horbs );
	global_retcode = damage( ch, victim, 0, gsn_horbs );
    }

    balls = ( buf[0] != '\0' ? atoi(buf) : balls );
    ch->mana -= skill_table[gsn_horbs]->min_mana * balls;
    ch->focus -= skill_table[gsn_horbs]->focus * balls / 1.75;
    return;
}

void do_kai_heal( CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    char arg[MAX_INPUT_LENGTH];

    argument = one_argument( argument, arg );

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

    if ( arg[0] == '\0' )
    {
	send_to_char( "Whom do you wish to heal?\n\r", ch );
	return;
    }

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

    if ( IS_NPC(victim) )
    {
	send_to_char( "You can't heal NPCs.\n\r", ch );
	return;
    }

    if ( ( who_fighting( ch ) ) != NULL )
    {
	send_to_char( "You can't do this while fighting.\n\r", ch );
	return;
    }

    if ( !IS_NPC(ch) && ch->pcdata->htimer > 0 )
    {
	ch_printf( ch, "You can't kai heal for %d minute%s.\n\r", ch->pcdata->htimer, (ch->pcdata->htimer == 1 ? "" : "s") );
	return;
    }

    if ( ch->mana <= skill_table[gsn_kaiheal]->min_mana )
    {
	send_to_char( "You don't have enough energy.\n\r", ch );
	return;
    }

    WAIT_STATE( ch, skill_table[gsn_kaiheal]->beats );
    if ( can_use_skill( ch, number_percent(), gsn_kaiheal ) )
    {
	if ( ch == victim )
	{
	    act( AT_BLUE, "You focus and heal your own wounds.", ch, NULL, NULL, TO_CHAR );
	    act( AT_BLUE, "$n focuses and heals $mself.", ch, NULL, NULL, TO_NOTVICT );
	}
	else
	{
	    act( AT_BLUE, "You lay your hands upon $N, restoring $M.", ch, NULL, victim, TO_CHAR );
	    act( AT_BLUE, "$n lays $s hands upon you, restoring you.", ch, NULL, victim, TO_VICT );
	    act( AT_BLUE, "$n lays $s hands upon $N, restoring $M.", ch, NULL, victim, TO_NOTVICT );
	}
	victim->hit = victim->max_hit;
	if ( ch != victim )
	    victim->mana = victim->max_mana;
	if ( !IS_NPC(ch) )
	    ch->pcdata->htimer = 5;
	learn_from_success( ch, gsn_kaiheal );
    }
    else
    {
	act( AT_BLUE, "You try to heal $N, but fail.", ch, NULL, victim, TO_CHAR );
	act( AT_BLUE, "$n tries to heal you, but fails.", ch, NULL, victim, TO_VICT );
	act( AT_BLUE, "$n tries to heal $N, but fails.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_kaiheal );
    }

    ch->mana -= skill_table[gsn_kaiheal]->min_mana;
    return;
}

void do_darkness_flare(CHAR_DATA *ch, char *argument )
{
        AFFECT_DATA af;
        CHAR_DATA *vch, *vch_next;

/*    if( IS_NPC(ch) && is_split(ch) )
    {
        if( !ch->master )
          return;
        if( !can_use_skill( ch->master, number_percent(), gsn_darkness_flare))
          return;
    } */

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_darkness_flare]->skill_level[ch->class] )
    {
        send_to_char( "You can't do that.\n\r", ch );
        return;
    }
    if ( xIS_SET(ch->in_room->room_flags, ROOM_ARENA)
      || xIS_SET(ch->in_room->room_flags, ROOM_SAFE))
    {
      send_to_char( "There's no need to use that here.\n\r", ch );
      return;
    }
    if ( who_fighting( ch ) == NULL )
    {
        send_to_char( "You aren't fighting anyone.\n\r", ch );
        return;
    }
        if ( ch->mana < skill_table[gsn_darkness_flare]->min_mana )
        {
            send_to_char( "You don't have enough energy.\n\r", ch );
            return;
        }
        if (ch->focus < skill_table[gsn_darkness_flare]->focus)
    {
                send_to_char( "You need to focus more.\n\r", ch );
                return;
    }
    else
        ch->focus -= skill_table[gsn_darkness_flare]->focus;

    WAIT_STATE( ch, skill_table[gsn_darkness_flare]->beats );

    if ( can_use_skill(ch, number_percent(),gsn_darkness_flare ) )
    {
        act( AT_DGREY, "You put your hands to your face and yell out 'DARKNESS FLARE!' emitting a blast of unpenetrable darkness.", ch, NULL, NULL, TO_CHAR );
        act( AT_DGREY, "$n puts $s hands to $s face and yells out 'DARKNESS FLARE!' blinding everyone in the room with unpenetrable darnkess!", ch, NULL, NULL, TO_NOTVICT );

        learn_from_success( ch, gsn_darkness_flare );
    for ( vch = ch->in_room->first_person; vch; vch = vch_next )
    {

        vch_next = vch->next_in_room;
        if( !IS_AWAKE( vch ) )
          continue;

        if( ch->race == RACE_DEMON || ch->race == RACE_ANDROID )
          continue;

        if( number_range( 1, 100 ) < ( get_curr_int( vch ) / 10 ) )
        {
          send_to_char( "You manage to look away at the last moment and shield "
                        "your eyes.\n\r", vch );
          continue;
        }

        if (ch != vch)
        {
                af.type      = gsn_darkness_flare;
                af.duration  = 15;
                af.location  = APPLY_HITROLL;
                af.modifier  = -6;
                af.bitvector = meb(AFF_BLIND);
                affect_to_char( vch, &af );
        }
    }

    }
    else
    {
        act( AT_DGREY, "You put your hands to your face but forget the words. Nothing happens.", ch, NULL, NULL, TO_CHAR );
        act( AT_DGREY, "$n raises $s hands to $s head, gets a stupid look on $s face, then stands there.", ch, NULL, NULL, TO_NOTVICT );
        learn_from_failure( ch, gsn_darkness_flare );
    }
    ch->mana -= skill_table[gsn_darkness_flare]->min_mana;
    return;
}

void do_noblebeam(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_noblebeam]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

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

	if ( ch->mana < skill_table[gsn_noblebeam]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_noblebeam]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_noblebeam]->focus;

    WAIT_STATE( ch, skill_table[gsn_noblebeam]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_noblebeam ) )
    {
	dam = get_attmod(ch, victim) * number_range( 20, 25 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	act( AT_SKILL, "You put your arms back and cup your hands. 'Noble Beam!!!!'	", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "You push your hands forward, throwing a cyan beam at $N. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_SKILL, "$n puts $s arms back and cups $s hands. 'Noble Beam!!!!'	", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n pushes $s hands forward, throwing a cyan beam at you. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	act( AT_SKILL, "$n puts $s arms back and cups $s hands. 'Noble Beam!!!!'	", ch, NULL, victim, TO_NOTVICT );
	act( AT_SKILL, "$n pushes $s hands forward, throwing a cyan beam at $N. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

        dam = ki_absorb( victim, ch, dam, gsn_noblebeam );
	learn_from_success( ch, gsn_noblebeam );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You missed $N with your noble beam.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n misses you with $s noble beam.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n missed $N with a noble beam.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_noblebeam );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= skill_table[gsn_noblebeam]->min_mana;
    return;
}

void do_bigbangkamehameha(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_bigbangkamehameha]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

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

    if (ch->race == 6)
    {
      if (ch->pcdata->absorb_pl_mod != 0)
      {
	  act( AT_LBLUE, "You hold one arm straight out but nothing happens.  ", ch, NULL, victim, TO_CHAR );
	  act( AT_LBLUE, "You seem to be missing something... ", ch, NULL, victim, TO_CHAR );
	  act( AT_LBLUE, "$n holds one arm straight out but nothing happens. Odd. ", ch, NULL, victim, TO_VICT );
	  act( AT_LBLUE, "$n holds one arm straight out but nothing happens. Odd. ", ch, NULL, victim, TO_NOTVICT );

        return;
      }
    }

	if ( ch->mana < skill_table[gsn_bigbangkamehameha]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_bigbangkamehameha]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_bigbangkamehameha]->focus;

    WAIT_STATE( ch, skill_table[gsn_bigbangkamehameha]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_bigbangkamehameha ) )
    {
	dam = get_attmod(ch, victim) * number_range( 65, 75 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	act( AT_SKILL, "You turn your body sideways, holding one arm straight out. As you do so, you bring you palm to face $N. A small ball of blue energy forms on your palm. It grows ever larger, as you pump more and more energy into it.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "You scream out 'Big Bang Kamehameha!' as you combine two of the greatest techniques ever made into one. A beam rockets from your palm, quickly hitting, and exploding upon $N. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_SKILL, "$n turns $s body sideways, holding one arm straight out. As $e does so, $e brings $s palm to face you. A small ball of blue energy forms on $s palm. It grows ever larger, as $e pumps more and more energy into it.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n screams out 'Big Bang Kamehameha!' as $s combines two of the greatest techniques ever made into one. A beam rockets from $s palm, quickly hitting, and exploding upon you. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	act( AT_SKILL, "$n turns $s body sideways, holding one arm straight out. As $e does so, $e brings $s palm to face $N. A small ball of blue energy forms on $s palm. It grows ever larger, as $e pumps more and more energy into it.", ch, NULL, victim, TO_NOTVICT );
	act( AT_SKILL, "$n screams out 'Big Bang Kamehameha!' as $s combines two of the greatest techniques ever made into one. A beam rockets from $s palm, quickly hitting, and exploding upon $N. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	learn_from_success( ch, gsn_bigbangkamehameha );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You missed $N with your big bang kamehameha.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n misses you with $s big bang kamehameha.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n missed $N with a big bang kamehameha.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_bigbangkamehameha );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= skill_table[gsn_bigbangkamehameha]->min_mana;
    return;
}

void do_dualsbc(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_dualsbc]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

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

    if (ch->race == 6)
    {
      if (ch->pcdata->absorb_pl_mod != 3)
      {
	  act( AT_GREEN, "You bring both arms to your forehead but nothing happens.  ", ch, NULL, victim, TO_CHAR );
	  act( AT_GREEN, "You seem to be missing something... ", ch, NULL, victim, TO_CHAR );
	  act( AT_GREEN, "$n brings both arms to $s forehead but nothing happens. Odd. ", ch, NULL, victim, TO_VICT );
	  act( AT_GREEN, "$n brings both arms to $s forehead but nothing happens. Odd. ", ch, NULL, victim, TO_NOTVICT );

        return;
      }
    }

	if ( ch->mana < skill_table[gsn_dualsbc]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_dualsbc]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_dualsbc]->focus;

    WAIT_STATE( ch, skill_table[gsn_dualsbc]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_dualsbc ) )
    {
	dam = get_attmod(ch, victim) * number_range( 65, 70 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	act( AT_SKILL, "You bring both of your arms to your forehead, holding two fingers from each hand directly over your forehead. Lightning begins to crackle and spark around the fingers, as two very small balls of yellow energy form on the fingertips. They grow slightly larger by the second, as your form the attack. ", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "You scream out 'Dual Special Beam Cannons!' as you fire the two beams consecutively. The first beam rockets from your fingers, drilling into $N's chest, pushing them back. Before they can react, another one hits them, which causes both to simultaneously explode. &W[$t] ", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_SKILL, "$n brings both of $s arms to $s forehead, holding two fingers from each hand directly over it. Lightning begins to crackle and spark around the fingers, as two very small balls of yellow energy form on the fingertips. They grow slightly larger by the second, as $e forms the attack. ", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n screams out 'Dual Special Beam Cannons!' as $s fires the two beams consecutively. The first beam rockets from $s fingers, drilling into your chest, pushing you back. Before you can react, the second beam is upon you, and it causes them both to explode simultaneously. &W[$t] ", ch, num_punct(dam), victim, TO_VICT );
	act( AT_SKILL, "$n brings both of $s arms to $s forehead, holding two fingers from each hand directly over it. Lightning begins to crackle and spark around the fingers, as two very small balls of yellow energy form on the fingertips. They grow slightly larger by the second, as $e forms the attack. ", ch, NULL, victim, TO_NOTVICT );
	act( AT_SKILL, "$n screams out 'Dual Special Beam Cannons!' as $s fires the two beams consecutively. The first beam rockets from $s fingers, drilling into $N's chest, pushing $m back. Before $N can react, the second beam is upon $m, and it causes the beams to explode simultaneously. &W[$t] ", ch, num_punct(dam), victim, TO_NOTVICT );

	learn_from_success( ch, gsn_dualsbc );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You missed $N with your dual special beam cannon.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n misses you with $s dual special beam cannon.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n missed $N with a dual special beam cannon.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_dualsbc );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= skill_table[gsn_dualsbc]->min_mana;
    return;
}

void do_sauzerblade(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_sauzerblade]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

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

    if (ch->race == 6)
    {
      if (ch->pcdata->absorb_pl_mod != 4)
      {
	  act( AT_PINK, "You lift one of your arms above your head but nothing happens.  ", ch, NULL, victim, TO_CHAR );
	  act( AT_PINK, "You seem to be missing something... ", ch, NULL, victim, TO_CHAR );
	  act( AT_PINK, "$n lifts one of $s arms above $s head but nothing happens. Odd. ", ch, NULL, victim, TO_VICT );
	  act( AT_PINK, "$n lifts one of $s arms above $s head but nothing happens. Odd. ", ch, NULL, victim, TO_NOTVICT );

        return;
      }
    }

	if ( ch->mana < skill_table[gsn_sauzerblade]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_sauzerblade]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_sauzerblade]->focus;

    WAIT_STATE( ch, skill_table[gsn_sauzerblade]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_sauzerblade ) )
    {
	dam = get_attmod(ch, victim) * number_range( 65, 70 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	act( AT_SKILL, "You lift one of your arms above your head, holding it there with your fingers straight in the air. You focus your ki into your arm, and the ki forms a solid blade around it, almost like a sword. As you continue to focus, the energy blade gets bigger and sharper until it is the size of an ordinary broad sword. ", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "You dash at $N before they can realize what you just created and slice at $m several times. You jump back and throw the sword made of ki directly at $N's chest, where it explodes gloriously. &W[$t] ", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_SKILL, "$n lifts one of $s arms above $s head, holding it there with $s fingers straight in the air. $e focuses $s ki into $s arm, and the ki forms a solid blade around it, almost like a sword. As $e continues to focus, the energy blade gets bigger and sharper until it is the size of an ordinary broad sword. ", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n dashes at you before you can realize what $e just created and slices at you several times. $n jumps back and throws the sword made of ki directly at your chest, where it explodes gloriously. &W[$t] ", ch, num_punct(dam), victim, TO_VICT );
	act( AT_SKILL, "$n lifts one of $s arms above $s head, holding it there with $s fingers straight in the air. $e focuses $s ki into $s arm, and the ki forms a solid blade around it, almost like a sword. As $e continues to focus, the energy blade gets bigger and sharper until it is the size of an ordinary broad sword. ", ch, NULL, victim, TO_NOTVICT );
	act( AT_SKILL, "$n dashes at $N before they can realize what $e just created and slices at them several times. $n jumps back and throws the sword made of ki directly at $N's chest, where it explodes gloriously. &W[$t] ", ch, num_punct(dam), victim, TO_NOTVICT );

	learn_from_success( ch, gsn_sauzerblade );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You missed $N with your sauzer blade.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n misses you with $s sauzer blade.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n missed $N with a sauzer blade.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_sauzerblade );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= skill_table[gsn_sauzerblade]->min_mana;
    return;
}

void do_apocalypse(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_apocalypse]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

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

    if (ch->race == 6)
    {
      if (ch->pcdata->absorb_pl_mod != 8)
      {
	  act( AT_DGREY, "You hold your hands above your head but nothing happens.  ", ch, NULL, victim, TO_CHAR );
	  act( AT_DGREY, "You seem to be missing something... ", ch, NULL, victim, TO_CHAR );
	  act( AT_DGREY, "$n holds $s hands above $s head but nothing happens. Odd. ", ch, NULL, victim, TO_VICT );
	  act( AT_DGREY, "$n holds $s hands above $s head but nothing happens. Odd. ", ch, NULL, victim, TO_NOTVICT );

        return;
      }
    }

	if ( ch->mana < skill_table[gsn_apocalypse]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_apocalypse]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_apocalypse]->focus;

    WAIT_STATE( ch, skill_table[gsn_apocalypse]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_apocalypse ) )
    {
	dam = get_attmod(ch, victim) * number_range( 67, 75 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	act( AT_SKILL, "You hold your hands up into the air and trace all the cosmos' evil energy back to the dark, makeo star. You draw power from this evil energy and gather a dark ki in your hands " , ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "The dark ki forms a mass of black energy, it swirls into a crimson lightning trimmed ball. With the power of a thousand evil deeds it slams into $N! &W[$t] ", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_SKILL, "$n thrusts $s hands heavenward and yells in fury. Thin red traces of ki spread from him before diving into each other and form a mass of dark energy. ", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n's eyes turn solid crimson as lightning arcs in waves around the newly formed apocalypse ki ball, it's hurled forward and slams into you! Searing pain courses through your body! &W[$t] ", ch, num_punct(dam), victim, TO_VICT );
	act( AT_SKILL, "$n throws $s hands skyward and begins to concentrate an immense amount of evil energy. A mixture of crimson and black ki gathers above. After a few moments, $e pulls $s hands down swiftly; the energy gathered from makeo star is suddenly launched in a fierce attack. ", ch, NULL, victim, TO_NOTVICT );
	act( AT_SKILL, "$n's eyes turn solid crimson as lightning arcs in waves above. The vicious ki ball smacks straight into $N &W[$t] ", ch, num_punct(dam), victim, TO_NOTVICT );

	learn_from_success( ch, gsn_apocalypse );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You missed $N with your apocalypse attack.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n misses you with $s apocalypse attack.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n missed $N with a apocalypse attack.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_apocalypse );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= skill_table[gsn_apocalypse]->min_mana;
    return;
}
void do_wolffangfist( CHAR_DATA *ch, char *arg )
{
    CHAR_DATA *victim;
    int combo = 0;
    int tehdamage = 0;
    int armorsmite = 0;
    int dam = 0;

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_wolffangfist]->skill_level[ch->class] )
    {
	send_to_char(
	    "You better leave the ass-kicking to ass-kickers.\n\r", ch );
	return;
    }

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

	if ( arg[0] == '\0' || atoi(arg) <= 0)
      {
        combo = 1;
      }
      else
      {
 	  combo = atoi(arg);
	  if (combo > 5)
		  combo = 5;
      }

	if ( ch->mana < skill_table[gsn_wolffangfist]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}

	if (ch->focus < skill_table[gsn_wolffangfist]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_wolffangfist]->focus;

    WAIT_STATE( ch, skill_table[gsn_wolffangfist]->beats );
    if ( can_use_skill( ch, number_percent(), gsn_wolffangfist ) )
    {
	if (combo >= 1)
      {
  	  dam = get_attmod(ch, victim) * number_range( 19, 31 );
        act( AT_RED, "You bring your right hand to your side; palm open, fingers curled. With a sudden burst of speed, you dash forward and drive your palm into $N's face as you yell, 'WOLF FANG FIST!' &W[$t] ", ch, num_punct(dam), victim, TO_CHAR );
        act( AT_RED, "$n brings $s right hand to $s side; palm open, fingers curled.  With a sudden burst of speed, $e dashes forward and drives $s palm into your face as $e yells, 'WOLF FANG FIST!' &W[$t] ", ch, num_punct(dam), victim, TO_VICT );
        act( AT_RED, "$n brings $s right hand to $s side; palm open, fingers curled.  With a sudden burst of speed, $e dashes forward and drives $s palm into $N's face as $e yells, 'WOLF FANG FIST!' &W[$t] ", ch, num_punct(dam), victim, TO_NOTVICT );

        ch->mana -= skill_table[gsn_wolffangfist]->min_mana;    
	  learn_from_success( ch, gsn_wolffangfist );	  
        tehdamage += dam;     
      }
      if (combo >= 2
          && ch->exp >= 750000000)
      {
        switch (number_range( 1, 2))
        {
	    default: 
	    case 1: 
            if (ch->focus >= 2
              && ch->mana >= 200)
          {
  	      dam = get_attmod(ch, victim) * number_range( 2, 5 );
	      act( AT_YELLOW, "You follow the strike up with a few slow setup punches, just fast and strong enough to keep $M reeling. &W[$t]  ", ch, num_punct(dam), victim, TO_CHAR );
	      act( AT_YELLOW, "$n follows the strike up with a few slow setup punches, just fast and strong enough to keep you reeling. &W[$t]  ", ch, num_punct(dam), victim, TO_VICT );
	      act( AT_YELLOW, "$n follows the strike up with a few slow setup punches, just fast and strong enough to keep $M reeling. &W[$t]  ", ch, num_punct(dam), victim, TO_NOTVICT );
    
            ch->focus -= 2;
            ch->mana -= 200;
            tehdamage += dam;  
          }
          else
          {
	      act( AT_DGREEN, "You abort the combo, unable to fully initiate it. &W[0]    ", ch, NULL, victim, TO_CHAR );                
	      act( AT_DGREEN, "$n aborts the combo, unable to fully initiate it. &W[0]    ", ch, NULL, victim, TO_VICT );
	      act( AT_DGREEN, "$n aborts the combo, unable to fully initiate it. &W[0] ", ch, NULL, victim, TO_NOTVICT );
    
          }
        break;
          case 2: 
          if (ch->focus >= 6
              && ch->mana >= 300)
          {
  	      dam = get_attmod(ch, victim) * number_range( 3, 8 );
            act( AT_RED, "Following the powerful strike, you jab $M swiftly in the chest and snap your hand back for a solid backhand. &W[$t]  ", ch, num_punct(dam), victim, TO_CHAR );
            act( AT_RED, "Following the powerful strike, $n jabs you swiftly in the chest and snaps $s hand back for a solid backhand. &W[$t]  ", ch, num_punct(dam), victim, TO_VICT );
            act( AT_RED, "Following the powerful strike, $n jabs $M swiftly in the chest and snaps $s hand back for a solid backhand. &W[$t]  ", ch, num_punct(dam), victim, TO_NOTVICT );
    
            ch->focus -= 6;
            ch->mana -= 300;
            tehdamage += dam; 
          }
          else
          {
	      act( AT_DGREEN, "You try to jab at $N, but $E recovers and blocks it. &W[0]    ", ch, NULL, victim, TO_CHAR );                
	      act( AT_DGREEN, "$n tries to jab at you, but you recover and block it. &W[0]   ", ch, NULL, victim, TO_VICT );
	      act( AT_DGREEN, "$n tries to jab at $N, but $E recovers and blocks it. &W[0] ", ch, NULL, victim, TO_NOTVICT );
    
          }
        break;    
        }
      }


      if (combo >= 3
          && ch->exp >= 750000000)
      {
        switch (number_range( 1, 2))
        {
	    default: 
	    case 1:
            if (ch->focus >= 2
                && ch->mana >= 200)
            {
  	        dam = get_attmod(ch, victim) * number_range( 2, 5 );
  	        act( AT_YELLOW, "You continue your physical assault, beating $N back with a flurry of punches until $E physically reels from each hit. &W[$t]    ", ch, num_punct(dam), victim, TO_CHAR );
	        act( AT_YELLOW, "$n continues $s physical assault, beating you back with a flurry of punches until you physically reel from each hit. &W[$t]    ", ch, num_punct(dam), victim, TO_VICT );
	        act( AT_YELLOW, "$n continues $s physical assault, beating $N back with a flurry of punches until $E physically reels from each hit. &W[$t] ", ch, num_punct(dam), victim, TO_NOTVICT ); 
    
              ch->focus -= 2;
              ch->mana -= 200;
              tehdamage += dam;  
            }
            else
            {
	        act( AT_DGREEN, "You abort the combo, unable to continue. &W[0]    ", ch, NULL, victim, TO_CHAR );                
	        act( AT_DGREEN, "$n aborts the combo, unable to continue. &W[0]    ", ch, NULL, victim, TO_VICT );
	        act( AT_DGREEN, "$n aborts the combo, unable to continue. &W[0] ", ch, NULL, victim, TO_NOTVICT );    
            }
          break;
          case 2: 
            if (ch->focus >= 6
                && ch->mana >= 300)
            {
  	        dam = get_attmod(ch, victim) * number_range( 3, 8 );
              act( AT_RED, "Dashing up close to $N, you throw an elbow across $S face and bring  it back into $S gut. &W[$t]   ", ch, num_punct(dam), victim, TO_CHAR );
              act( AT_RED, "Dashing up close to you, $n throws an elbow across your face and brings it back into your gut. &W[$t]    ", ch, num_punct(dam), victim, TO_VICT );
              act( AT_RED, "Dashing up close to $N, $n throws an elbow across $S face and brings it back into $S gut. &W[$t]    ", ch, num_punct(dam), victim, TO_NOTVICT );
    
              ch->focus -= 6;
              ch->mana -= 300;
              tehdamage += dam; 
            }
            else
            {
	        act( AT_DGREEN, "You whiff an elbow strike and fail to recover the combo. &W[0]     ", ch, NULL, victim, TO_CHAR );               
	        act( AT_DGREEN, "$n whiffs an elbow strike and fails to recover the combo. &W[0]    ", ch, NULL, victim, TO_VICT );
	        act( AT_DGREEN, "$n whiffs an elbow strike and fails to recover the combo. &W[0] ", ch, NULL, victim, TO_NOTVICT );
            }
          break;   
        }
      }
      if (combo >= 4
          && ch->exp >= 750000000)
      {
        switch (number_range( 1, 2))
        {
	    default: 
	    case 1:
            if (ch->focus >= 2
                && ch->mana >= 200)
            {
  	        dam = get_attmod(ch, victim) * number_range( 2, 5 );
  	        act( AT_YELLOW, "You start throwing punches steadily left and right, quickly building in speed until your fists become little more than blurs. &W[$t] ", ch, num_punct(dam), victim, TO_CHAR );
	        act( AT_YELLOW, "$n starts throwing punches steadily left and right, quickly building in speed until $s fists become little more than blurs. &W[$t]   ", ch, num_punct(dam), victim, TO_VICT );
	        act( AT_YELLOW, "$n starts throwing punches steadily left and right, quickly building in speed until $s fists become little more than blurs. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT ); 
    
              ch->focus -= 2;
              ch->mana -= 200;
              tehdamage += dam;  
            }
            else
            {
	        act( AT_DGREEN, "You try to start a chain of punches, but fail to establish a rhythm. &W[0]      ", ch, NULL, victim, TO_CHAR );                
	        act( AT_DGREEN, "$n tries to start a chain of punches, but fails to establish a rhythm. &W[0]    ", ch, NULL, victim, TO_VICT );
	        act( AT_DGREEN, "$n tries to start a chain of punches, but fails to establish a rhythm. &W[0] ", ch, NULL, victim, TO_NOTVICT );
            }
          break;
          case 2: 
            if (ch->focus >= 6
                && ch->mana >= 300)
            {
  	        dam = get_attmod(ch, victim) * number_range( 3, 8 );
              act( AT_RED, "You throw a hard right punch, followed by an even harder left. You pound mercilessly on $N in preparation for a finale... &W[$t]     ", ch, num_punct(dam), victim, TO_CHAR );
              act( AT_RED, "$n throws a hard right punch, followed by an even harder left. $e pounds mercilessly on you in preparation for a finale... &W[$t]   ", ch, num_punct(dam), victim, TO_VICT );
              act( AT_RED, "$n throws a hard right punch, followed by an even harder left. $e pounds mercilessly on $N in preparation for a finale... &W[$t] ", ch, num_punct(dam), victim, TO_NOTVICT );
    
              ch->focus -= 6;
              ch->mana -= 300;
              tehdamage += dam; 
            }
            else
            {
	        act( AT_DGREEN, "You throw a hard right punch that $N somehow manages to dodge! &W[0]     ", ch, NULL, victim, TO_CHAR );               
	        act( AT_DGREEN, "You somehow manage to dodge $n's hard right punch! &W[0]    ", ch, NULL, victim, TO_VICT );
	        act( AT_DGREEN, "$N somehow manages to dodge $n's hard right punch! &W[0] ", ch, NULL, victim, TO_NOTVICT );
            }
          break;    
        }
      }
      if (combo >= 5
          && ch->exp >= 1750000000)
      {
        switch (number_range( 1, 2))
        {
	    default: 
	    case 1: 
            if (ch->focus >= 7
                && ch->mana >= 400)
            {
              dam = get_attmod(ch, victim) * number_range( 5, 10 );
              act( AT_YELLOW, "Like a curled up panther ready to strike, you leap from a crouched position and slam into $N with more force than a runaway locomotive. Throwing both hands across your chest, you hit $N in the torso hard enough to crack $S armor... or was that a rib? &W[$t] ", ch, num_punct(dam), victim, TO_CHAR );
              act( AT_YELLOW, "Like a curled up panther ready to strike, $n leaps from a crouched position and slams into you with more force than a runaway locomotive. Throwing both hands across $s chest, $e hits you in the torso hard enough to crack your armor... or was that a rib? &W[$t] ", ch, num_punct(dam), victim, TO_VICT );
              act( AT_YELLOW, "Like a curled up panther ready to strike, $n leaps from a crouched position and slams into $N with more force than a runaway locomotive. Throwing both hands across $s chest, $e hits $N in the torso hard enough to crack $S armor... or was that a rib? &W[$t] ", ch, num_punct(dam), victim, TO_NOTVICT );
    
              ch->focus -= 7;
              ch->mana -= 400;
              tehdamage += dam;
              armorsmite = tehdamage * 2;
              dam_armor_recalc(victim, armorsmite); 
            }
            else
            {
	        act( AT_DGREEN, "You execute a flying cross-chop, but miss miserably and crash into the floor. &W[0]        ", ch, NULL, victim, TO_CHAR );                
	        act( AT_DGREEN, "$N executes a flying cross-chop, but misses miserably and crashes into the floor. &W[0]    ", ch, NULL, victim, TO_VICT );
	        act( AT_DGREEN, "$N executes a flying cross-chop, but misses miserably and crashes into the floor. &W[0] ", ch, NULL, victim, TO_NOTVICT );
            }
          break;
          case 2: 
            if (ch->focus >= 15
                && ch->mana >= 1600)
            {
	        switch (number_range(1,100))
	        {
                case 100:
 	            if (IS_NPC(victim) || (!IS_NPC(victim) && (!xIS_SET(ch->act, PLR_SPAR) || !xIS_SET(ch->act, PLR_SPAR) )))
 	            {
 	              if (victim->pl / ch->pl >= 3)
	              {                        
  	                dam = get_attmod(ch, victim) * number_range( 10, 15 );
                      act( AT_RED, "Leaning back on one foot, you hold a clawed hand aloft and begin to charge an immense power into it. Long before your prey could hope of recovering, your hand glows a bright crimson, and you charge $M at top speed crying your victory call, 'WOLF FANG FIST!' &W[$t]  ", ch, num_punct(dam), victim, TO_CHAR );
                      act( AT_RED, "YOUR OPPONENT NARROWLY ESCAPES AN INSTANT DEATH!                        ", ch, NULL, victim, TO_CHAR );
                      act( AT_RED, "Leaning back on one foot, $n holds a clawed hand aloft and begins to charge an immense power into it. Long before your have any hope of recovering, $s hand glows a bright crimson, and $e charges you at top speed crying $s victory call, 'WOLF FANG FIST!' &W[$t]    ", ch, num_punct(dam), victim, TO_VICT );
                      act( AT_RED, "YOU NARROWLY ESCAPE AN INSTANT DEATH! IS IT SKILL OR LUCK?              ", ch, NULL, victim, TO_VICT );
                      act( AT_RED, "Leaning back on one foot, $n holds a clawed hand aloft and begins to charge an immense power into it. Long before $s prey could hope of recovering, $s hand glows a bright crimson, and $e charges $M at top speed crying $s victory call, 'WOLF FANG FIST!' &W[$t] ", ch, num_punct(dam), victim, TO_NOTVICT );
                      act( AT_RED, "THE VICTIM NARROWLY ESCAPES AN INSTANT DEATH!                        ", ch, NULL, victim, TO_NOTVICT );
    
	                learn_from_success( ch, gsn_wolffangfist);
                      ch->focus -= 15;
                      ch->mana -= 1600;
                      tehdamage += dam; 
                    break;
                    }
                    else
                    {
  	                dam = 999999999;
                      act( AT_RED, "Leaning back on one foot, you hold a clawed hand aloft and begin to charge an immense power into it. Long before your prey could hope of recovering, your hand glows a bright crimson, and you charge $M at top speed crying your victory call, 'WOLF FANG FIST!' &W[$t]  ", ch, num_punct(dam), victim, TO_CHAR );
                      act( AT_RED, "YOUR HAND SHOOTS STRAIGHT THROUGH YOUR OPPONENT'S HEAD! INSTANT KILL!   ", ch, NULL, victim, TO_CHAR );
                      act( AT_RED, "Leaning back on one foot, $n holds a clawed hand aloft and begins to charge an immense power into it. Long before your have any hope of recovering, $s hand glows a bright crimson, and $e charges you at top speed crying $s victory call, 'WOLF FANG FIST!' &W[$t]    ", ch, num_punct(dam), victim, TO_VICT );
                      act( AT_RED, "THE HAND SHOOTS STRAIGHT THROUGH YOUR HEAD! INSTANT DEATH!              ", ch, NULL, victim, TO_VICT );
                      act( AT_RED, "Leaning back on one foot, $n holds a clawed hand aloft and begins to charge an immense power into it. Long before $s prey could hope of recovering, $s hand glows a bright crimson, and $e charges $M at top speed crying $s victory call, 'WOLF FANG FIST!' &W[$t] ", ch, num_punct(dam), victim, TO_NOTVICT );
                      act( AT_RED, "THE HAND SHOOTS STRAIGHT THROUGH THE OPPONENT'S HEAD! INSTANT KILL!  ", ch, NULL, victim, TO_NOTVICT );

	                learn_from_success( ch, gsn_wolffangfist );
                      ch->focus -= 15;
                      ch->mana -= 1600;
                      tehdamage = 999999999;
                    break;
                    } 
                  }
                default:
  	            dam = get_attmod(ch, victim) * number_range( 10, 15 );
                  act( AT_RED, "Leaning back on one foot, you hold a clawed hand aloft and begin to charge an immense power into it. Long before your prey could hope of recovering, your hand glows a bright crimson, and you charge $M at top speed crying your victory call, 'WOLF FANG FIST!' &W[$t]  ", ch, num_punct(dam), victim, TO_CHAR );
                  act( AT_RED, "Leaning back on one foot, $n holds a clawed hand aloft and begins to charge an immense power into it. Long before your have any hope of recovering, $s hand glows a bright crimson, and $e charges you at top speed crying $s victory call, 'WOLF FANG FIST!' &W[$t]    ", ch, num_punct(dam), victim, TO_VICT );
                  act( AT_RED, "Leaning back on one foot, $n holds a clawed hand aloft and begins to charge an immense power into it. Long before $s prey could hope of recovering, $s hand glows a bright crimson, and $e charges $M at top speed crying $s victory call, 'WOLF FANG FIST!' &W[$t] ", ch, num_punct(dam), victim, TO_NOTVICT );
    
	            learn_from_success( ch, gsn_wolffangfist );
                  ch->focus -= 15;
                  ch->mana -= 1600;
                  tehdamage += dam; 
                break;
              } 
            }
            else
            {
              act( AT_DGREEN, "You attempt a final Wolf Fang Fist, but are unable to execute it! &W[0]     ", ch, NULL, victim, TO_CHAR );               
	        act( AT_DGREEN, "$n attempts a final Wolf Fang Fist, but is unable to execute it! &W[0]      ", ch, NULL, victim, TO_VICT );
	        act( AT_DGREEN, "$n attempts a final Wolf Fang Fist, but is unable to execute it! &W[0]   ", ch, NULL, victim, TO_NOTVICT );
            }    
          }
      }
    }
    else
    {
	act( AT_DGREEN, "You failed to execute the Wolf Fang Fist.", ch, NULL, victim, TO_CHAR );
	act( AT_DGREEN, "$n failed to execute the Wolf Fang Fist.", ch, NULL, victim, TO_VICT );
	act( AT_DGREEN, "$n failed to execute the Wolf Fang Fist.", ch, NULL, victim, TO_NOTVICT );

      ch->mana -= skill_table[gsn_wolffangfist]->min_mana;
	learn_from_failure( ch, gsn_wolffangfist );
    }
      global_retcode = damage( ch, victim, tehdamage, TYPE_HIT );

    return;
}

void do_kakusanha(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

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

    if ((ch->race == 9)
    &&   (ch->exp < skill_table[gsn_genie_finisher]->skill_level[ch->class]) )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }
    else
    {
      if ( (!IS_NPC(ch))
      &&   (ch->exp < skill_table[gsn_kakusanha]->skill_level[ch->class]) )
      {
	  send_to_char( "You can't do that.\n\r", ch );
	  return;
      }
    }

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

	if ( ch->mana < skill_table[gsn_kakusanha]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_kakusanha]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_kakusanha]->focus;

    WAIT_STATE( ch, skill_table[gsn_kakusanha]->beats );
    if (ch->race != 9)
    {
      if ( can_use_skill(ch, number_percent(),gsn_kakusanha ) )
      {
	  dam = get_attmod(ch, victim) * number_range( 41, 51 );
	  if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	  act( AT_SKILL, "You bring your hands down to your hips, and begin to charge energy into both of your palms. 'Kakusan...." , ch, NULL, victim, TO_CHAR );
	  act( AT_SKILL, "..HAA!' You push both of your palms forward, releasing the beams simultaneously. The beams combine into a larger beam which heads directly for $N. At the last moment, the large slow moving beam splits into many smaller, more deadly bits. They all converge on $N, creating a grand explosion.  &W[$t] ", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_SKILL, "$n brings $s hands down to $s hips, and begins to charge energy into both of $s palms. 'Kakusan....", ch, NULL, victim, TO_VICT );
	  act( AT_SKILL, "..HAA!' $n pushes both of $s palms forward, releasing the beams simultaneously. The beams combine into a larger beam which heads directly for you! At the last moment, the large slow moving beam splits into many smaller, more deadly bits. They all converge on you, creating a grand explosion! &W[$t] ", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_SKILL, "$n brings $s hands down to $s hips, and begins to charge energy into both of $s palms. 'Kakusan....", ch, NULL, victim, TO_NOTVICT );
	  act( AT_SKILL, "..HAA!' $n pushes both of $s palms forward, releasing the beams simultaneously. The beams combine into a larger beam which heads directly for $N! At the last moment, the large slow moving beam splits into many smaller, more deadly bits. They all converge on $N, creating a grand explosion! &W[$t] ", ch, num_punct(dam), victim, TO_NOTVICT );

        dam = ki_absorb( victim, ch, dam, gsn_kakusanha );
	  learn_from_success( ch, gsn_kakusanha );
	  global_retcode = damage( ch, victim, dam, TYPE_HIT );
      }
      else
      {
	  act( AT_SKILL, "You missed $N with your kakusan-ha.", ch, NULL, victim, TO_CHAR );
	  act( AT_SKILL, "$n misses you with $s kakusan-ha.", ch, NULL, victim, TO_VICT );
	  act( AT_SKILL, "$n missed $N with a kakusan-ha.", ch, NULL, victim, TO_NOTVICT );
	  learn_from_failure( ch, gsn_kakusanha );
	  global_retcode = damage( ch, victim, 0, TYPE_HIT );
      }
    }
    else
    {
      if ( can_use_skill(ch, number_percent(),gsn_genie_finisher ) )
      {
	  dam = get_attmod(ch, victim) * number_range( 41, 51 );
	  if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	  act( AT_PINK, "You bring your hands down to your hips, and begin to charge energy into both of your palms. 'Kakusan...." , ch, NULL, victim, TO_CHAR );
	  act( AT_PINK, "..HAA!' You push both of your palms forward, releasing the beams simultaneously. The beams combine into a larger beam which heads directly for $N. At the last moment, the large slow moving beam splits into many smaller, more deadly bits. They all converge on $N, creating a grand explosion.  &W[$t] ", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_PINK, "$n brings $s hands down to $s hips, and begins to charge energy into both of $s palms. 'Kakusan....", ch, NULL, victim, TO_VICT );
	  act( AT_PINK, "..HAA!' $n pushes both of $s palms forward, releasing the beams simultaneously. The beams combine into a larger beam which heads directly for you! At the last moment, the large slow moving beam splits into many smaller, more deadly bits. They all converge on you, creating a grand explosion! &W[$t] ", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_PINK, "$n brings $s hands down to $s hips, and begins to charge energy into both of $s palms. 'Kakusan....", ch, NULL, victim, TO_NOTVICT );
	  act( AT_PINK, "..HAA!' $n pushes both of $s palms forward, releasing the beams simultaneously. The beams combine into a larger beam which heads directly for $N! At the last moment, the large slow moving beam splits into many smaller, more deadly bits. They all converge on $N, creating a grand explosion! &W[$t] ", ch, num_punct(dam), victim, TO_NOTVICT );

        dam = ki_absorb( victim, ch, dam, gsn_kakusanha );
	  learn_from_success( ch, gsn_genie_signature );
	  global_retcode = damage( ch, victim, dam, TYPE_HIT );
      }
      else
      {
	  act( AT_PURPLE, "You missed $N with your kakusan-ha.", ch, NULL, victim, TO_CHAR );
	  act( AT_PURPLE, "$n misses you with $s kakusan-ha.", ch, NULL, victim, TO_VICT );
	  act( AT_PURPLE, "$n missed $N with a kakusan-ha.", ch, NULL, victim, TO_NOTVICT );
	  learn_from_failure( ch, gsn_genie_finisher );
	  global_retcode = damage( ch, victim, 0, TYPE_HIT );
      }
    }

	ch->mana -= skill_table[gsn_kakusanha]->min_mana;
    return;
}

void do_galacticdonuts(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_galacticdonuts]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

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

    if (ch->race == 6)
    {
      if (ch->pcdata->absorb_pl_mod != 2)
      {
	  act( AT_YELLOW, "You try to form rings of energy, but nothing forms.  ", ch, NULL, victim, TO_CHAR );
	  act( AT_YELLOW, "You seem to be missing something... ", ch, NULL, victim, TO_CHAR );
	  act( AT_YELLOW, "$n tries to do... something. But $e fails, so it doesn't matter. ", ch, NULL, victim, TO_VICT );
	  act( AT_YELLOW, "$n tries to do... something. But $e fails, so it doesn't matter. ", ch, NULL, victim, TO_NOTVICT );

        return;
      }
    }

	if ( ch->mana < skill_table[gsn_galacticdonuts]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_galacticdonuts]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_galacticdonuts]->focus;

    WAIT_STATE( ch, skill_table[gsn_galacticdonuts]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_galacticdonuts ) )
    {
	dam = get_attmod(ch, victim) * number_range( 62, 66 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	act( AT_SKILL, "You create several rings of energy with your hands and guide them over to $N. The rings expand above $M, and before $E can move to get away, $E is trapped within the rings. The rings squeeze $N into a tight ball, and it hovers in front of you, enticing you." , ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "You fly in towards $N and start to beat $M around, hitting them in different directions, arriving before they can get there, just to swat them again. 'HAAA!!' You bring your hands above your head, and interlock the fingers, and spike the ball into the ground, where it promptly explodes.  &W[$t] ", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_SKILL, "$n creates several rings of energy with $s hands and guides them over to you. Before you can realize what is happening, the rings expand above you, and trap you inside their tight grip. It squeezes you into a tight ball, which is very uncomfortable.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n flies in towards you and starts to beat you around, hitting you in different directions. 'HAAA!!', You hear $n scream, as $e spikes your ball into the ground, where it promptly explodes. &W[$t] ", ch, num_punct(dam), victim, TO_VICT );
	act( AT_SKILL, "$n creates several rings of energy with $s hands and guides them over to $N. Before $N can realize what is happening, the rings expand above $M, and trap $M inside their tight grip. It squeezes $N into a tight ball, which looks very uncomfortable.", ch, NULL, victim, TO_NOTVICT );
	act( AT_SKILL, "$n flies in towards $N and starts to beat $M around, hitting $M in different directions. 'HAAA!!', You hear $n scream, as $e spikes the ball into the ground, where it promptly explodes. &W[$t] ", ch, num_punct(dam), victim, TO_NOTVICT );

	learn_from_success( ch, gsn_galacticdonuts );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You missed $N with your galactic donuts.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n misses you with $s galactic donuts.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n missed $N with a galactic donuts.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_galacticdonuts );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= skill_table[gsn_galacticdonuts]->min_mana;
    return;
}

void do_doc(CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    int dam = 0;

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

    if ( !IS_NPC(ch)
    &&   ch->exp < skill_table[gsn_doc]->skill_level[ch->class] )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }

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

    if (ch->race == 6)
    {
      if (ch->pcdata->absorb_pl_mod != 7)
      {
	  act( AT_WHITE, "You hold your hands aloft but nothing happens.  ", ch, NULL, victim, TO_CHAR );
	  act( AT_WHITE, "You seem to be missing something... ", ch, NULL, victim, TO_CHAR );
	  act( AT_WHITE, "$n holds $s hands aloft but nothing happens. Odd. ", ch, NULL, victim, TO_VICT );
	  act( AT_WHITE, "$n holds $s hands aloft but nothing happens. Odd. ", ch, NULL, victim, TO_NOTVICT );

        return;
      }
    }

	if ( ch->mana < skill_table[gsn_doc]->min_mana )
	{
	    send_to_char( "You don't have enough energy.\n\r", ch );
	    return;
	}
	if (ch->focus < skill_table[gsn_doc]->focus)
    {
		send_to_char( "You need to focus more.\n\r", ch );
		return;
    }
    else
    	ch->focus -= skill_table[gsn_doc]->focus;

    WAIT_STATE( ch, skill_table[gsn_doc]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_doc ) )
    {
	dam = get_attmod(ch, victim) * number_range( 61, 73 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	act( AT_SKILL, "You hold your hands aloft, charging energy between them. Sparks begin to appear in the gap between the hands, as more and more ki is focused at that point. The energy begins to crackle as it reaches the point where it can be charged no longer, and dark clouds form over the battlefield. 'Dawn..of.." , ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "..CREATION!' Lightning strikes the gap between your hands, and in one fluid motion, you bring your palms together and launch a massive beam at $N! &W[$t] ", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_SKILL, "$n holds $s hands aloft, charging energy between them. Sparks begin to appear in the gap between $n's hands, as more and more ki is focused at that point. The energy begins to crackle as it reaches the point where it can be charged no longer, and dark clouds form over the battlefield. 'Dawn..of..", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "..CREATION!'$n screams, as lightning strikes the gap between $s hands. In one fluid motion, $e brings $s palms together and launches a massive beam at you! &W[$t] ", ch, num_punct(dam), victim, TO_VICT );
	act( AT_SKILL, "$n holds $s hands aloft, charging energy between them. Sparks begin to appear in the gap between $n's hands, as more and more ki is focused at that point. The energy begins to crackle as it reaches the point where it can be charged no longer, and dark clouds form over the battlefield. 'Dawn..of..", ch, NULL, victim, TO_NOTVICT );
	act( AT_SKILL, "..CREATION!'$n screams, as lightning strikes the gap between $s hands. In one fluid motion, $e brings $s palms together and launches a massive beam at $N! &W[$t] ", ch, num_punct(dam), victim, TO_NOTVICT );

	learn_from_success( ch, gsn_doc );
	global_retcode = damage( ch, victim, dam, TYPE_HIT );
    }
    else
    {
	act( AT_SKILL, "You missed $N with your dawn of creation.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n misses you with $s dawn of creation.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n missed $N with a dawn of creation.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_doc );
	global_retcode = damage( ch, victim, 0, TYPE_HIT );
    }
	ch->mana -= skill_table[gsn_doc]->min_mana;
    return;
}
void do_super_ghost_kamikaze( CHAR_DATA *ch, char *arg )
{
    CHAR_DATA *victim;
    int ghosts = 0;
    int tehdamage = 0;
    int dam = 0;
    int tehenergy = 0;
    int tehfocus = 0;

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

    if ((ch->race == 9)
    &&   (ch->exp < skill_table[gsn_genie_finisher]->skill_level[ch->class]) )
    {
	send_to_char( "You can't do that.\n\r", ch );
	return;
    }
    else
    {
      if ( (!IS_NPC(ch))
      &&   (ch->exp < skill_table[gsn_super_ghost_kamikaze]->skill_level[ch->class]) )
      {
	  send_to_char( "You can't do that.\n\r", ch );
	  return;
      }
    }


    if( arg[0] == '\0' )
    {
	if ( ch->race != 9 )
	    send_to_char( "Syntax: super-ghost <# of ghosts, 1-5>\n\r", ch );
	else
	    send_to_char( "Syntax: absorbed <# of ghosts, 1-5>\n\r", ch );
	return;
    }

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

    ghosts = atoi( arg );
    if( ghosts > 5 )
	ghosts = 5;
    if( ghosts < 1 )
	ghosts = 1;
    tehenergy = ghosts * skill_table[gsn_super_ghost_kamikaze]->min_mana;
    tehfocus = ghosts * skill_table[gsn_super_ghost_kamikaze]->focus;

    if( ch->mana < tehenergy )
    {
	send_to_char( "You don't have enough energy.\n\r", ch );
	return;
    }
    if( ch->focus < tehfocus )
    {
	send_to_char( "You need to focus more.\n\r", ch );
	return;
    }
    else
	ch->focus -= tehfocus;
	ch->mana -= tehenergy;

    WAIT_STATE( ch, ( skill_table[gsn_super_ghost_kamikaze]->beats * ( 1 + ( ghosts / 10 ) ) ) );
    if (ch->race != 9)
    {
      if ( can_use_skill(ch, number_percent(),gsn_super_ghost_kamikaze ) )
      {
	  act( AT_LBLUE, "You arch your back and bellow, 'SUPER GHOST KAMIKAZE ATTACK!' before taking an amazingly deep breath...", ch, NULL, victim, TO_CHAR );
	  act( AT_LBLUE, "$n arches $s back and bellows, 'SUPER GHOST KAMIKAZE ATTACK!' before taking an amazingly deep breath...", ch, NULL, victim, TO_VICT );
	  act( AT_LBLUE, "$n arches $s back and bellows, 'SUPER GHOST KAMIKAZE ATTACK!' before taking an amazingly deep breath...", ch, NULL, victim, TO_NOTVICT );

	  switch (number_range( 1, 4))
	  {
	    default:
            dam = number_range( 2, 10 );
	      act( AT_LBLUE, "An alabaster white ghost, seemingly a clone of you in ghost form, rockets forth from your mouth and tackles $N in the gut! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	      act( AT_LBLUE, "An alabaster white ghost, seemingly a clone of $n in ghost form, rockets forth from $s mouth and tackles you in the gut! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	      act( AT_LBLUE, "An alabaster white ghost, seemingly a clone of $n in ghost form, rockets forth from $s mouth and tackles $N in the gut! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
            break;
	    case 1:
            dam = 0;
	      act( AT_BLUE, "An alabaster white ghost, seemingly a clone of you in ghost form, rockets forth from your mouth, but $N avoids it! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	      act( AT_BLUE, "An alabaster white ghost, seemingly a clone of $n in ghost form, rockets forth from $s mouth, but you avoid it &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	      act( AT_BLUE, "An alabaster white ghost, seemingly a clone of $n in ghost form, rockets forth from $s mouth, but $N avoids it &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
	      break;
	  }
        tehdamage += dam;

        if (ghosts >= 2)
        {
	    switch (number_range( 1, 4))
	    {
	      default:
              dam = number_range( 2, 10 );
	        act( AT_LBLUE, "A second ghost quickly follows, latching onto one of $N's legs! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	        act( AT_LBLUE, "A second ghost quickly follows, latching onto one of your legs! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	        act( AT_LBLUE, "A second ghost quickly follows, latching onto one of $N's legs! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
             break;
	      case 1:
              dam = 0;
	        act( AT_BLUE, "A second ghost quickly follows, which $N swiftly evades by lifting a leg! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	        act( AT_BLUE, "A second ghost quickly follows, which you swiftly evade by lifting a leg! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	        act( AT_BLUE, "A second ghost quickly follows, which $N swiftly evades by lifting a leg! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
	       break;
	    }
          tehdamage += dam;
        }

        if (ghosts >= 3)
        {
	    switch (number_range( 1, 4))
	    {
	      default:
              dam = number_range( 2, 10 );
	        act( AT_LBLUE, "You spit out a third ghost that fakes $N out and latches onto $S neck from behind! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	        act( AT_LBLUE, "$n spits out a third ghost that fakes you out and latches onto your neck from behind! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	        act( AT_LBLUE, "$n spits out a third ghost that fakes $N out and latches onto $S neck from behind! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
             break;
	      case 1:
              dam = 0;
	        act( AT_BLUE, "You spit out a third ghost, but $N is too smart for it and loses it during an attempted fake out! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	        act( AT_BLUE, "$n spits out a third ghost, but you are too smart for it and you lose it during an attempted fake out! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	        act( AT_BLUE, "$n spits out a third ghost, but $N is too smart for it and loses it during an attempted fake out! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
	       break;
	    }
          tehdamage += dam;
        }

        if (ghosts >= 4)
        {
	    switch (number_range( 1, 4))
	    {
	      default:
              dam = number_range( 2, 10 );
	        act( AT_LBLUE, "A fourth ghost soon follows, grabbing onto $N's arm with a strangle hold! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	        act( AT_LBLUE, "A fourth ghost soon follows, grabbing onto your arm with a strangle hold! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	        act( AT_LBLUE, "A fourth ghost soon follows, grabbing onto $N's arm with a strangle hold!  &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
             break;
	      case 1:
              dam = 0;
	        act( AT_BLUE, "A fourth ghost soon follows, easily dodged by $N's quick feint! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	        act( AT_BLUE, "A fourth ghost soon follows, easily dodged by your quick feint! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	        act( AT_BLUE, "A fourth ghost soon follows, easily dodged by $N's quick feint!  &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
	       break;
	    }
          tehdamage += dam;
        }

        if (ghosts >= 5)
        {
	    switch (number_range( 1, 4))
	    {
	      default:
              dam = number_range( 2, 10 );
	        act( AT_LBLUE, "A final, fifth ghost emerges from your mouth and crashes headfirst into $N's face! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	        act( AT_LBLUE, "A final, fifth ghost emerges from $n's mouth and crashes headfirst into your face! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	        act( AT_LBLUE, "A final, fifth ghost emerges from $n's mouth and crashes headfirst into $N's face!  &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
             break;
	      case 1:
              dam = 0;
	        act( AT_BLUE, "A final, fifth ghost, aiming for $N's face, is evaded with a swift 'Matrix style' back-bending! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	        act( AT_BLUE, "A final, fifth ghost, aiming for your face, is evaded with a swift 'Matrix style' back-bending! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	        act( AT_BLUE, "A final, fifth ghost, aiming for $N's face, is evaded with a swift 'Matrix style' back-bending!  &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	       break;
	    }
          tehdamage += dam;
        }

        if (tehdamage < 1)
        {
           dam = (number_range( 2, 5 ) * ghosts);
 	     act( AT_RED, "After dodging all of your ghosts, $N runs towards you at top speed as the ghosts sweep around for a second pass. They begin to glow a bright white as they close in on $M... but at the last second $E takes to the sky and leaves you with the resulting explosion! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	     act( AT_RED, "After dodging all of $n's ghosts, you run towards $m at top speed as the ghosts sweep around for a second pass. They begin to glow a bright white as they close in on you... but at the last second you take to the sky and leave $n with the resulting explosion! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	     act( AT_RED, "After dodging all of $n's ghosts, $N runs towards $m at top speed as the ghosts sweep around for a second pass. They begin to glow a bright white as they close in on $M... but at the last second $E takes to the sky and leaves $n with the resulting explosion! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

      	    learn_from_failure( ch, gsn_super_ghost_kamikaze );
	    global_retcode = damage( victim, ch, dam, TYPE_HIT );
        }
        else
        {
          dam = tehdamage * 2;
          if (ghosts == 1)
          {
  	      act( AT_RED, "The ghost glows a bright white before exploding, engulfing $N in a cloud of pure destruction! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	      act( AT_RED, "The ghost glows a bright white before exploding, engulfing you in a cloud of pure destruction! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	      act( AT_RED, "The ghost glows a bright white before exploding, engulfing $N in a cloud of pure destruction!  &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
          }
          else if (ghosts > 1)
          {
  	      act( AT_RED, "The ghosts glow a bright white before exploding, engulfing $N in a cloud of pure destruction! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	      act( AT_RED, "The ghosts glow a bright white before exploding, engulfing you in a cloud of pure destruction! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	      act( AT_RED, "The ghosts glow a bright white before exploding, engulfing $N in a cloud of pure destruction!  &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
          }
        }
	  learn_from_success( ch, gsn_super_ghost_kamikaze );
	  global_retcode = damage( ch, victim, (get_attmod(ch, victim) * dam), TYPE_HIT );
      }
      else
      {
        dam = (number_range( 1, 3 ) * ghosts);
	  act( AT_RED, "But you botch the attack! The highly volatile energy explodes inside you, oozing smoke out your ears and nose! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_RED, "But $e botches the attack! The highly volatile energy explodes inside $m, oozing smoke out $s ears and nose! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_RED, "But $e botches the attack! The highly volatile energy explodes inside $m, oozing smoke out $s ears and nose! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	  learn_from_failure( ch, gsn_super_ghost_kamikaze );
	  global_retcode = damage( ch, ch, dam, TYPE_HIT );
      }
    }

// This part is for the Absorbed Finisher attack for Genies.
// This comment is both an apology for the length and a checkpoint for me.
// Sincerely sorry about the size. -Kronotross

    else 
    {
      if ( can_use_skill(ch, number_percent(),gsn_genie_finisher ) )
      {
	  act( AT_PINK, "You arch your back and bellow, 'SUPER GHOST KAMIKAZE ATTACK!' before taking an amazingly deep breath...", ch, NULL, victim, TO_CHAR );
	  act( AT_PINK, "$n arches $s back and bellows, 'SUPER GHOST KAMIKAZE ATTACK!' before taking an amazingly deep breath...", ch, NULL, victim, TO_VICT );
	  act( AT_PINK, "$n arches $s back and bellows, 'SUPER GHOST KAMIKAZE ATTACK!' before taking an amazingly deep breath...", ch, NULL, victim, TO_NOTVICT );

	  switch (number_range( 1, 4))
	  {
	    default:
            dam = number_range( 2, 10 );
	      act( AT_PINK, "An alabaster white ghost, seemingly a clone of you in ghost form, rockets forth from your mouth and tackles $N in the gut! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	      act( AT_PINK, "An alabaster white ghost, seemingly a clone of $n in ghost form, rockets forth from $s mouth and tackles you in the gut! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	      act( AT_PINK, "An alabaster white ghost, seemingly a clone of $n in ghost form, rockets forth from $s mouth and tackles $N in the gut! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
            break;
	    case 1:
            dam = 0;
	      act( AT_PURPLE, "An alabaster white ghost, seemingly a clone of you in ghost form, rockets forth from your mouth, but $N avoids it! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	      act( AT_PURPLE, "An alabaster white ghost, seemingly a clone of $n in ghost form, rockets forth from $s mouth, but you avoid it &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	      act( AT_PURPLE, "An alabaster white ghost, seemingly a clone of $n in ghost form, rockets forth from $s mouth, but $N avoids it &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
	      break;
	  }
        tehdamage += dam;

        if (ghosts >= 2)
        {
	    switch (number_range( 1, 4))
	    {
	      default:
              dam = number_range( 2, 10 );
	        act( AT_PINK, "A second ghost quickly follows, latching onto one of $N's legs! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	        act( AT_PINK, "A second ghost quickly follows, latching onto one of your legs! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	        act( AT_PINK, "A second ghost quickly follows, latching onto one of $N's legs! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
             break;
	      case 1:
              dam = 0;
	        act( AT_PURPLE, "A second ghost quickly follows, which $N swiftly evades by lifting a leg! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	        act( AT_PURPLE, "A second ghost quickly follows, which you swiftly evade by lifting a leg! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	        act( AT_PURPLE, "A second ghost quickly follows, which $N swiftly evades by lifting a leg! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
	       break;
	    }
          tehdamage += dam;
        }

        if (ghosts >= 3)
        {
	    switch (number_range( 1, 4))
	    {
	      default:
              dam = number_range( 2, 10 );
	        act( AT_PINK, "You spit out a third ghost that fakes $N out and latches onto $S neck from behind! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	        act( AT_PINK, "$n spits out a third ghost that fakes you out and latches onto your neck from behind! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	        act( AT_PINK, "$n spits out a third ghost that fakes $N out and latches onto $S neck from behind! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
             break;
	      case 1:
              dam = 0;
	        act( AT_PURPLE, "You spit out a third ghost, but $N is too smart for it and loses it during an attempted fake out! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	        act( AT_PURPLE, "$n spits out a third ghost, but you are too smart for it and you lose it during an attempted fake out! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	        act( AT_PURPLE, "$n spits out a third ghost, but $N is too smart for it and loses it during an attempted fake out! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
	       break;
	    }
          tehdamage += dam;
        }

        if (ghosts >= 4)
        {
	    switch (number_range( 1, 4))
	    {
	      default:
              dam = number_range( 2, 10 );
	        act( AT_PINK, "A fourth ghost soon follows, grabbing onto $N's arm with a strangle hold! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	        act( AT_PINK, "A fourth ghost soon follows, grabbing onto your arm with a strangle hold! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	        act( AT_PINK, "A fourth ghost soon follows, grabbing onto $N's arm with a strangle hold!  &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
             break;
	      case 1:
              dam = 0;
	        act( AT_PURPLE, "A fourth ghost soon follows, easily dodged by $N's quick feint! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	        act( AT_PURPLE, "A fourth ghost soon follows, easily dodged by your quick feint! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	        act( AT_PURPLE, "A fourth ghost soon follows, easily dodged by $N's quick feint!  &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
	       break;
	    }
          tehdamage += dam;
        }

        if (ghosts >= 5)
        {
	    switch (number_range( 1, 4))
	    {
	      default:
              dam = number_range( 2, 10 );
	        act( AT_PINK, "A final, fifth ghost emerges from your mouth and crashes headfirst into $N's face! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	        act( AT_PINK, "A final, fifth ghost emerges from $n's mouth and crashes headfirst into your face! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	        act( AT_PINK, "A final, fifth ghost emerges from $n's mouth and crashes headfirst into $N's face!  &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
             break;
	      case 1:
              dam = 0;
	        act( AT_PURPLE, "A final, fifth ghost, aiming for $N's face, is evaded with a swift 'Matrix style' back-bending! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	        act( AT_PURPLE, "A final, fifth ghost, aiming for your face, is evaded with a swift 'Matrix style' back-bending! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	        act( AT_PURPLE, "A final, fifth ghost, aiming for $N's face, is evaded with a swift 'Matrix style' back-bending!  &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	       break;
	    }
          tehdamage += dam;
        }

        if (tehdamage < 1)
        {
           dam = (number_range( 2, 5 ) * ghosts);
 	     act( AT_RED, "After dodging all of your ghosts, $N runs towards you at top speed as the ghosts sweep around for a second pass. They begin to glow a bright white as they close in on $M... but at the last second $E takes to the sky and leaves you with the resulting explosion! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	     act( AT_RED, "After dodging all of $n's ghosts, you run towards $m at top speed as the ghosts sweep around for a second pass. They begin to glow a bright white as they close in on you... but at the last second you take to the sky and leave $n with the resulting explosion! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	     act( AT_RED, "After dodging all of $n's ghosts, $N runs towards $m at top speed as the ghosts sweep around for a second pass. They begin to glow a bright white as they close in on $M... but at the last second $E takes to the sky and leaves $n with the resulting explosion! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

      	    learn_from_failure( ch, gsn_genie_finisher );
	    global_retcode = damage( victim, ch, dam, TYPE_HIT );
        }
        else
        {
          dam = tehdamage * 2;
          if (ghosts == 1)
          {
  	      act( AT_RED, "The ghost glows a bright white before exploding, engulfing $N in a cloud of pure destruction! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	      act( AT_RED, "The ghost glows a bright white before exploding, engulfing you in a cloud of pure destruction! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	      act( AT_RED, "The ghost glows a bright white before exploding, engulfing $N in a cloud of pure destruction!  &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
          }
          else if (ghosts > 1)
          {
  	      act( AT_RED, "The ghosts glow a bright white before exploding, engulfing $N in a cloud of pure destruction! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	      act( AT_RED, "The ghosts glow a bright white before exploding, engulfing you in a cloud of pure destruction! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	      act( AT_RED, "The ghosts glow a bright white before exploding, engulfing $N in a cloud of pure destruction!  &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
          }
        }
	  learn_from_success( ch, gsn_genie_finisher );
	  global_retcode = damage( ch, victim, (get_attmod(ch, victim) * dam), TYPE_HIT );
      }
      else
      {
        dam = (number_range( 1, 3 ) * ghosts);
	  act( AT_RED, "But you botch the attack! The highly volatile energy explodes inside you, oozing smoke out your ears and nose! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	  act( AT_RED, "But $e botches the attack! The highly volatile energy explodes inside $m, oozing smoke out $s ears and nose! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	  act( AT_RED, "But $e botches the attack! The highly volatile energy explodes inside $m, oozing smoke out $s ears and nose! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	  learn_from_failure( ch, gsn_genie_finisher );
	  global_retcode = damage( ch, ch, dam, TYPE_HIT );
      }
    }
    return;
}

