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

extern void transStatApply args((CHAR_DATA *ch, int strMod, int spdMod, int intMod, int conMod));
extern void transStatRemove args((CHAR_DATA *ch));

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

	if (xIS_SET(ch->act, PLR_DRAGON1) 
       || xIS_SET(ch->act, PLR_DRAGON2) 
       || xIS_SET(ch->act, PLR_DRAGON3) 
       || xIS_SET(ch->act, PLR_DRAGON4) 
       || xIS_SET(ch->act, PLR_DRAGON5) 
       || xIS_SET(ch->act, PLR_DRAGON6) 
       || xIS_SET(ch->act, PLR_DRAGON7))
	{
		act( AT_DGREY, "Your black-star dragonballs eclipse your inner flames.", ch, NULL, NULL, TO_CHAR );
		return;
	}

	if (xIS_SET((ch)->affected_by, AFF_INNERFLAME))
      {
		act( AT_LBLUE, "You extinguish your inner flames.", ch, NULL, NULL, TO_CHAR );
		act( AT_LBLUE, "You extinguish your inner flames.", ch, NULL, NULL, TO_NOTVICT );
		xREMOVE_BIT((ch)->affected_by, AFF_INNERFLAME);
		ch->pl = ch->exp;
		transStatRemove(ch);
		return;
    	}

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

    WAIT_STATE( ch, skill_table[gsn_innerflame]->beats );
	if ( can_use_skill(ch, number_percent(), gsn_innerflame ) )
	{
         act( AT_WHITE, "You lift yourself above the earthly realm, igniting the sacred flames of your", ch, NULL, NULL, TO_CHAR );
        actl( AT_WHITE, "draconian soul and surrendering to them your body and mind.", ch, NULL, NULL, TO_CHAR );
         act( AT_WHITE, "$n lifts $mself above the earthly realm, igniting the sacred flames of $s", ch, NULL, NULL, TO_NOTVICT );
        actl( AT_WHITE, "draconian soul and surrendering to them $s body and mind.", ch, NULL, NULL, TO_NOTVICT );


	xSET_BIT( (ch)->affected_by, AFF_INNERFLAME );
	ch->pl = ch->exp * 5;
	transStatApply(ch, 10, 10, 10, 10);
	learn_from_success( ch, gsn_innerflame );
    }
	else
	{
	act( AT_DGREY, "You fail to ignite your inner flames.", ch, NULL, NULL, TO_CHAR );
	act( AT_DGREY, "$n fails to ignite $s inner flames.", ch, NULL, NULL, TO_NOTVICT );
	learn_from_failure( ch, gsn_innerflame );
    }

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

void do_activate( CHAR_DATA *ch, char *argument )
{
    char arg[MAX_INPUT_LENGTH];
    OBJ_DATA *obj;
    int TotalPLMod = 0;
    int TotalStrMod = 0;
    int TotalSpdMod = 0;
    int TotalIntMod = 0;
    int TotalConMod = 0;
    int percent = 0;
    bool DBallInv = FALSE;
    

    argument = one_argument( argument, arg );

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

//  Calculate current transformation settings so I don't have to make some retarded pcdata
//  variable or unreliable formula.

    if (xIS_SET(ch->affected_by, AFF_DRAGON1))
    {
      TotalPLMod += 8;
      TotalStrMod -= 10;
      TotalSpdMod -= 10;
      TotalIntMod -= 10;
      TotalConMod -= 10;
    }
    if (xIS_SET(ch->affected_by, AFF_DRAGON2))
    {
      TotalPLMod += 2;
      TotalSpdMod += 4;
      TotalIntMod += 6;
      TotalConMod += 1;
    }
    if (xIS_SET(ch->affected_by, AFF_DRAGON3))
    {
      TotalPLMod += 5;
      TotalStrMod += 6;
      TotalSpdMod += 2;
      TotalIntMod += 1;
      TotalConMod += 3;
    }
    if (xIS_SET(ch->affected_by, AFF_DRAGON4))
    {
      TotalPLMod += 6;
      TotalStrMod += 8;
      TotalSpdMod += 3;
      TotalConMod += 2;
    }
    if (xIS_SET(ch->affected_by, AFF_DRAGON5))
    {
      TotalPLMod += 5;
      TotalStrMod += 4;
      TotalSpdMod += 6;
      TotalIntMod += 5;
      TotalConMod += 4;
    }
    if (xIS_SET(ch->affected_by, AFF_DRAGON6))
    {
      TotalPLMod += 4;
      TotalStrMod += 1;
      TotalSpdMod += 8;
      TotalIntMod += 4;
      TotalConMod += 4;
    }
    if (xIS_SET(ch->affected_by, AFF_DRAGON7))
    {
      TotalPLMod += 2;
      TotalStrMod += 3;
      TotalSpdMod -= 4;
      TotalIntMod += 2;
      TotalConMod += 10;
    }


      /* Check to see if PLR_DRAGON# is turned on.
       * If so, check to see if AFF_DRAGON# is on.  
       * If it is, turn it off and powerdown and dballcount --
       * If it isn't, turn it on, powerup, and dballcount ++
       * If PLR_DRAGON# wasn't turned on, check for the # Star Dragonball.
       * If it is in the char's inventory, check for PL requirement, then destroy the dragonball and turn it on.
       * If it isn't, tell the player how retarded they are.
       */  

	if ( (arg[0] == '\0' || atoi(arg) <= 0 || atoi(arg) >= 8) && !(!str_cmp(arg, "all")))
    	{
		send_to_char( "Syntax: activate <1, 2, 3, 4, 5, 6, 7, or all>\n\r", ch );
		return;
    	}

    if ( !str_cmp(arg, "one") || !str_cmp(arg, "1") )
    {
      if (xIS_SET(ch->act, PLR_DRAGON1))
      {
        if (xIS_SET(ch->affected_by, AFF_DRAGON1))
        {
	    act( AT_LBLUE, "You slowly disconnect from the fury of Omega Shenron.", ch, NULL, NULL, TO_CHAR );
	    act( AT_LBLUE, "$n closes $s link to Omega Shenron's fury.", ch, NULL, NULL, TO_NOTVICT );

          xREMOVE_BIT(ch->affected_by, AFF_DRAGON1);
          TotalPLMod -= 8;
          TotalStrMod += 10;
          TotalSpdMod += 10;
          TotalIntMod += 10;
          TotalConMod += 10;
          ch->pcdata->dballcount --;
        }
        else
        {
          if (ch->mana < (7 * skill_table[gsn_activate]->min_mana))
          {
	      send_to_char( "You don't have enough energy.\n\r", ch );
	      return;
          }

          if (can_use_skill(ch, number_percent(), gsn_antimatter))
            percent = number_percent();
          else
            percent = number_percent() / 2;

          WAIT_STATE(ch, skill_table[gsn_activate]->beats);
          if (can_use_skill(ch, percent, gsn_activate))
          {
	      act( AT_DGREY, "You feel the powers of the One-Star Dragonball deep within you, begging to be unleashed. As you connect with the dragonball on a spiritual level, you feel a fierce rush of power seeping into your body: the fury of Omega Shenron.", ch, NULL, NULL, TO_CHAR );
	      act( AT_DGREY, "However his fury comes with a price. You can feel your reflexes getting sloppy, your mind clouding, and a berserker mindset discarding all semblance of defensive technique. As well, a smaller version of the One-Star Dragonball forms on your chest.", ch, NULL, NULL, TO_CHAR );
	      act( AT_DGREY, "$n's powerlevel suddenly surges, the fury of Omega Shenron bestowing upon $m ascension to an entirely new plateau of strength. As well, a small One-Star Dragonball has formed on $s chest.", ch, NULL, NULL, TO_NOTVICT );
	      learn_from_success(ch, gsn_activate);
            xSET_BIT(ch->affected_by, AFF_DRAGON1);
            TotalPLMod += 8;
            TotalStrMod -= 10;
            TotalSpdMod -= 10;
            TotalIntMod -= 10;
            TotalConMod -= 10;
            ch->pcdata->dballcount ++;
          }
          else
          {
	      act( AT_BLUE, "You attempt to unleash Omega Shenron's powers, but fail miserably. ", ch, NULL, NULL, TO_CHAR );
 	      act( AT_BLUE, "$n strains for a moment, searching inwardly for something, but eventually gives up.", ch, NULL, NULL, TO_NOTVICT );
	      learn_from_failure(ch, gsn_activate);
          }
          ch->mana -= (7 * skill_table[gsn_activate]->min_mana);
        }
        
      }
      else
      {
	  for ( obj = ch->first_carrying; obj; obj = obj->next_content )
        {
	    if (obj->pIndexData->vnum == OBJ_VNUM_1STAR)
          {
           	DBallInv = TRUE;
            break;
          }            
        }

        if (DBallInv == TRUE)
        {
          if (ch->exp < skill_table[gsn_antimatter]->skill_level[ch->class])
          {
            act( AT_BLUE, "You are too weak to handle Omega Shenron's power.", ch, NULL, NULL, TO_CHAR );
 	      act( AT_BLUE, "$n holds the first black-star dragonball aloft, but nothing happens.", ch, NULL, NULL, TO_NOTVICT );
            
          }
          else
          {
        
            act( AT_DGREY, "You hold the first black-star dragonball aloft as its surface glows with an eerie light. You can feel Omega Shenron's fury within you, clawing its way into your soul and unlocking hidden powers you could never have found alone.", ch, NULL, NULL, TO_CHAR );
            act( AT_RED, "Its job done, the dragonball suddenly leaps from your outstretched hand and rockets off into the sky, searching for its next student.", ch, NULL, NULL, TO_CHAR );
            act( AT_DGREY, "$n holds the first black-star dragonball aloft, the small orange orb coming suddenly aflame with a fierce light. Once the light has spread completely about $n bestowing upon him its untold powers, the dragonball rockets from $s open palm into the sky.", ch, NULL, NULL, TO_NOTVICT );

		    obj_from_char( obj );
   	          extract_obj( obj );
              xSET_BIT(ch->act, PLR_DRAGON1);
              ch->pcdata->learned[gsn_antimatter] = 10;
          }
          
        }
        else
        {
          act( AT_RED, "You don't have the One-Star Dragonball, retard.", ch, NULL, NULL, TO_CHAR );
 	    act( AT_RED, "$n tries to activate a dragonball $e doesn't even have.", ch, NULL, NULL, TO_NOTVICT );
                 
        }
      }
    }

    if ( !str_cmp(arg, "two") || !str_cmp(arg, "2") )
    {
      if (xIS_SET(ch->act, PLR_DRAGON2))
      {
        if (xIS_SET(ch->affected_by, AFF_DRAGON2))
        {
	    act( AT_LBLUE, "You slowly disconnect from your bond with Haze Shenron.", ch, NULL, NULL, TO_CHAR );
	    act( AT_LBLUE, "$n closes $s link to Haze Shenron.", ch, NULL, NULL, TO_NOTVICT );

          xREMOVE_BIT(ch->affected_by, AFF_DRAGON2);
          TotalPLMod -= 2;
          TotalSpdMod -= 4;
          TotalIntMod -= 6;
          TotalConMod -= 1;
          ch->pcdata->dballcount --;
        }
        else
        {
          if (ch->mana < (2 * skill_table[gsn_activate]->min_mana))
          {
	      send_to_char( "You don't have enough energy.\n\r", ch );
	      return;
          }

          if (can_use_skill(ch, number_percent(), gsn_toxichaze))
            percent = number_percent();
          else
            percent = number_percent() / 2;

          WAIT_STATE(ch, skill_table[gsn_activate]->beats);
          if (can_use_skill(ch, percent, gsn_activate))
          {
	      act( AT_DGREY, "You feel the powers of the Two-Star Dragonball deep within you, squirming in contemplation. As you forge a bond with the dragonball on a spiritual level, you feel the sheer strategic mastermind of Haze Shenron flow through you.", ch, NULL, NULL, TO_CHAR );
	      act( AT_DGREY, "A miniature version of the Two-Star Dragonball forms on your chest, announcing your transformation to the world.", ch, NULL, NULL, TO_CHAR );
	      act( AT_DGREY, "$n closes $s eyes for a moment and sighs, searching $mself for the power of Haze Shenron. A miniature Two-Star Dragonball upon $s chest shows that $e managed to succeed.", ch, NULL, NULL, TO_NOTVICT );
	      learn_from_success(ch, gsn_activate);
            xSET_BIT(ch->affected_by, AFF_DRAGON2);
            TotalPLMod += 2;
            TotalSpdMod += 4;
            TotalIntMod += 6;
            TotalConMod += 1;
            ch->pcdata->dballcount ++;
          }
          else
          {
	      act( AT_BLUE, "You attempt to bond with Haze Shenron, but fail miserably. ", ch, NULL, NULL, TO_CHAR );
 	      act( AT_BLUE, "$n strains for a moment, searching inwardly for something, but eventually gives up.", ch, NULL, NULL, TO_NOTVICT );
	      learn_from_failure(ch, gsn_activate);
          }
          ch->mana -= (2 * skill_table[gsn_activate]->min_mana);
        }
      }
      else
      {
	  for ( obj = ch->first_carrying; obj; obj = obj->next_content )
        {
	    if (obj->pIndexData->vnum == OBJ_VNUM_2STAR)
          {
           	DBallInv = TRUE;
            break;
          }  
        }

        if (DBallInv)
        {
          if (ch->exp < skill_table[gsn_toxichaze]->skill_level[ch->class])
          {
            act( AT_BLUE, "You are too weak to fully comprehend Haze Shenron's strategy.", ch, NULL, NULL, TO_CHAR );
 	      act( AT_BLUE, "$n holds the second black-star dragonball aloft, but nothing happens.", ch, NULL, NULL, TO_NOTVICT );
          }
          else
          {
            act( AT_DGREY, "You hold the second black-star dragonball aloft as its surface glows with an eerie light. You can feel the strategic genius of Haze Shenron within you, clawing its way into your soul and unlocking hidden knowledge you could never have found alone.", ch, NULL, NULL, TO_CHAR );
            act( AT_RED, "Its job done, the dragonball suddenly leaps from your outstretched hand and rockets off into the sky, searching for its next student.", ch, NULL, NULL, TO_CHAR );
            act( AT_DGREY, "$n holds the second black-star dragonball aloft, the small orange orb coming suddenly aflame with a fierce light. Once the light has spread completely about $n bestowing upon him its untold powers, the dragonball rockets from $s open palm into the sky.", ch, NULL, NULL, TO_NOTVICT );

		    obj_from_char( obj );
    	          extract_obj( obj );
              xSET_BIT(ch->act, PLR_DRAGON2);
              ch->pcdata->learned[gsn_toxichaze] = 10;
          }
        }
        else
        {
          act( AT_RED, "You don't have the Two-Star Dragonball, retard.", ch, NULL, NULL, TO_CHAR );
 	    act( AT_RED, "$n tries to activate a dragonball $e doesn't even have.", ch, NULL, NULL, TO_NOTVICT );
                 
        }
      }
    }

    if ( !str_cmp(arg, "three") || !str_cmp(arg, "3") )
    {
      if (xIS_SET(ch->act, PLR_DRAGON3))
      {
        if (xIS_SET(ch->affected_by, AFF_DRAGON3))
        {
	    act( AT_LBLUE, "You slowly disconnect from your frigid bond with Eis Shenron.", ch, NULL, NULL, TO_CHAR );
	    act( AT_LBLUE, "$n closes $s frigid link to Eis Shenron.", ch, NULL, NULL, TO_NOTVICT );

          xREMOVE_BIT(ch->affected_by, AFF_DRAGON3);
          TotalPLMod -= 5;
          TotalStrMod -= 6;
          TotalSpdMod -= 2;
          TotalIntMod -= 1;
          TotalConMod -= 3;
          ch->pcdata->dballcount --;
        }
        else
        {
          if (ch->mana < (3 * skill_table[gsn_activate]->min_mana))
          {
	      send_to_char( "You don't have enough energy.\n\r", ch );
	      return;
          }

          if (can_use_skill(ch, number_percent(), gsn_subzero))
            percent = number_percent();
          else
            percent = number_percent() / 2;

          WAIT_STATE(ch, skill_table[gsn_activate]->beats);
          if (can_use_skill(ch, percent, gsn_activate))
          {
	      act( AT_DGREY, "You feel the powers of the Three-Star Dragonball deep within you, yearning to engulf the world in an icy tomb. As you forge a bond with the dragonball on a spiritual level, the subzero powers of Eis Shenron are bestowed upon you.", ch, NULL, NULL, TO_CHAR );
	      act( AT_DGREY, "A small version of the Three-Star Dragonball forms on your chest, announcing your transformation to the world.", ch, NULL, NULL, TO_CHAR );
	      act( AT_DGREY, "$n closes $s eyes for a moment and sighs, searching $mself for the frigid energies of Eis Shenron. The small Three-Star Dragonball formed upon $s chest shows that $e managed to succeed.", ch, NULL, NULL, TO_NOTVICT );
	      learn_from_success(ch, gsn_activate);
            xSET_BIT(ch->affected_by, AFF_DRAGON3);
            TotalPLMod += 5;
            TotalStrMod += 6;
            TotalSpdMod += 2;
            TotalIntMod += 1;
            TotalConMod += 3;
            ch->pcdata->dballcount ++;
          }
          else
          {
	      act( AT_BLUE, "You attempt to bond with Eis Shenron, but fail miserably. ", ch, NULL, NULL, TO_CHAR );
 	      act( AT_BLUE, "$n strains for a moment, searching inwardly for something, but eventually gives up.", ch, NULL, NULL, TO_NOTVICT );
	      learn_from_failure(ch, gsn_activate);
          }
          ch->mana -= (3 * skill_table[gsn_activate]->min_mana);
        }
      }
      else
      {
	  for ( obj = ch->first_carrying; obj; obj = obj->next_content )
        {
	    if (obj->pIndexData->vnum == OBJ_VNUM_3STAR)
          {
           	DBallInv = TRUE;
            break;
          }  
        }

        if (DBallInv)
        {
          if (ch->exp < skill_table[gsn_subzero]->skill_level[ch->class])
          {
            act( AT_BLUE, "You are too weak to embrace Eis Shenron's energies.", ch, NULL, NULL, TO_CHAR );
 	      act( AT_BLUE, "$n holds the third black-star dragonball aloft, but nothing happens.", ch, NULL, NULL, TO_NOTVICT );
          }
          else
          {
            act( AT_DGREY, "You hold the third black-star dragonball aloft as its surface glows with an eerie light. The subzero energies of Eis Shenron spread from the dragonball into your body, and into your very soul.", ch, NULL, NULL, TO_CHAR );
            act( AT_RED, "Its job done, the dragonball suddenly leaps from your outstretched hand and rockets off into the sky, searching for its next student.", ch, NULL, NULL, TO_CHAR );
            act( AT_DGREY, "$n holds the third black-star dragonball aloft, the small orange orb coming suddenly aflame with a fierce light. Once the light has spread completely about $n bestowing upon him its untold powers, the dragonball rockets from $s open palm into the sky.", ch, NULL, NULL, TO_NOTVICT );

		    obj_from_char( obj );
    	          extract_obj( obj );
            xSET_BIT(ch->act, PLR_DRAGON3);
              ch->pcdata->learned[gsn_subzero] = 10;
          }
        }
        else
        {
          act( AT_RED, "You don't have the Three-Star Dragonball, retard.", ch, NULL, NULL, TO_CHAR );
 	    act( AT_RED, "$n tries to activate a dragonball $e doesn't even have.", ch, NULL, NULL, TO_NOTVICT );
                
        }
      }
    }
    if ( !str_cmp(arg, "four") || !str_cmp(arg, "4") )
    {
      if (xIS_SET(ch->act, PLR_DRAGON4))
      {
        if (xIS_SET(ch->affected_by, AFF_DRAGON4))
        {
	    act( AT_LBLUE, "You slowly disconnect from your volatile connection with Nuova Shenron.", ch, NULL, NULL, TO_CHAR );
	    act( AT_LBLUE, "$n closes $s volatile link to Nova Shenron.", ch, NULL, NULL, TO_NOTVICT );

          xREMOVE_BIT(ch->affected_by, AFF_DRAGON4);
          TotalPLMod -= 6;
          TotalStrMod -= 8;
          TotalSpdMod -= 3;
          TotalConMod -= 2;
          ch->pcdata->dballcount --;
        }
        else
        {
          if (ch->mana < (6 * skill_table[gsn_activate]->min_mana))
          {
	      send_to_char( "You don't have enough energy.\n\r", ch );
	      return;
          }

          if (can_use_skill(ch, number_percent(), gsn_flare))
            percent = number_percent();
          else
            percent = number_percent() / 2;

          WAIT_STATE(ch, skill_table[gsn_activate]->beats);
          if (can_use_skill(ch, percent, gsn_activate))
          {
	      act( AT_DGREY, "You feel the powers of the Four-Star Dragonball deep within you, honorable and fierce. As you forge a bond with the dragonball on a spiritual level, Nova Shenron's fiery resolve and honorable soul merges with you.", ch, NULL, NULL, TO_CHAR );
	      act( AT_DGREY, "A miniature version of the Four-Star Dragonball forms on your chest, announcing your transformation to the world.", ch, NULL, NULL, TO_CHAR );
	      act( AT_DGREY, "$n closes $s eyes for a moment and sighs, searching $mself for Nova Shenron's warrior's honor. The miniature Four-Star Dragonball formed upon $s chest shows that $e managed to succeed.", ch, NULL, NULL, TO_NOTVICT );
	      learn_from_success(ch, gsn_activate);
            xSET_BIT(ch->affected_by, AFF_DRAGON4);
            TotalPLMod += 6;
            TotalStrMod += 8;
            TotalSpdMod += 3;
            TotalConMod += 2;
            ch->pcdata->dballcount ++;
          }
          else
          {
	      act( AT_BLUE, "You attempt to bond with Nova Shenron, but fail miserably. ", ch, NULL, NULL, TO_CHAR );
 	      act( AT_BLUE, "$n strains for a moment, searching inwardly for something, but eventually gives up.", ch, NULL, NULL, TO_NOTVICT );
	      learn_from_failure(ch, gsn_activate);
          }
          ch->mana -= (6 * skill_table[gsn_activate]->min_mana);
        }
      }
      else
      {
	  for ( obj = ch->first_carrying; obj; obj = obj->next_content )
        {
	    if (obj->pIndexData->vnum == OBJ_VNUM_4STAR)
          {
           	DBallInv = TRUE;
            break;
          }  
        }

        if (DBallInv)
        {
          if (ch->exp < skill_table[gsn_flare]->skill_level[ch->class])
          {
            act( AT_BLUE, "You are too weak to withstand Nova Shenron's volatile energies.", ch, NULL, NULL, TO_CHAR );
 	      act( AT_BLUE, "$n holds the fourth black-star dragonball aloft, but nothing happens.", ch, NULL, NULL, TO_NOTVICT );
          }
          else
          {
            act( AT_DGREY, "You hold the fourth black-star dragonball aloft as its surface glows with an eerie light. The volatile energies of Nova Shenron spread from the dragonball into your body, and into your very soul.", ch, NULL, NULL, TO_CHAR );
            act( AT_RED, "Its job done, the dragonball suddenly leaps from your outstretched hand and rockets off into the sky, searching for its next student.", ch, NULL, NULL, TO_CHAR );
            act( AT_DGREY, "$n holds the fourth black-star dragonball aloft, the small orange orb coming suddenly aflame with a fierce light. Once the light has spread completely about $n bestowing upon him its untold powers, the dragonball rockets from $s open palm into the sky.", ch, NULL, NULL, TO_NOTVICT );

		    obj_from_char( obj );
    	    extract_obj( obj );
            xSET_BIT(ch->act, PLR_DRAGON4);
              ch->pcdata->learned[gsn_flare] = 10;
          }
        }
        else
        {
          act( AT_RED, "You don't have the Four-Star Dragonball, retard.", ch, NULL, NULL, TO_CHAR );
 	    act( AT_RED, "$n tries to activate a dragonball $e doesn't even have.", ch, NULL, NULL, TO_NOTVICT );
                
        }
      }
    }
    if ( !str_cmp(arg, "five") || !str_cmp(arg, "5") )
    {
      if (xIS_SET(ch->act, PLR_DRAGON5))
      {
        if (xIS_SET(ch->affected_by, AFF_DRAGON5))
        {
	    act( AT_LBLUE, "You slowly disconnect from your bond with Rage Shenron.", ch, NULL, NULL, TO_CHAR );
	    act( AT_LBLUE, "$n closes $s link to Rage Shenron.", ch, NULL, NULL, TO_NOTVICT );

          xREMOVE_BIT(ch->affected_by, AFF_DRAGON5);
          TotalPLMod -= 5;
          TotalStrMod -= 4;
          TotalSpdMod -= 6;
          TotalIntMod -= 5;
          TotalConMod -= 4;
          ch->pcdata->dballcount --;
        }
        else
        {
          if (ch->mana < skill_table[gsn_activate]->min_mana)
          {
	      send_to_char( "You don't have enough energy.\n\r", ch );
	      return;
          }

          if (can_use_skill(ch, number_percent(), gsn_voltaicsap))
            percent = number_percent();
          else
            percent = number_percent() / 2;

          WAIT_STATE(ch, skill_table[gsn_activate]->beats);
          if (can_use_skill(ch, percent, gsn_activate))
          {
	      act( AT_DGREY, "You feel the powers of the Five-Star Dragonball deep within you, sending currents of electrical energy through your body. As you forge a bond with the dragonball on a spiritual level, rivulets of lightning sprout forth from your chest, giving you the power of Rage Shenron.", ch, NULL, NULL, TO_CHAR );
	      act( AT_DGREY, "A small version of the Five-Star Dragonball forms on your chest where the electricity spouts from, announcing your transformation to the world.", ch, NULL, NULL, TO_CHAR );
	      act( AT_DGREY, "$n closes $s eyes for a moment and sighs, searching $mself for the power of Rage Shenron. The small Five-Star Dragonball formed upon $s chest along with $s being suddenly engulfed in rivulets of lightning announce $s success.", ch, NULL, NULL, TO_NOTVICT );
	      learn_from_success(ch, gsn_activate);
            xSET_BIT(ch->affected_by, AFF_DRAGON5);
            TotalPLMod += 5;
            TotalStrMod += 4;
            TotalSpdMod += 6;
            TotalIntMod += 5;
            TotalConMod += 4;
            ch->pcdata->dballcount ++;
          }
          else
          {
	      act( AT_BLUE, "You attempt to bond with Rage Shenron, but fail miserably. ", ch, NULL, NULL, TO_CHAR );
 	      act( AT_BLUE, "$n strains for a moment, searching inwardly for something, but eventually gives up.", ch, NULL, NULL, TO_NOTVICT );
	      learn_from_failure(ch, gsn_activate);
          }
          ch->mana -= skill_table[gsn_activate]->min_mana;
        }
      }
      else
      {
	  for ( obj = ch->first_carrying; obj; obj = obj->next_content )
        {
	    if (obj->pIndexData->vnum == OBJ_VNUM_5STAR)
          {
           	DBallInv = TRUE;
            break;
          }  
        }

        if (DBallInv)
        {
          if (ch->exp < skill_table[gsn_voltaicsap]->skill_level[ch->class])
          {
            act( AT_BLUE, "You are too weak to embrace Rage Shenron's energies.", ch, NULL, NULL, TO_CHAR );
 	      act( AT_BLUE, "$n holds the fifth black-star dragonball aloft, but nothing happens.", ch, NULL, NULL, TO_NOTVICT );
          }
          else
          {
            act( AT_DGREY, "You hold the fifth black-star dragonball aloft as its surface glows with an eerie light. The voltaic power of Rage Shenron spreads forth from the dragonball into your body, charging your very soul with electricity.", ch, NULL, NULL, TO_CHAR );
            act( AT_RED, "Its job done, the dragonball suddenly leaps from your outstretched hand and rockets off into the sky, searching for its next student.", ch, NULL, NULL, TO_CHAR );
            act( AT_DGREY, "$n holds the fifth black-star dragonball aloft, the small orange orb coming suddenly aflame with a fierce light. Once the light has spread completely about $n bestowing upon him its untold powers, the dragonball rockets from $s open palm into the sky.", ch, NULL, NULL, TO_NOTVICT );

		    obj_from_char( obj );
    	    extract_obj( obj );
            xSET_BIT(ch->act, PLR_DRAGON5);
              ch->pcdata->learned[gsn_voltaicsap] = 10;
          }
        }
        else
        {
          act( AT_RED, "You don't have the Five-Star Dragonball, retard.", ch, NULL, NULL, TO_CHAR );
 	    act( AT_RED, "$n tries to activate a dragonball $e doesn't even have.", ch, NULL, NULL, TO_NOTVICT );
                  
        }
      } 
    }
    if ( !str_cmp(arg, "six") || !str_cmp(arg, "6") )
    {
      if (xIS_SET(ch->act, PLR_DRAGON6))
      {
        if (xIS_SET(ch->affected_by, AFF_DRAGON6))
        {
	    act( AT_LBLUE, "You slowly disconnect from your bond with Oceanus Shenron.", ch, NULL, NULL, TO_CHAR );
	    act( AT_LBLUE, "$n closes $s link to Oceanus Shenron.", ch, NULL, NULL, TO_NOTVICT );

          xREMOVE_BIT(ch->affected_by, AFF_DRAGON6);
          TotalPLMod -= 4;
          TotalStrMod -= 1;
          TotalSpdMod -= 8;
          TotalIntMod -= 4;
          TotalConMod -= 4;
          ch->pcdata->dballcount --;
        }
        else
        {
          if (ch->mana < (5 * skill_table[gsn_activate]->min_mana))
          {
	      send_to_char( "You don't have enough energy.\n\r", ch );
	      return;
          }

          if (can_use_skill(ch, number_percent(), gsn_hurricaneshield))
            percent = number_percent();
          else
            percent = number_percent() / 2;

          WAIT_STATE(ch, skill_table[gsn_activate]->beats);
          if (can_use_skill(ch, percent, gsn_activate))
          {
	      act( AT_DGREY, "You feel the powers of the Six-Star Dragonball deep within you, Oceanus Shenron's evasive genius growing ever stronger. As you forge a powerful bond with the dragonball on a spiritual level, such evasive genius is added upon your own.", ch, NULL, NULL, TO_CHAR );
	      act( AT_DGREY, "A tiny version of the Six-Star Dragonball forms on your chest, announcing your transformation to the world.", ch, NULL, NULL, TO_CHAR );
	      act( AT_DGREY, "$n closes $s eyes for a moment and sighs, searching $mself for the evasive genius of Oceanus Shenron. The small Seven-Star Dragonball formed upon $s chest announces $s success.", ch, NULL, NULL, TO_NOTVICT );
	      learn_from_success(ch, gsn_activate);
            xSET_BIT(ch->affected_by, AFF_DRAGON6);
            TotalPLMod += 4;
            TotalStrMod += 1;
            TotalSpdMod += 8;
            TotalIntMod += 4;
            TotalConMod += 4;
            ch->pcdata->dballcount ++;
          }
          else
          {
	      act( AT_BLUE, "You attempt to bond with the dodge fu of Oceanus Shenron, but fail miserably. ", ch, NULL, NULL, TO_CHAR );
 	      act( AT_BLUE, "$n strains for a moment, searching inwardly for something, but eventually gives up.", ch, NULL, NULL, TO_NOTVICT );
	      learn_from_failure(ch, gsn_activate);
          }
          ch->mana -= (5 * skill_table[gsn_activate]->min_mana);
        }
      }
      else
      {
	  for ( obj = ch->first_carrying; obj; obj = obj->next_content )
        {
	    if (obj->pIndexData->vnum == OBJ_VNUM_6STAR)
          {
           	DBallInv = TRUE;
            break;
          }  
        }

        if (DBallInv)
        {
          if (ch->exp < skill_table[gsn_hurricaneshield]->skill_level[ch->class])
          {
            act( AT_BLUE, "You are too weak to make use of Oceanus Shenron's evasive prowess.", ch, NULL, NULL, TO_CHAR );
 	      act( AT_BLUE, "$n holds the sixth black-star dragonball aloft, but nothing happens.", ch, NULL, NULL, TO_NOTVICT );
          }
          else
          {
            act( AT_DGREY, "You hold the sixth black-star dragonball aloft as its surface glows with an eerie light. All that Oceanus Shenron once knew flows into and through your soul, bringing with it her defensive genius.", ch, NULL, NULL, TO_CHAR );
            act( AT_RED, "Its job done, the dragonball suddenly leaps from your outstretched hand and rockets off into the sky, searching for its next student.", ch, NULL, NULL, TO_CHAR );
            act( AT_DGREY, "$n holds the sixth black-star dragonball aloft, the small orange orb coming suddenly aflame with a fierce light. Once the light has spread completely about $n bestowing upon him its untold powers, the dragonball rockets from $s open palm into the sky.", ch, NULL, NULL, TO_NOTVICT );

		    obj_from_char( obj );
    	    extract_obj( obj );
            xSET_BIT(ch->act, PLR_DRAGON6);
              ch->pcdata->learned[gsn_hurricaneshield] = 10;
          }
        }
        else
        {
          act( AT_RED, "You don't have the Six-Star Dragonball, retard.", ch, NULL, NULL, TO_CHAR );
 	    act( AT_RED, "$n tries to activate a dragonball $e doesn't even have.", ch, NULL, NULL, TO_NOTVICT );
                 
        }
      }
    }
    if ( !str_cmp(arg, "seven") || !str_cmp(arg, "7") )
    {
      if (xIS_SET(ch->act, PLR_DRAGON7))
      {
        if (xIS_SET(ch->affected_by, AFF_DRAGON7))
        {
	    act( AT_LBLUE, "You slowly disconnect from your fierce bond with Naturon Shenron.", ch, NULL, NULL, TO_CHAR );
	    act( AT_LBLUE, "$n closes $s powerful link to Naturon Shenron.", ch, NULL, NULL, TO_NOTVICT );

          xREMOVE_BIT(ch->affected_by, AFF_DRAGON7);
          TotalPLMod -= 2;
          TotalStrMod -= 3;
          TotalSpdMod += 4;
          TotalIntMod -= 2;
          TotalConMod -= 10;
          ch->pcdata->dballcount --;
        }
        else
        {
          if (ch->mana < (4 * skill_table[gsn_activate]->min_mana))
          {
	      send_to_char( "You don't have enough energy.\n\r", ch );
	      return;
          }

          if (can_use_skill(ch, number_percent(), gsn_tremors))
            percent = number_percent();
          else
            percent = number_percent() / 2;

          WAIT_STATE(ch, skill_table[gsn_activate]->beats);
          if (can_use_skill(ch, percent, gsn_activate))
          {
	      act( AT_DGREY, "You feel the powers of the Seven-Star Dragonball deep within you, a foreign desire to topple entire cities in massive earthquakes growing by the second. As you forge a powerful bond with the dragonball on a spiritual level, the terran powers of Naturon Shenron become your own.", ch, NULL, NULL, TO_CHAR );
	      act( AT_DGREY, "A tiny version of the Seven-Star Dragonball forms on your chest, announcing your transformation to the world.", ch, NULL, NULL, TO_CHAR );
	      act( AT_DGREY, "$n closes $s eyes for a moment and sighs, searching $mself for the earthly powers of Naturon Shenron. The small Six-Star Dragonball formed upon $s chest announces $s success.", ch, NULL, NULL, TO_NOTVICT );
	      learn_from_success(ch, gsn_activate);
            xSET_BIT(ch->affected_by, AFF_DRAGON7);
            TotalPLMod += 2;
            TotalStrMod += 3;
            TotalSpdMod -= 4;
            TotalIntMod += 2;
            TotalConMod += 10;
            ch->pcdata->dballcount ++;
          }
          else
          {
	      act( AT_BLUE, "You attempt to bond with the terran Naturon Shenron, but fail miserably. ", ch, NULL, NULL, TO_CHAR );
 	      act( AT_BLUE, "$n strains for a moment, searching inwardly for something, but eventually gives up.", ch, NULL, NULL, TO_NOTVICT );
	      learn_from_failure(ch, gsn_activate);
          }
          ch->mana -= (4 * skill_table[gsn_activate]->min_mana);
        }
      }
      else
      {
	  for ( obj = ch->first_carrying; obj; obj = obj->next_content )
        {
	    if (obj->pIndexData->vnum == OBJ_VNUM_7STAR)
          {
           	DBallInv = TRUE;
            break;
          }  
        }

        if (DBallInv)
        {
          if (ch->exp < skill_table[gsn_tremors]->skill_level[ch->class])
          {
            act( AT_BLUE, "You are too weak to hold Naturon Shenron's earthly energies.", ch, NULL, NULL, TO_CHAR );
 	      act( AT_BLUE, "$n holds the seventh black-star dragonball aloft, but nothing happens.", ch, NULL, NULL, TO_NOTVICT );
          }
          else
          {
            act( AT_DGREY, "You hold the seventh black-star dragonball aloft as its surface glows with an eerie light. Naturon Shenron's terran energies fill your soul, bringing with them an alien desire for quake carnage.", ch, NULL, NULL, TO_CHAR );
            act( AT_RED, "Its job done, the dragonball suddenly leaps from your outstretched hand and rockets off into the sky, searching for its next student.", ch, NULL, NULL, TO_CHAR );
            act( AT_DGREY, "$n holds the seventh black-star dragonball aloft, the small orange orb coming suddenly aflame with a fierce light. Once the light has spread completely about $n bestowing upon him its untold powers, the dragonball rockets from $s open palm into the sky.", ch, NULL, NULL, TO_NOTVICT );

		    obj_from_char( obj );
    	    extract_obj( obj );
            xSET_BIT(ch->act, PLR_DRAGON7);
              ch->pcdata->learned[gsn_tremors] = 10;
          }
        }
        else
        {
          act( AT_RED, "You don't have the Seven-Star Dragonball, retard.", ch, NULL, NULL, TO_CHAR );
 	    act( AT_RED, "$n tries to activate a dragonball $e doesn't even have.", ch, NULL, NULL, TO_NOTVICT );
                  
        }
      }
    }
    if ( !str_cmp(arg, "all") )
    {
      if (xIS_SET(ch->act, PLR_DRAGON1) && xIS_SET(ch->act, PLR_DRAGON2) && xIS_SET(ch->act, PLR_DRAGON3) 
      && xIS_SET(ch->act, PLR_DRAGON4) && xIS_SET(ch->act, PLR_DRAGON5) && xIS_SET(ch->act, PLR_DRAGON6) 
      && xIS_SET(ch->act, PLR_DRAGON7))
      {
        if (xIS_SET(ch->affected_by, AFF_DRAGON1) && xIS_SET(ch->affected_by, AFF_DRAGON2) && xIS_SET(ch->affected_by, AFF_DRAGON3) 
        && xIS_SET(ch->affected_by, AFF_DRAGON4) && xIS_SET(ch->affected_by, AFF_DRAGON5) && xIS_SET(ch->affected_by, AFF_DRAGON6) 
        && xIS_SET(ch->affected_by, AFF_DRAGON7))
        {
	    act( AT_LBLUE, "You suddenly disconnect from all of your dragonballs at once.", ch, NULL, NULL, TO_CHAR );
	    act( AT_LBLUE, "$n closes $s his link to his seven dragonballs.", ch, NULL, NULL, TO_NOTVICT );

          xREMOVE_BIT(ch->affected_by, AFF_DRAGON1);
          xREMOVE_BIT(ch->affected_by, AFF_DRAGON2);
          xREMOVE_BIT(ch->affected_by, AFF_DRAGON3);
          xREMOVE_BIT(ch->affected_by, AFF_DRAGON4);
          xREMOVE_BIT(ch->affected_by, AFF_DRAGON5);
          xREMOVE_BIT(ch->affected_by, AFF_DRAGON6);
          xREMOVE_BIT(ch->affected_by, AFF_DRAGON7);
          TotalPLMod = 1;
          TotalStrMod = 0;
          TotalSpdMod = 0;
          TotalIntMod = 0;
          TotalConMod = 0;
          ch->pcdata->dballcount = 0;
        }
        else
        {
          if (ch->mana < (28 * skill_table[gsn_activate]->min_mana))
          {
	      send_to_char( "You don't have enough energy.\n\r", ch );
	      return;
          }

          if (can_use_skill(ch, number_percent(), gsn_antimatter))
            percent = number_percent();
          else
            percent = number_percent() / 2;

          WAIT_STATE(ch, skill_table[gsn_activate]->beats);
          if (can_use_skill(ch, percent, gsn_activate))
          {
	      act( AT_DGREY, "You feel the powers of the seven Shadow Dragon Lords deep within you, and release them in unison. The powers of Fire, Wind, Ice, Electricity, Earth, Poison, and Shadow fill you with a godly energy never before known to this realm.", ch, NULL, NULL, TO_CHAR );
	      act( AT_DGREY, "Small versions of the seven dragonballs form on your chest, announcing your transformation to the world.", ch, NULL, NULL, TO_CHAR );
	      act( AT_DGREY, "$n closes $s eyes for a moment and braces for impact, calling forth all seven Shadow Dragons. The seven miniature dragonballs formed upon $s chest announce $s success.", ch, NULL, NULL, TO_NOTVICT );
	      learn_from_success(ch, gsn_activate);
            xSET_BIT(ch->affected_by, AFF_DRAGON1);
            xSET_BIT(ch->affected_by, AFF_DRAGON2);
            xSET_BIT(ch->affected_by, AFF_DRAGON3);
            xSET_BIT(ch->affected_by, AFF_DRAGON4);
            xSET_BIT(ch->affected_by, AFF_DRAGON5);
            xSET_BIT(ch->affected_by, AFF_DRAGON6);
            xSET_BIT(ch->affected_by, AFF_DRAGON7);
            TotalPLMod = 32;
            TotalStrMod = 12;
            TotalSpdMod = 9;
            TotalIntMod = 8;
            TotalConMod = 14;
            ch->pcdata->dballcount = 7;
          }
          else
          {
	      act( AT_BLUE, "You attempt to bond with all seven Shadow Dragons at once, but it is too much for you. ", ch, NULL, NULL, TO_CHAR );
 	      act( AT_BLUE, "$n strains for a moment, searching inwardly for something, but eventually gives up.", ch, NULL, NULL, TO_NOTVICT );
	      learn_from_failure(ch, gsn_activate);
          }
          ch->mana -= (28 * skill_table[gsn_activate]->min_mana);
        }
      }
      else
      {
        act( AT_RED, "You must acquire all seven Black Star Dragonballs first.", ch, NULL, NULL, TO_CHAR );
        act( AT_RED, "$n tries to activate dragonballs $e doesn't even have.", ch, NULL, NULL, TO_NOTVICT );
      }
    }

    if (TotalPLMod < 1)
      ch->pl = ch->exp;
    else
      ch->pl = ch->exp * TotalPLMod;
    transStatApply(ch, TotalStrMod, TotalSpdMod, TotalIntMod, TotalConMod);
    return;
}

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

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

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

    WAIT_STATE( ch, skill_table[gsn_whirlwindspin]->beats );
    if (ch->race != 9)
    {
     if ( can_use_skill(ch, number_percent(),gsn_whirlwindspin) )
     {
	dam = get_attmod(ch, victim) * number_range( 14, 26 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	act( AT_LBLUE, "You focus an indeterminate amount of energy into the air about you, forming wispy ribbons of pale energy whose leading ends converge at the center of your palm. The energy gathers in a matter of seconds, and as you quickly release the attack at $N it takes a strange, semi-solid form.&W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_LBLUE, "$n focuses an indeterminate amount of energy into the air about $mself, forming wispy ribbons of pale energy whose leading ends converge at the center of $s palm. The energy gathers in a matter of seconds, and as $e quickly releases the attack at you it takes a strange, semi-solid form.&W[$t]", ch, num_punct(dam), victim, TO_VICT );
	act( AT_LBLUE, "$n focuses an indeterminate amount of energy into the air about $mself, forming wispy ribbons of pale energy whose leading ends converge at the center of $s palm. The energy gathers in a matter of seconds, and as $e quickly releases the attack at $N it takes a strange, semi-solid form.&W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

        learn_from_success( ch, gsn_whirlwindspin );
        dam = ki_absorb( victim, ch, dam, gsn_whirlwindspin );
        dam = portal_counter(ch, victim, dam, gsn_whirlwindspin );
        
        if (dam > 0)
          global_retcode = damage( ch, victim, dam, gsn_whirlwindspin );
     }
     else
     {
	act( AT_SKILL, "You hold your palm out in front of you, but no energy gathers.", ch, NULL, victim, TO_CHAR );
	act( AT_SKILL, "$n holds $s palm out in front of $mself, but no energy gathers.", ch, NULL, victim, TO_VICT );
	act( AT_SKILL, "$n holds $s palm out in front of $mself, but no energy gathers.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_whirlwindspin );
	global_retcode = damage( ch, victim, 0, gsn_whirlwindspin );
     }
    }
    else
    {
      if ( can_use_skill(ch, number_percent(),gsn_demonwave ) )
      {
	dam = get_attmod(ch, victim) * number_range( 14, 26 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	act( AT_PINK, "You focus an indeterminate amount of energy into the air about you, forming wispy ribbons of pale energy whose leading ends converge at the center of your palm. The energy gathers in a matter of seconds, and as you quickly release the attack at $N it takes a strange, semi-solid form.&W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_PINK, "$n focuses an indeterminate amount of energy into the air about $mself, forming wispy ribbons of pale energy whose leading ends converge at the center of $s palm. The energy gathers in a matter of seconds, and as $e quickly releases the attack at you it takes a strange, semi-solid form.&W[$t]", ch, num_punct(dam), victim, TO_VICT );
	act( AT_PINK, "$n focuses an indeterminate amount of energy into the air about $mself, forming wispy ribbons of pale energy whose leading ends converge at the center of $s palm. The energy gathers in a matter of seconds, and as $e quickly releases the attack at $N it takes a strange, semi-solid form.&W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

        learn_from_success( ch, gsn_demonwave );
        dam = ki_absorb( victim, ch, dam, gsn_whirlwindspin );
        dam = portal_counter(ch, victim, dam, gsn_whirlwindspin );
        
        if (dam > 0)
          global_retcode = damage( ch, victim, dam, gsn_whirlwindspin );

      }
      else
      {
	act( AT_PURPLE, "You hold your palm out in front of you, but no energy gathers.", ch, NULL, victim, TO_CHAR );
	act( AT_PURPLE, "$n holds $s palm out in front of $mself, but no energy gathers.", ch, NULL, victim, TO_VICT );
	act( AT_PURPLE, "$n holds $s palm out in front of $mself, but no energy gathers.", ch, NULL, victim, TO_NOTVICT );
	  learn_from_failure( ch, gsn_demonwave );
	  global_retcode = damage( ch, victim, 0, gsn_whirlwindspin );
      }
   }

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

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

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

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

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

    WAIT_STATE( ch, skill_table[gsn_voltaicsap]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_voltaicsap ) )
    {
	dam = get_attmod(ch, victim) * number_range( 4, 10 );
	act( AT_PINK, "You expel a mass of pinkish-purple slime, its voltaic surface crackling with chemical-induced electricity! As it splashes across $N's body, you feel a sudden surge of power, content in the knowledge that their energy levels are quickly dropping. &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_PINK, "$n expels a mass of pinkish-purple slime, its voltaic surface crackling with chemical-induced electricity! As it splashes across your body, $n's powerlevel suddenly surges higher, your quickly draining energy levels being transformed into pure power. &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	act( AT_PINK, "$n expels a mass of pinkish-purple slime, its voltaic surface crackling with chemical-induced electricity! As it splashes across $N's body, $n's powerlevel suddenly surges higher, $N's quickly draining energy levels being transformed into pure power. &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	learn_from_success( ch, gsn_voltaicsap );
	xSET_BIT(ch->act, PLR_2XPL_GAIN);
	global_retcode = damage( ch, victim, dam, gsn_voltaicsap );
      xREMOVE_BIT(ch->act, PLR_2XPL_GAIN);  

    }

	else
    {
	act( AT_PURPLE, "Your voltaic sap misses $N by a mile!", ch, NULL, victim, TO_CHAR );
	act( AT_PURPLE, "$n's voltaic sap misses you by a mile!", ch, NULL, victim, TO_VICT );
	act( AT_PURPLE, "$n's voltaic sap misses $N by a mile!", ch, NULL, victim, TO_NOTVICT );

	learn_from_failure( ch, gsn_voltaicsap );
	global_retcode = damage( ch, victim, 0, gsn_voltaicsap );
      xREMOVE_BIT(ch->act, PLR_2XPL_GAIN);
    }
	
	if (dam > 0)
	{
	  dam = victim->mana * 0.07;
	  if (dam > 0)
	  {
	    if (victim->mana < dam)
	    {
		dam = victim->mana;
		victim->mana = 0;
	    }
	    else
	    victim->mana -= dam;
	  }
	}

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

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

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

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

    WAIT_STATE( ch, skill_table[gsn_toxichaze]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_toxichaze) )
    {

	    dam = get_attmod(ch, victim) * number_range( 25, 35 );
	    if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	    act( AT_DGREY, "Breathing in deeply, your body converts much of the air you inhale into a gaseous toxin built to weaken and, in some cases, kill. As $N approaches, you quickly exhale the poisonous fumes into a massive haze-like cloud that surrounds $M and chokes the very life from $M. The sickening sound of corroding flesh fills the air... &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	    act( AT_DGREY, "$n breathes in deeply, synthesizing gaseous toxins designed specifically to weaken and kill. As you approach, $e exhales the poison into a massive, pitch-black cloud, threatening to choke the very life out of you! The sickening sound of corroding flesh fills the air... &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	    act( AT_DGREY, "$n breathes in deeply, synthesizing gaseous toxins designed specifically to weaken and kill. As $N approaches, $n exhales the poison into a massive, pitch-black cloud, threatening to choke the very life out of $N! The sickening sound of corroding flesh fills the air... &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

      switch (number_range(1,50))
      {
        default:
         break;
        case 50:
          if (!xIS_SET(ch->act, PLR_SPAR) )
          {
            if (victim->pl / ch->pl >= 3)
            {
	        act( AT_WHITE, "$n is far too strong to be weakened by your cloud's toxins.", ch, num_punct(dam), victim, TO_CHAR );
	        act( AT_WHITE, "YOU ARE TOO STRONG TO FALL VICTIM TO THE CLOUD'S WEAKENING TOXINS!", ch, num_punct(dam), victim, TO_VICT );
	        act( AT_WHITE, "$n is far too strong to be weakened by $N's cloud's toxins", ch, num_punct(dam), victim, TO_NOTVICT );
            }
            else
            {
              if (victim->pl > victim->exp)
              {
                if (victim->race != 4)
                {
	            act( AT_BLUE, "$n wilts as $s powers fade from $m...", ch, num_punct(dam), victim, TO_CHAR );
	            act( AT_BLUE, "YOU FEEL YOUR POWERS FADING AS THE TOXIC CLOUD WEAKENS YOU!", ch, num_punct(dam), victim, TO_VICT );
	            act( AT_BLUE, "$n wilts as $s powers fade from $m...", ch, num_punct(dam), victim, TO_NOTVICT );
                  do_powerdown(victim, NULL);
                }
                else
                {
 	            act( AT_RED, "$n's metal body is quickly dissolving, $s transformation chip deactivating...", ch, num_punct(dam), victim, TO_CHAR );
	            act( AT_RED, "THE TOXINS CORRODE YOUR METAL BODY AND BRIEFLY CORRUPT YOUR CHIP!", ch, num_punct(dam), victim, TO_VICT );
	            act( AT_RED, "$n's metal body is quickly dissolving, $s transformation chip deactivating", ch, num_punct(dam), victim, TO_NOTVICT );
                  dam *= (victim->pl / victim->exp);
                }
              }
            }         
          }
         break;
      }

	    learn_from_success( ch, gsn_toxichaze);
	    global_retcode = damage( ch, victim, dam, gsn_toxichaze);
    }
    else
    {
	act( AT_GREY, "You exhale a massive cloud of toxins, but $N swiftly avoids it.", ch, NULL, victim, TO_CHAR );
	act( AT_GREY, "$n exhales a massive cloud of toxins, but you swiftly avoid it.", ch, NULL, victim, TO_VICT );
	act( AT_GREY, "$n exhales a massive cloud of toxins, but $N swiftly avoids it.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_toxichaze );
	global_retcode = damage( ch, victim, 0, gsn_toxichaze);
    }
	ch->mana -= skill_table[gsn_toxichaze]->min_mana;
    return;
}

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

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

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

    WAIT_STATE( ch, skill_table[gsn_subzero]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_subzero) )
    {
	dam = get_attmod(ch, victim) * number_range( 23, 39 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	act( AT_LBLUE, "The air about you abruptly chills, its temperature dropping into sub-zero levels. You hold both of your arms aloft, frigid energies easing into existance about them, lengthy ribbons of ice forming from the freezing water in the air. Blue flashes through your eyes, and you release this glacier of ice energy in the form of a massive freeze wave! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_LBLUE, "The air about $n abruptly chills, its temperature dropping into sub-zero levels. $n holds both of $s arms aloft, frigid energies easing into existance about them, lengthy ribbons of ice forming from the freezing water in the air. Blue flashes through $s eyes, and $e releases this glacier of ice energy at you in the form of a massive freeze wave! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
	act( AT_LBLUE, "The air about $n abruptly chills, its temperature dropping into sub-zero levels. $n holds both of $s arms aloft, frigid energies easing into existance about them, lengthy ribbons of ice forming from the freezing water in the air. Blue flashes through $s eyes, and $e releases this glacier of ice energy in the form of a massive freeze wave! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

      if (xIS_SET(victim->affected_by, AFF_FLYING))
      {
        dam += get_attmod(ch, victim) * 10;
        act( AT_BLUE, "As the mass of frozen air engulfs $N, $S powers of flight are muffled and silenced beneath the developing ice's unyielding surface. $N plummets to the ground below half-frozen, $S body wracked with pain as the ice about $M shatters upon impact! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
        act( AT_BLUE, "As the mass of frozen air engulfs you, your powers of flight are muffled and silenced beneath the developing ice's unyielding surface. You plummets to the ground below half-frozen, your body wracked with pain as the ice about you shatters upon impact! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
        act( AT_BLUE, "As the mass of frozen air engulfs $N, $S powers of flight are muffled and silenced beneath the developing ice's unyielding surface. $N plummets to the ground below half-frozen, $S body wracked with pain as the ice about $M shatters upon impact! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
      }

        learn_from_success( ch, gsn_subzero);
        dam = ki_absorb( victim, ch, dam, gsn_subzero );
        dam = portal_counter(ch, victim, dam, gsn_subzero );
        
        if (dam > 0)
          global_retcode = damage( ch, victim, dam, gsn_subzero );
     
    }
    else
    {
	act( AT_BLUE, "You hold both of your arms aloft and attempt to gather your arctic energies, but you fumble them.", ch, NULL, victim, TO_CHAR );
	act( AT_BLUE, "$n holds both of $s arms aloft and attempts to gather some arctic energies, but $e fumbles them.", ch, NULL, victim, TO_VICT );
	act( AT_BLUE, "$n holds both of $s arms aloft and attempts to gather some arctic energies, but $e fumbles them.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_subzero );
	global_retcode = damage( ch, victim, 0, gsn_subzero );
    }
	ch->mana -= skill_table[gsn_subzero]->min_mana;
    return;
}

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

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

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

    WAIT_STATE( ch, skill_table[gsn_tremors]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_tremors) )
    {
	dam = get_attmod(ch, victim) * number_range( 25, 40 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
	act( AT_ORANGE, "Diving to the ground, you break through the surface of the floor and prepare for a complicated technique. Using a potent combination of physical strength and ki energy, you cause massive tremors and quakes throughout the battlefield.", ch, num_punct(dam), victim, TO_CHAR );
	act( AT_ORANGE, "Diving to the ground, $n breaks through the surface of the floor and prepares for a complicated technique. Using a potent combination of physical strength and ki energy, $e causes massive tremors and quakes throughout the battlefield.", ch, num_punct(dam), victim, TO_VICT );
	act( AT_ORANGE, "Diving to the ground, $n breaks through the surface of the floor and prepares for a complicated technique. Using a potent combination of physical strength and ki energy, $e causes massive tremors and quakes throughout the battlefield.", ch, num_punct(dam), victim, TO_NOTVICT );
	learn_from_success( ch, gsn_tremors);

      if (xIS_SET(victim->affected_by, AFF_FLYING))
      {
        act( AT_YELLOW, "Although relatively unaffected by the tremors, the violent quaking of the surroundings quickly throws $N into a state of vertigo, leaving $S defenses wide open. You rocket up from below ground, driving your fist into $S gut and delivering a sharp axe kick that sends $M crashing to the ground! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
        act( AT_YELLOW, "Although relatively unaffected by the tremors, the violent quaking of the surroundings quickly throws you into a state of vertigo, leaving your defenses wide open. $n rockets up from below ground, driving $s fist into your gut and delivering a sharp axe kick that sends you crashing to the ground! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
        act( AT_YELLOW, "Although relatively unaffected by the tremors, the violent quaking of the surroundings quickly throws $N into a state of vertigo, leaving $S defenses open. $n rockets up from below ground, driving $s fist into $N's gut and delivering a sharp axe kick that sends $M crashing to the ground! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
      }
      else
      {
        dam += get_attmod(ch, victim) * 10;
        act( AT_RED, "The tremors throw $N to the ground and its violent quaking tosses $M about like a rag doll! After a particularly nasty crash against the ground, $E is tossed helplessly into the air as you burst forth from below ground and deliver the killing blow! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
        act( AT_RED, "The tremors throw you to the ground and its violent quaking tosses you about like a rag doll! After a particularly nasty crash against the floor, you are tossed helplessly into the air as $n bursts forth from below ground and delivers the killing blow! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
        act( AT_RED, "The tremors throw $N to the ground as the violent quakes toss $M about like a ragdoll! After a particularly nasty crash against the ground, $E is tossed helplessly into the air as $n bursts forth from below ground and delivers the killing blow! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
      }

	global_retcode = damage( ch, victim, dam, gsn_tremors );
     
    }
    else
    {
	act( AT_BLUE, "You dive towards the ground, but fail to hit it at the right angle and bounce off like an idiot.", ch, NULL, victim, TO_CHAR );
	act( AT_BLUE, "$n dives towards the ground, but fails to hit it at the right angle and bounces off like an idiot.", ch, NULL, victim, TO_VICT );
	act( AT_BLUE, "$n dives towards the ground, but fails to hit it at the right angle and bounces off like an idiot.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_tremors );
	global_retcode = damage( ch, victim, 0, gsn_tremors);
    }
	ch->mana -= skill_table[gsn_tremors]->min_mana;
    return;
}

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

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

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

    WAIT_STATE( ch, skill_table[gsn_dragonthunder]->beats );
    if ( can_use_skill(ch, number_percent(),gsn_dragonthunder) )
    {
	dam = get_attmod(ch, victim) * number_range( 35, 45 );
      act( AT_RED, "Crimson bolts of energy burst forth from your aura as you arch your back and deliver a spine-tingling roar! The battlefield darkens for a split second, emphasizing the furious bolt of scarlet lightning that strikes $N with devilish accuracy and a deafening thunder! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
      act( AT_RED, "Crimson bolts of energy burst forth from $n's aura as $e arches $s back and delivers a spine-tingling roar! The battlefield darkens for a split second, emphasizing the furious bolt of scarlet lightning that strikes you with devilish accuracy and a deafening thunder! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
      act( AT_RED, "Crimson bolts of energy burst forth from $n's aura as $e arches $s back and delivers a spine-tingling roar! The battlefield darkens for a split second, emphasizing the furious bolt of scarlet lightning that strikes $N with devilish accuracy and a deafening thunder! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
 
       learn_from_success( ch, gsn_dragonthunder);
        dam = ki_absorb( victim, ch, dam, gsn_dragonthunder );
        dam = portal_counter(ch, victim, dam, gsn_dragonthunder );
        
        if (dam > 0)
          global_retcode = damage( ch, victim, dam, gsn_dragonthunder );
     
    }
    else
    {
	act( AT_BLUE, "You attempt to shoot off some Dragon Thunder, but $N leaves you no time!", ch, NULL, victim, TO_CHAR );
	act( AT_BLUE, "$n attempts to shoot off some Dragon Thunder, but you leave $m no time!", ch, NULL, victim, TO_VICT );
	act( AT_BLUE, "$n attempt to shoot off some Dragon Thunder, but $N leaves $m no time!", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_dragonthunder );
	global_retcode = damage( ch, victim, 0, gsn_dragonthunder );
    }
	ch->mana -= skill_table[gsn_dragonthunder]->min_mana;
    return;
}

void do_hurricaneshield(CHAR_DATA *ch, char *argument )
{
	AFFECT_DATA af;

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

	if (xIS_SET(ch->affected_by, AFF_HURRICANESHIELD))
	{
            act( AT_SKILL, "The hurricane winds die down about you.", ch, NULL, NULL, TO_CHAR );
            act( AT_SKILL, "$n releases his control on his hurricane shield.", ch, NULL, NULL, TO_NOTVICT );
            xREMOVE_BIT( ch->affected_by, AFF_HURRICANESHIELD );
            affect_strip( ch, gsn_hurricaneshield );
	    return;
	}

    if ( can_use_skill(ch, number_percent(), gsn_hurricaneshield ) )
    {
	act( AT_GREEN, "You focus your ki in the air around you, willing it into a constant ebb and flow about your body. As you churn the winds forth, they stablize into a sort of hurricane shield, degrading the force of anything that intends you harm.", ch, NULL, NULL, TO_CHAR );
	act( AT_GREEN, "$n focuses inwardly, drawing forth some sort of power over the winds around $m. Soon, $e is encompassed in a rudimentary shield of hurricane winds.", ch, NULL, NULL, TO_NOTVICT );

	af.type      = gsn_hurricaneshield;
	af.duration  = (4) * DUR_CONV;
	af.location  = APPLY_NONE;
	af.bitvector = meb(AFF_HURRICANESHIELD);
	af.modifier  = 0;
	affect_to_char( ch, &af );
    }
    else
    {
	act( AT_DGREEN, "You attempt to gather winds about you, but your focus slips.", ch, NULL, NULL, TO_CHAR );
	act( AT_DGREEN, "$n closes $s eyes and focuses on... something. But nothing happens.", ch, NULL, NULL, TO_NOTVICT );
	learn_from_failure( ch, gsn_hurricaneshield );
    }
	ch->mana -= skill_table[gsn_hurricaneshield]->min_mana;
	return;
}

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

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

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

    WAIT_STATE( ch, skill_table[gsn_flare]->beats );
    if (ch->race != 9)
    {
     if ( can_use_skill(ch, number_percent(),gsn_flare) )
     {
	dam = get_attmod(ch, victim) * number_range( 58, 64 );
	if (ch->charge > 0)
		dam = chargeDamMult(ch, dam);
      act( AT_RED, "Raging hell flames burst into existence across your body, angry tendrils of flame licking the air, craving destruction. You spread your arms out, palms open, and feed the cursed flames with your ki, willing them bigger, hotter, brighter... and without hesitation you throw yourself forward, pitching a fireball twice your size to a collision course with $N, to explode in a massive flare! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
      act( AT_RED, "Raging hell flames burst into existence across $n's body, angry tendrils of flame licking the air, craving destruction. $n spreads $s arms out, palms open, and feeds the cursed flames with $s own ki, willing them bigger, hotter, brighter... and without hesitation $e throws $mself forward, pitching a fireball twice $s size to a collision course with you, to explode in a massive flare! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
      act( AT_RED, "Raging hell flames burst into existence across $n's body, angry tendrils of flame licking the air, craving destruction. $n spreads $s arms out, palms open, and feeds the cursed flames with $s own ki, willing them bigger, hotter, brighter... and without hesitation $e throws $mself forward, pitching a fireball twice $s size to a collision course with $N, to explode in a massive flare! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
 
       learn_from_success( ch, gsn_flare);
        dam = ki_absorb( victim, ch, dam, gsn_flare );
        dam = portal_counter(ch, victim, dam, gsn_flare );
        
        if (dam > 0)
          global_retcode = damage( ch, victim, dam, gsn_flare );
     
     }
     else
     {
	act( AT_BLUE, "You try to ignite yourself with dragon flames, but the best you get is a bit of smoke...", ch, NULL, victim, TO_CHAR );
	act( AT_BLUE, "$n attempts some sort of fire technique, but only succeeds in making a bit of smoke.", ch, NULL, victim, TO_VICT );
	act( AT_BLUE, "$n attempts some sort of fire technique, but only succeeds in making a bit of smoke.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_flare );
	global_retcode = damage( ch, victim, 0, gsn_flare );
     }
    }
    else
    {
      if ( can_use_skill(ch, number_percent(),gsn_genocide ) )
      {
	dam = get_attmod(ch, victim) * number_range( 58, 64 );
      act( AT_PINK, "Raging hell flames burst into existence across your body, angry tendrils of flame licking the air, craving destruction. You spread your arms out, palms open, and feed the cursed flames with your ki, willing them bigger, hotter, brighter... and without hesitation you throw yourself forward, pitching a fireball twice your size to a collision course with $N, to explode in a massive flare! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );
      act( AT_PINK, "Raging hell flames burst into existence across $n's body, angry tendrils of flame licking the air, craving destruction. $n spreads $s arms out, palms open, and feeds the cursed flames with $s own ki, willing them bigger, hotter, brighter... and without hesitation $e throws $mself forward, pitching a fireball twice $s size to a collision course with you, to explode in a massive flare! &W[$t]", ch, num_punct(dam), victim, TO_VICT );
      act( AT_PINK, "Raging hell flames burst into existence across $n's body, angry tendrils of flame licking the air, craving destruction. $n spreads $s arms out, palms open, and feeds the cursed flames with $s own ki, willing them bigger, hotter, brighter... and without hesitation $e throws $mself forward, pitching a fireball twice $s size to a collision course with $N, to explode in a massive flare! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );
 
       learn_from_success( ch, gsn_genocide);
        dam = ki_absorb( victim, ch, dam, gsn_flare );
        dam = portal_counter(ch, victim, dam, gsn_flare );
        
        if (dam > 0)
          global_retcode = damage( ch, victim, dam, gsn_flare );

      }
      else
      {
	act( AT_PURPLE, "You try to ignite yourself with dragon flames, but the best you get is a bit of smoke...", ch, NULL, victim, TO_CHAR );
	act( AT_PURPLE, "$n attempts some sort of fire technique, but only succeeds in making a bit of smoke.", ch, NULL, victim, TO_VICT );
	act( AT_PURPLE, "$n attempts some sort of fire technique, but only succeeds in making a bit of smoke.", ch, NULL, victim, TO_NOTVICT );
	  learn_from_failure( ch, gsn_genocide );
	  global_retcode = damage( ch, victim, 0, gsn_flare );
      }
   }


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

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

    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 != 10)
      {
	  act( AT_DGREY, "You raise one arm to the sky... anticlimatically.  ", ch, NULL, victim, TO_CHAR );
	  act( AT_DGREY, "You seem to be missing something... ", ch, NULL, victim, TO_CHAR );
	  act( AT_DGREY, "$n raises one arm to the sky... anticlimatically. ", ch, NULL, victim, TO_VICT );
	  act( AT_DGREY, "$n raises one arm to the sky... anticlimatically.  ", ch, NULL, victim, TO_NOTVICT );

        return;
      }
    }

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

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

           act( AT_DGREY,"Soaring high above the battlefield, you extend one arm to the sky and begin", ch, num_punct(dam), victim, TO_CHAR );
           actl( AT_DGREY,"collecting a mass of pitch black energy, the depth of its ebony sucking the", ch, num_punct(dam), victim, TO_CHAR );
           actl( AT_DGREY,"very light from the sky. It grows quickly, feeding on your constant flow of", ch, num_punct(dam), victim, TO_CHAR );
           actl( AT_DGREY,"dark energy and thirsting... begging to be released. As the massive ball of", ch, num_punct(dam), victim, TO_CHAR );
           actl( AT_DGREY,"energy quickly reaches its terminal capacity, you unleash the full force of", ch, num_punct(dam), victim, TO_CHAR );
           actl( AT_DGREY,"the deadly anti-matter energy upon $N! &W[$t]", ch, num_punct(dam), victim, TO_CHAR );

           act( AT_DGREY,"Soaring high above the battlefield, $n extends one arm to the sky and begins", ch, num_punct(dam), victim, TO_VICT );
           actl( AT_DGREY,"collecting a mass of pitch black energy, the depth of its ebony sucking the", ch, num_punct(dam), victim, TO_VICT );
           actl( AT_DGREY,"very light from the sky. It grows quickly, feeding on $n's constant flow of", ch, num_punct(dam), victim, TO_VICT );
           actl( AT_DGREY,"dark energy and thirsting... begging to be released. As the massive ball of", ch, num_punct(dam), victim, TO_VICT );
           actl( AT_DGREY,"energy quickly reaches its terminal capacity, $n unleashes the full force", ch, num_punct(dam), victim, TO_VICT );
           actl( AT_DGREY,"of the deadly anti-matter energy upon you! &W[$t]", ch, num_punct(dam), victim, TO_VICT );

           act( AT_DGREY,"Soaring high above the battlefield, $n extends one arm to the sky and begins", ch, num_punct(dam), victim, TO_NOTVICT );
           actl( AT_DGREY,"collecting a mass of pitch black energy, the depth of its ebony sucking the", ch, num_punct(dam), victim, TO_NOTVICT );
           actl( AT_DGREY,"very light from the sky. It grows quickly, feeding on $n's constant flow of", ch, num_punct(dam), victim, TO_NOTVICT );
           actl( AT_DGREY,"dark energy and thirsting... begging to be released. As the massive ball of", ch, num_punct(dam), victim, TO_NOTVICT );
           actl( AT_DGREY,"energy quickly reaches its terminal capacity, $n unleashes the full force", ch, num_punct(dam), victim, TO_NOTVICT );
           actl( AT_DGREY,"of the deadly anti-matter energy upon $N! &W[$t]", ch, num_punct(dam), victim, TO_NOTVICT );

	learn_from_success( ch, gsn_antimatter);

	global_retcode = damage( ch, victim, dam, gsn_antimatter );
     
    }
    else
    {
	act( AT_WHITE, "You raise one arm to the sky... for nothing.", ch, NULL, victim, TO_CHAR );
	act( AT_WHITE, "$n raises one arm to the sky... but... that's all that happens.", ch, NULL, victim, TO_VICT );
	act( AT_WHITE, "$n raises one arm to the sky... but... that's all that happens.", ch, NULL, victim, TO_NOTVICT );
	learn_from_failure( ch, gsn_antimatter );
	global_retcode = damage( ch, victim, 0, gsn_antimatter );
    }
	ch->mana -= skill_table[gsn_antimatter]->min_mana;
    return;
}

