area/
build/testing/
log/
player/
player/backup/
/***************************************************************************
 *  Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer,        *
 *  Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe.   *
 *                                                                         *
 *  Merc Diku Mud improvments copyright (C) 1992, 1993 by Michael          *
 *  Chastain, Michael Quan, and Mitchell Tse.                              *
 *                                                                         *
 *  In order to use any part of this Merc Diku Mud, you must comply with   *
 *  both the original Diku license in 'license.doc' as well the Merc       *
 *  license in 'license.txt'.  In particular, you may not remove either of *
 *  these copyright notices.                                               *
 *                                                                         *
 *  Much time and thought has gone into this software and you are          *
 *  benefitting.  We hope that you share your changes too.  What goes      *
 *  around, comes around.                                                  *
 ***************************************************************************/
#include <glib.h>

#if defined(macintosh)
#include <types.h>
#else
#include <sys/types.h>
#endif
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <merc.h>
#include <tables.h>
#include <power.h>
#include <interp.h>

/* Local functions */

char *	gift_breed_name		args( ( int gift_no ) );
char *	gift_auspice_name	args( ( int gift_no ) );
char *	gift_tribe_name		args( ( int gift_no ) );

/*External Bookmark */
bool    check_dumbshit  args( (char *command) );
extern  void extend_extra    args( (CHAR_DATA *ch) );
extern bool can_becommanded args((CHAR_DATA *ch, CHAR_DATA *victim, char *action));
extern void	set_fighting	args( ( CHAR_DATA *ch, CHAR_DATA *victim ) );
extern void command_victim args((CHAR_DATA *ch, CHAR_DATA *victim, char *action));

void power_animal(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    if (IS_ADDED(ch,ADDED_ANIMAL_MASTER) )
    {
		send_to_char("You are no longer so attractive to animals.\n\r",ch);
		REMOVE_BIT(ch->added, ADDED_ANIMAL_MASTER);
		return;
    }
	
    send_to_char("You make yourself attractive to animals.\n\r",ch);
    SET_BIT(ch->added, ADDED_ANIMAL_MASTER);
    
    return;
}

void power_fleshbond(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    CHAR_DATA *lvic;
    OBJ_DATA *obj;
    OBJ_DATA *obj_next;
    int mob_vnum;

    mob_vnum = ch->pcdata->absorb[ABS_MOB_VNUM];

    if (mob_vnum > 0)
    {
        if ( ( lvic = create_mobile( get_mob_index( mob_vnum ) ) ) == NULL )
        {
            send_to_char("Bug - Please Inform Spiral or Dominion.\n\r",ch);
            return;
        }
        if ( ( ( ch->hit - ch->pcdata->absorb[ABS_MOB_HP] ) < 1 ) || 
             ( ( ch->max_hit - ch->pcdata->absorb[ABS_MOB_MAX_HP]) < 1 ) )
        {
            send_to_char("You would be unable to survive the removal of the Flesh Bonded creature.\n\r",ch);
            return;
        }
        ch->hit -= ch->pcdata->absorb[ABS_MOB_HP];
        ch->max_hit -= ch->pcdata->absorb[ABS_MOB_MAX_HP];
        lvic->hit = ch->pcdata->absorb[ABS_MOB_HP];
        lvic->max_hit = ch->pcdata->absorb[ABS_MOB_MAX_HP];
        ch->pcdata->absorb[ABS_MOB_VNUM] = 0;
        ch->pcdata->absorb[ABS_MOB_HP] = 0;
        ch->pcdata->absorb[ABS_MOB_MAX_HP] = 0;
        char_to_room(lvic,ch->in_room);
        act("You pull $N out of your body.",ch,NULL,lvic,TO_CHAR);
        act("$n pulls $N out of $s body.",ch,NULL,lvic,TO_ROOM);
        return;
    }

    if ((lvic=get_char_room(ch,argument))==NULL)
    {
        send_to_char("There not here. Umm try again.\n\r",ch);
        return;
    }
    
    if ( !IS_NPC(lvic) )
    {
        send_to_char( "Not on players.\n\r", ch );
        return;
    }

    if (!IS_SET(lvic->act,ACT_ANIMAL))
    {
        send_to_char("You can't absorb them!",ch);
        return;
    }

    if (lvic->level > 50)
    {
        send_to_char("You failed.\n\r",ch);
        return;
    }

    if (IS_SET(lvic->act, ACT_AGGRESSIVE))
    {
        send_to_char("You can't seem to get them to play nice.\n\r",ch);
        return;
    }

    act("You absorb $N into your body.",ch,NULL,lvic,TO_CHAR);
    act("$n absorbs $N into $s body.",ch,NULL,lvic,TO_NOTVICT);
    act("$n absorbs you into $s body.",ch,NULL,lvic,TO_VICT);

    for ( obj = lvic->carrying; obj != NULL; obj = obj_next )
    {
        obj_next = obj->next_content;
        obj_from_char(obj);
        obj_to_room(obj,lvic->in_room);
        act("$p falls to the ground.",lvic,obj,NULL,TO_ROOM);
    }
    while ( lvic->affected )
        affect_remove( lvic, lvic->affected );

    ch->pcdata->absorb[ABS_MOB_VNUM] = lvic->pIndexData->vnum;
    ch->pcdata->absorb[ABS_MOB_HP] = lvic->hit;
    ch->pcdata->absorb[ABS_MOB_MAX_HP] = lvic->max_hit;
    ch->hit += lvic->hit;
    ch->max_hit += lvic->max_hit;
    extract_char(lvic, TRUE);
    return;
}

void power_persuasion(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    if (IS_EXTRA(ch,EXTRA_AWE) )
    {
		send_to_char("You are no longer so persuasive.\n\r",ch);
		act("$n no longer appears so persuasive.", ch, NULL, NULL, TO_ROOM);
		REMOVE_BIT(ch->extra, EXTRA_AWE);
		return;
    }

    send_to_char("Your are now persuasive.\n\r",ch);
    act("$n suddenly appears very persuasive.", ch, NULL, NULL, TO_ROOM);
    SET_BIT(ch->extra, EXTRA_AWE);
    return;
}

void power_staredown(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    int sn;
    int level;
    int spelltype;

    if ( IS_AFFECTED(victim, AFF_FEAR) )
    {
    	send_to_char( "They are already pretty scared.\n\r", ch );
    	return;
    }

    act("You lock eyes with $N.",ch,NULL,victim,TO_CHAR);
    act("$n locks eyes with $N.",ch,NULL,victim,TO_NOTVICT);
    act("$n locks eyes with you.",ch,NULL,victim,TO_VICT);

    if ( IS_SET(victim->added, ADDED_COURAGE) )
    {
		send_to_char( "They are far too brave to be scared so easily.\n\r", ch );
		act("$n just failed to use Staredown on you.",ch,NULL,victim,TO_VICT);
		return;
    }

    if (!IS_NPC(victim) && victim->pcdata->willpower >= number_range(10,30))
    {
		send_to_char( "Your Staredown has no effect on them.\n\r", ch );
		act("$n just failed to use Staredown on you.",ch,NULL,victim,TO_VICT);
		return;
    }

	ch->pcdata->rage_points -= 30;


    if ( ( sn = skill_lookup( "fear" ) ) < 0 ) 
    	return;
    spelltype = skill_table[sn].target;
    level = get_breed(ch,BREED_HOMID) * 10;
    (*skill_table[sn].spell_fun) ( sn, level, ch, victim );
    WAIT_STATE( ch, 12 );
    act("$n just used Staredown on you.",ch,NULL,victim,TO_VICT);
    return;
}

void power_reshape_object(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    OBJ_DATA *obj;
    char      arg1[MAX_INPUT_LENGTH];
    char      arg2[MAX_INPUT_LENGTH];
    char      buf [MAX_STRING_LENGTH];
    char      endchar[15];

    smash_tilde( argument );
    argument = one_argument( argument, arg1 );
    argument = one_argument( argument, arg2 );

    if ( arg1[0] == '\0' || arg2[0] == '\0' || argument[0] == '\0' )
    {
    	send_to_char( "Syntax: Reshape <object> rename  <short description>\n\r", ch );
    	send_to_char( "Syntax: Reshape <object> keyword <extra keyword/s>\n\r", ch );
    	send_to_char( "Syntax: Reshape <object> flags   <glow/hum>\n\r", ch );
    	return;
    }

    if ( ( obj = get_obj_carry( ch, arg1 ) ) == NULL )
    {
	send_to_char( "You are not carrying that object.\n\r", ch );
	return;
    }

    if (obj->item_type == ITEM_QUEST || obj->item_type == ITEM_AMMO ||
        obj->item_type == ITEM_EGG   || obj->item_type == ITEM_VOODOO ||
        obj->item_type == ITEM_MONEY || obj->item_type == ITEM_TREASURE ||
        obj->item_type == ITEM_TOOL  || obj->item_type == ITEM_SYMBOL ||
	obj->item_type == ITEM_PAGE  || IS_SET(obj->quest, QUEST_ARTIFACT))
    {
	send_to_char( "You cannot quest-change that item.\n\r", ch );
	return;
    }

    if (!IS_IMMORTAL(ch) && (obj->questowner == NULL || str_cmp(ch->name->str,obj->questowner->str)))
    {
	send_to_char("You can only change an item you own.\n\r", ch);
	return;
    }

    if ( !str_cmp( arg2, "keyword" ) || !str_cmp( arg2, "keywords" ) )
    {
	if (IS_SET(obj->quest, QUEST_RELIC))
	{
	    send_to_char("Not on a relic.\n\r",ch);
	    return;
	}
	if (strlen(argument) < 3)
	{
	    send_to_char("Keywords should be at least 3 characters long.\n\r",ch);
	    return;
	}
	str_cpy(argument,capitalize(argument));
	argument[0] = LOWER(argument[0]);
	endchar[0] = (argument[strlen(argument)-1]);
	endchar[1] = '\0';
	if (!str_cmp(endchar,".")) argument[strlen(argument)-1] = '\0';
	str_cpy(buf,obj->name->str);
	if (strlen(buf) > 80)
	{
	    send_to_char("You cannot fit any more keywords on this object.\n\r",ch);
	    return;
	}
	strcat(buf," ");
	strcat(buf,argument);
	obj->name = g_string_assign(obj->name,buf);
	send_to_char("Ok.\n\r",ch);
    obj->questmaker = g_string_assign(obj->questmaker,ch->name->str);
    return;
    }
	
    if ( !str_cmp( arg2, "flags" ) )
    {
	if (!str_cmp(argument,"glow"))
	{
	    if (IS_SET(obj->extra_flags, ITEM_GLOW))
		REMOVE_BIT(obj->extra_flags, ITEM_GLOW);
	    else
		SET_BIT(obj->extra_flags, ITEM_GLOW);
	}
	else if (!str_cmp(argument,"hum"))
	{
	    if (IS_SET(obj->extra_flags, ITEM_HUM))
		REMOVE_BIT(obj->extra_flags, ITEM_HUM);
	    else
		SET_BIT(obj->extra_flags, ITEM_HUM);
	}
	else
	{
	    send_to_char( "Syntax: Reshape <object> flags   <glow/hum>\n\r", ch );
	    return;
	}
	send_to_char("Ok.\n\r",ch);
    obj->questmaker = g_string_assign(obj->questmaker,ch->name->str);
    return;
    }

    send_to_char( "Syntax: Reshape <object> keyword <extra keyword/s>\n\r", ch );
    send_to_char( "Syntax: Reshape <object> flags   <glow/hum>\n\r", ch );
    return;
}

void power_disquiet(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    if (IS_NPC(victim))
    {
    	send_to_char( "Not on NPC's.\n\r", ch );
    	return;
    }
	
	if (IS_SET(victim->sphere_spaffect,AFSPHERE_MIND_SHIELD) ){
		send_to_char("They have a shield blocking thier mind.\n\r",ch);
		send_to_char("Your mental shield blocks a disquiet attempt.\n\r",victim);
		return;
	}
	
    act( "A look of concentration crosses $n's face.", ch, NULL, NULL, TO_ROOM );
	
    if (IS_SET(victim->added, ADDED_CALM))
    {
		send_to_char("You no longer feel so apathetic.\n\r",victim);
		REMOVE_BIT(victim->added, ADDED_CALM);
		WAIT_STATE( ch, 12 );
		return;
    }

    if (!IS_NPC(victim) && 	victim->pcdata->willpower >= number_range(1,20) && ch != victim)
    {
		send_to_char("They resist you.\n\r",ch);
		act("$n just failed to use Disquiet on you.",ch,NULL,victim,TO_VICT);
		return;
    }

    act("$n just used Disquiet on you.",ch,NULL,victim,TO_VICT);

    if (IS_ADDED(victim, ADDED_ANGER))
    {
		send_to_char("You no longer feel so angry.\n\r",victim);
		act("$n regains $s temper.",victim,NULL,NULL,TO_ROOM);
		REMOVE_BIT(victim->added, ADDED_ANGER);
		WAIT_STATE( ch, 12 );
		return;
    }
	
    send_to_char("You suddenly feel very apathetic!\n\r",victim);
    act("$n yawns and looks around with a bored expression.",victim,NULL,NULL,TO_ROOM);
    SET_BIT(victim->added, ADDED_CALM);
    WAIT_STATE( ch, 12 );
    return;
}

void power_spgift(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    SPHERE_DATA af;

    if (IS_SET(ch->sphere_spaffect,ADDED_GIFTSPRIG) )
		return;
	af.spell_number = mage_affect_slot("giftofspriggan");
	af.type      = TYPE_SPHERE_ADDED;
	af.duration  = 2 * get_tribe(ch,TRIBE_FIANNA);
	af.bitvector = ADDED_GIFTSPRIG;
	sphere_to_char( ch, &af );
	send_to_char( mage_affect_table[mage_affect_slot("giftofspriggan")].on_msg, ch );
	
    act("$n howls with rage as thier body grows even bigger!",ch,NULL,NULL,TO_ROOM);
    send_to_char("You feel the Gift of the Spriggan as your body grows!\n\r",ch);

    return;
}

void power_icy(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    if (ch->fighting != NULL)
    {
        send_to_char("Not while fighting.\n\r",ch);
        return;
    }

    if (IS_ITEMAFF(ch,ITEMA_PEACE) )
    {
        send_to_char("You stop using the Icy Chill of Despair.\n\r",ch);
        act("$n no longer seems so scary.", ch, NULL, NULL, TO_ROOM);
        REMOVE_BIT(ch->itemaffect, ITEMA_PEACE);
        return;
    }
    send_to_char("Your start using the Icy Chill of Despair.\n\r",ch);
    act("$n suddenly appears really scary.", ch, NULL, NULL, TO_ROOM);
    SET_BIT(ch->itemaffect, ITEMA_PEACE);
    return;
}

void power_bsong(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    char arg[MSL];

    argument = one_argument(argument,arg);
	if (IS_SWWF(ch) && ch->pcdata->rage_points < 300)
    {
        send_to_char("You must have at least 300 Rage to use this command.\n\r",ch );
        return;
    }
	
    if (arg[0] == '0')
    {
        send_to_char("You must use fight or flight with this command.\n\r",ch);
        return;
    }

    if (IS_ADDED(ch,ADDED_FRENZY))
    {
        send_to_char("You already in frenzy..\n\r",ch);
        return;
    }

    //enter the FRENZY!!!
	send_to_char("You start to howl as your world turns {RRED{x\n\r",ch);
	
    //if not crinos make it so...
	if (ch->pcdata->wwf_shape != SHAPE_CRINOS )
	{
	    shape_shift(ch,SHAPE_CRINOS);
    }
	
    SET_BIT(ch->added, ADDED_FRENZY);
	
    //fight or flight...
	if (!str_cmp(arg,"fight"))
		ch->pcdata->frenzy_action = FRENZY_FIGHT;	
	else if (!str_cmp(arg,"flight"))
        ch->pcdata->frenzy_action = FRENZY_FLIGHT;	
        
    ch->pcdata->rage_points = get_max_rage(ch);

    return;
}

void power_paralyzing(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    
    act("You stare deeply into $N's eyes.",ch,NULL,victim,TO_CHAR);
    act("$n stares deeply into $N's eyes.",ch,NULL,victim,TO_NOTVICT);
    act("$n stares deeply into your eyes.",ch,NULL,victim,TO_VICT);

    act("You stare back into $N's eyes.",victim,NULL,ch,TO_CHAR);
    act("$n stares back into $N's eyes.",victim,NULL,ch,TO_NOTVICT);
    act("$n stares back into your eyes.",victim,NULL,ch,TO_VICT);

    send_to_char( "You paralyze them with your stare!\n\r", ch );
    send_to_char( "You are momentarily paralyzed!\n\r", victim );

    WAIT_STATE( ch, 24 );
    WAIT_STATE( victim, 24 );
    return;
}

void power_spwrath(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    if (IS_NPC(victim))
    {
        send_to_char("Sorry players only.\n\r",ch);
        return;
    }

    if (victim->pcdata->willpower >= number_range(1,30))
    {
        send_to_char("They resist your wrath!\n\r",ch);
        return;
    }

    act("You give them a taste of Spiral's Wrath!.",ch,NULL,victim,TO_CHAR);
    act("$n gives you a taste of Spiral's WRATH!",ch,NULL,victim,TO_VICT);
    act("$n shows $N about Spiral's wrath!.",ch,NULL,victim,TO_NOTVICT);

    do_flee(victim,"");

    WAIT_STATE(ch,24);
    WAIT_STATE(victim,24);

    return;
}

void power_mindblock(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    if (IS_SET(ch->pcdata->comm,COMM_MIND_BLOCK) )
    {
        REMOVE_BIT(ch->pcdata->comm,COMM_MIND_BLOCK);    
        send_to_char("You are no longer blocking your mind.\n\r",ch);
        return;
    }
    
    SET_BIT(ch->pcdata->comm, COMM_MIND_BLOCK);
    send_to_char("You Start to block your mind!\n\r",ch);

    return;
}

void power_obedience(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
	char action[MAX_INPUT_LENGTH];

	smash_quote(argument);

	one_argument(argument,action);

	if (IS_NPC(victim)){
		send_to_char("Only on players.\n\r",ch);
		return;
	}

	if (!can_becommanded(ch,victim,action))
		return;

	if (IS_SWWF(victim) && victim->pcdata->renown > ch->pcdata->renown){
		send_to_char("You cannot command a high ranked garou.\n\r",ch);
		return;
	}

	command_victim(ch,victim,argument);
	return;
}

void power_dazzle(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    if (victim->position != POS_FIGHTING && victim->hit < victim->max_hit)
    {
        send_to_char( "Nothing happens.\n\r", ch );
        act("$n just failed to use Dazzle on you.",ch,NULL,victim,TO_VICT);
        return;
    }

    act( "A look of concentration crosses $n's face.", ch, NULL, NULL, TO_ROOM );

    send_to_char("You cover your eyes as you are dazzled!\n\r",victim);
    act("$n covers $s eyes, looking dazzled!",victim,NULL,NULL,TO_ROOM);

    act("$n just used Dazzle on you.",ch,NULL,victim,TO_VICT);

    stop_fighting(victim,TRUE);
    update_pos(victim);
    if (victim->position > POS_STUNNED)
        victim->position = POS_STUNNED;
    if (IS_NPC(victim)) 
        do_kill(victim,ch->name->str);
    
    WAIT_STATE( ch, 24 );

    return;
}

void power_hice(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
	int dam;
	
	dam = number_range(1000,4000);
    
    damage( ch, victim, dam, 0 );

	send_to_char("You find it very hard to breath as your heart starts to freeze.\n\r",victim);
	send_to_char("You grin to see thier heart turn to ice.\n\r",ch);	
	act("$N makes a dancing movement as they freeze $n's heart.",ch,NULL,victim,TO_NOTVICT);

	WAIT_STATE(ch,24);
    WAIT_STATE(victim, 12);

    if (victim == NULL || victim->position == POS_DEAD) return;
    
    update_pos(victim);
    
    return;
}

void power_halosun(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    if (IS_ITEMAFF(ch,ITEMA_SUNSHIELD) )
    {
    	send_to_char("Your Halo of the Sun gradually fades away.\n\r",ch);
    	act("$n's Halo of the Sun gradually fades away.", ch, NULL, NULL, TO_ROOM);
    	REMOVE_BIT(ch->itemaffect, ITEMA_SUNSHIELD);
    	return;
    }
    
    send_to_char("You are surrounded by a halo of sunlight!\n\r",ch);
    act("$n is surrounded by a halo of sunlight!", ch, NULL, NULL, TO_ROOM);
    SET_BIT(ch->itemaffect, ITEMA_SUNSHIELD);
    return;
}

void power_wall(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    OBJ_DATA  *obj;
    EXIT_DATA *pexit;
    ROOM_INDEX_DATA *location;
    ROOM_INDEX_DATA *to_room;
    char       arg [MAX_INPUT_LENGTH];
    char       buf [MAX_INPUT_LENGTH];
    int        duration = number_range(15,30);
    int        direction, rev;

    one_argument( argument, arg );

    if ( arg[0] == '\0')
    {
	send_to_char( "Which direction do you wish to make the wall?\n\r", ch );
	return;
    }

         if (!str_cmp(arg,"north") || !str_cmp(arg,"n")) 
	{direction = DIR_NORTH; rev = DIR_SOUTH;}
    else if (!str_cmp(arg,"south") || !str_cmp(arg,"s")) 
	{direction = DIR_SOUTH; rev = DIR_NORTH;}
    else if (!str_cmp(arg,"east")  || !str_cmp(arg,"e")) 
	{direction = DIR_EAST;  rev = DIR_WEST;}
    else if (!str_cmp(arg,"west")  || !str_cmp(arg,"w")) 
	{direction = DIR_WEST;  rev = DIR_EAST;}
    else if (!str_cmp(arg,"up")    || !str_cmp(arg,"u")) 
	{direction = DIR_UP;    rev = DIR_DOWN;}
    else if (!str_cmp(arg,"down")  || !str_cmp(arg,"d")) 
	{direction = DIR_DOWN;  rev = DIR_UP;}
    else
    {
	send_to_char( "Select direction: North, South, East, West, Up or Down.\n\r", ch );
	return;
    }

    switch (direction)
    {
	default:        str_cpy(arg,"north"); break;
	case DIR_NORTH: str_cpy(arg,"north"); break;
	case DIR_SOUTH: str_cpy(arg,"south"); break;
	case DIR_EAST:  str_cpy(arg,"east");  break;
	case DIR_WEST:  str_cpy(arg,"west");  break;
	case DIR_UP:    str_cpy(arg,"up");    break;
	case DIR_DOWN:  str_cpy(arg,"down");  break;
    }

    if ( ( pexit = ch->in_room->exit[direction] ) == NULL )
    {
	send_to_char("Nothing happens.\n\r",ch);
	return;
    }

    if ( ( location = ch->in_room ) == NULL )
    {
	send_to_char("Nothing happens.\n\r",ch);
	return;
    }

    if ( ( to_room = pexit->to_room ) == NULL )
    {
	send_to_char("Nothing happens.\n\r",ch);
	return;
    }

    if (IS_SET(pexit->exit_info, EX_WALL_WATER) || 
	IS_SET(pexit->exit_info, EX_WALL_GRANITE) || 
	IS_SET(pexit->exit_info, EX_WALL_FLAME))
    {
	send_to_char("There is already a wall blocking that exit.\n\r",ch);
	return;
    }
	
    act( "A look of concentration crosses $n's face.", ch, NULL, NULL, TO_ROOM );

    obj = create_object( get_obj_index( OBJ_VNUM_PORTAL ), 0 );
    obj->item_type = ITEM_WALL;
    obj->value[0] = direction;
    obj->timer = duration;
    obj->name = g_string_assign(obj->name,"wall flowing water");
    obj->short_descr = g_string_assign(obj->short_descr,"a wall of flowing water");
    sprintf(buf,"A wall of flowing water blocks your exit %s.",arg);
    obj->description = g_string_assign(obj->description,buf);
    obj_to_room( obj, ch->in_room );

    SET_BIT(pexit->exit_info, EX_WALL_WATER);

    if (direction == DIR_UP)
	sprintf(buf,"Water pours from the ground and forms a wall above you.");
    else if (direction == DIR_DOWN)
	sprintf(buf,"Water pours from the ground and forms a wall below you.");
    else
	sprintf(buf,"Water pours from the ground and forms a wall to the %s.",arg);
    act( buf, ch, NULL, NULL, TO_CHAR );
    act( buf, ch, NULL, NULL, TO_ROOM );
    WAIT_STATE(ch,12);

    if (location == to_room) return;

    char_from_room(ch);
    char_to_room(ch, to_room);

    if ( ( pexit = ch->in_room->exit[rev] ) == NULL ) return;
    if (IS_SET(pexit->exit_info, EX_WALL_WATER) || 
	IS_SET(pexit->exit_info, EX_WALL_GRANITE) || 
	IS_SET(pexit->exit_info, EX_WALL_FLAME)) return;

    switch (rev)
    {
	default:        str_cpy(arg,"north"); break;
	case DIR_NORTH: str_cpy(arg,"north"); break;
	case DIR_SOUTH: str_cpy(arg,"south"); break;
	case DIR_EAST:  str_cpy(arg,"east");  break;
	case DIR_WEST:  str_cpy(arg,"west");  break;
	case DIR_UP:    str_cpy(arg,"up");    break;
	case DIR_DOWN:  str_cpy(arg,"down");  break;
    }

    obj = create_object( get_obj_index( OBJ_VNUM_PORTAL ), 0 );
    obj->item_type = ITEM_WALL;
    obj->value[0] = rev;
    obj->timer = duration;
    obj->name = g_string_assign(obj->name,"wall flowing water");
    obj->short_descr = g_string_assign(obj->short_descr,"a wall of flowing water");
    sprintf(buf,"A wall of flowing water blocks your exit %s.",arg);
    obj->description = g_string_assign(obj->description,buf);
    obj_to_room( obj, ch->in_room );

    SET_BIT(pexit->exit_info, EX_WALL_WATER);

    if (rev == DIR_UP)
	sprintf(buf,"Water pours from the ground and forms a wall above you.");
    else if (rev == DIR_DOWN)
	sprintf(buf,"Water pours from the ground and forms a wall below you.");
    else
	sprintf(buf,"Water pours from the ground and forms a wall to the %s.",arg);
    act( buf, ch, NULL, NULL, TO_ROOM );

    char_from_room(ch);
    char_to_room(ch, location);

    return;
}


void power_burrow( CHAR_DATA *ch, CHAR_DATA *victim, char *argument )
{
	if ( ch->fighting != NULL)
	{	
		send_to_char("Not while fighting.\n\r",ch);
		return;
	}

	if ( victim == ch
		||   victim->in_room == NULL
		||   IS_NPC(victim)
 //   ||   IS_NPC(victim) -dc
		||   IS_SET(ch->in_room->room_flags, ROOM_PRIVATE)
		||   IS_SET(ch->in_room->room_flags, ROOM_SOLITARY)
		||   IS_SET(ch->in_room->room_flags, ROOM_NO_RECALL)
		||   IS_SET(victim->in_room->room_flags, ROOM_PRIVATE)
		||   IS_SET(victim->in_room->room_flags, ROOM_SOLITARY)
		||   IS_SET(victim->in_room->room_flags, ROOM_NO_RECALL)
		||   victim->in_room->vnum == 1
		||   (ch->clan != victim->clan)
		||   ch->sect != victim->sect
		||   victim->in_room->vnum == 2
		||   victim->in_room->vnum == 1200
		||   (ch->pk_timer > 0 && is_tempsafe(ch)) 
		||   ( strstr(victim->in_room->area->builders, "Unlinked" ) )
		||   victim->in_room->vnum == ch->in_room->vnum)
	{
		send_to_char( "You failed.\n\r", ch );
		return;
	}

	send_to_char("You burrow in the ground and jump out of the ground in front of your packmate.\n\r",ch);
	char_from_room( ch );
	char_to_room( ch, victim->in_room );
	
	do_look( ch,"auto");
	act( "$n jumps from the ground in front of $N.", ch, NULL, victim, TO_ROOM );
	act( "$N jumps up from the ground in front of you.", ch, NULL, victim, TO_VICT );
	return;
}

void power_pounce( CHAR_DATA *ch, CHAR_DATA *victim, char *argument )
{
	int number_rip;
	
	if (IS_NPC(victim))
	{
		send_to_char("You can't rip a mobiles throat out!\n\r",ch);
		return;
	}

	number_rip = number_range(1,100);
	if (number_rip < ( 10 * ch->pcdata->powers[WPOWER_RAT]))
	{
		send_to_char("You rip your vitim's throat out with brutal force!\n\r",ch);
		act("With a quick slash of $n's wrist you neck starts to bleed all over your legs.",ch,NULL,victim,TO_VICT);
		if (!IS_BODY(victim,CUT_THROAT))
			SET_BIT(victim->loc_hp[1],CUT_THROAT);
		if (!IS_BLEEDING(victim,BLEEDING_THROAT))
			SET_BIT(victim->loc_hp[6],BLEEDING_THROAT);
		act("$n's blow slices open $N's carotid artery, spraying blood everywhere.", ch, NULL, victim, TO_NOTVICT);
		make_part(victim,"blood");
	 	if (ch->fighting == NULL)	
			set_fighting(ch,victim);
		multi_hit(ch,victim,TYPE_UNDEFINED);
	}
	return;
}

void power_moongate( CHAR_DATA *ch, CHAR_DATA *victim, char *argument )
{
	if ( victim == ch
		||   victim->in_room == NULL
		||   IS_NPC(ch)
		||   victim->level > 50
		||   (!IS_NPC(victim) && !IS_IMMUNE(victim, IMM_SUMMON) )
		||   IS_SET(ch->in_room->room_flags, ROOM_PRIVATE)
		||   IS_SET(ch->in_room->room_flags, ROOM_SOLITARY)
		||   IS_SET(ch->in_room->room_flags, ROOM_NO_RECALL)
		||   IS_SET(victim->in_room->room_flags, ROOM_PRIVATE)
		||   IS_SET(victim->in_room->room_flags, ROOM_SOLITARY)
		||   IS_SET(victim->in_room->room_flags, ROOM_NO_RECALL)
		||   victim->in_room->vnum == 1
		||   victim->in_room->vnum == 2
		||   victim->in_room->vnum == 1200
		||   (ch->pk_timer > 0 && is_tempsafe(ch)) 
		||   ( strstr(victim->in_room->area->builders, "Unlinked" ) )
		||   victim->in_room->vnum == ch->in_room->vnum)
	{
		send_to_char( "You failed.\n\r", ch );
		return;
	}
	
	send_to_char("You pray to the moon and start to walk.\n\r",ch);
	char_from_room( ch );
	char_to_room( ch, victim->in_room );
	
	do_look( ch,"auto");
	act( "In a flash $n appears in front of $N.", ch, NULL, victim, TO_NOTVICT );
	act( "In a flash $n appears in front of you.", ch, NULL, victim, TO_VICT );
	return;
}

void power_luna( CHAR_DATA *ch, CHAR_DATA *victim, char * argument )
{
	if ( IS_SET(ch->act,PLR_MARBLEFLESH))
	{
		REMOVE_BIT(ch->act,PLR_MARBLEFLESH);
		send_to_char("The white moonlight that surrounded your body disappears.\n\r",ch);
		
	}
	else
	{
		SET_BIT(ch->act,PLR_MARBLEFLESH);
		send_to_char("As you pray to Luna a white moonlight surrounds your body!\n\r",ch);
	}	
}

void power_mirror( CHAR_DATA *ch, CHAR_DATA *victim, char *arguments )
{
	char buf[MAX_STRING_LENGTH];
    CHAR_DATA *lvic;

	lvic=create_mobile( get_mob_index( MOB_VNUM_GUARDIAN ) );
	lvic->level = ch->level;
	lvic->hit = ch->hit / 4;
	lvic->max_hit = ch->max_hit / 4;
	lvic->hitroll = 0;
	lvic->damroll = 0;
	lvic->armor = 100 - (ch->level*7);
	lvic->dead_time = 140;
	lvic->name = g_string_assign(lvic->name,ch->name->str);
	lvic->short_descr = g_string_assign(lvic->short_descr,ch->name->str);
	sprintf(buf,"%s is here.\n\r",ch->name->str);
	lvic->long_descr = g_string_assign(lvic->long_descr,buf);
	
	SET_BIT(lvic->act, ACT_DEAD);
	
	send_to_char( "You spawn a mirror image of your self and find out you look good!.\n\r",ch );
	act( "$n grins evily as you notice $N is grinning at you too.", ch, NULL, lvic, TO_ROOM );
	
	char_to_room( lvic, ch->in_room );
	return;
}

void power_spriggan( CHAR_DATA *ch, CHAR_DATA *victim, char * argument )
{
	if (!str_cmp(argument,"enlarge"))
	{
		if (IS_ADDED(ch,ADDED_ENLARGE))
		{
			send_to_char("You can't grow past your current size.\n\r",ch);
			return;
		}
		if (IS_ADDED(ch,ADDED_SHRINK))
		{
			REMOVE_BIT(ch->added,ADDED_SHRINK);
			send_to_char("You increase your size about 3 feet.\n\r",ch);	
		}
		else
		{
			SET_BIT(ch->added,ADDED_ENLARGE);	
			send_to_char("You increase your size about 3 feet.\n\r",ch);	
		}
	}
	if (!str_cmp(argument,"shrink"))
	{
		if (IS_ADDED(ch,ADDED_SHRINK))
		{
			send_to_char("You try to shrink you self to a pubic hair and fail.\n\r",ch);
			return;
		}
		if (IS_ADDED(ch,ADDED_ENLARGE))
		{	
			REMOVE_BIT(ch->added,ADDED_ENLARGE);
			send_to_char("You shrink about 3 feet in size.\n\r",ch);	
		}	
		else
		{
			SET_BIT(ch->added,ADDED_SHRINK);	
			send_to_char("You shrink about 3 feet in size.\n\r",ch);	
		}
	}	
}
void power_calm( CHAR_DATA *ch, CHAR_DATA *vicitm, char *argument )
{
	if (IS_CLASS(ch, CLASS_VAMPIRE) && ch->beast < 1)
	{
		if ( ch->pcdata->stats[UNI_RAGE] < 1 )
		{
			send_to_char("Your beast doesn't control your actions.\n\r",ch);
			return;
		}
		send_to_char("You take a deep breath and force back your inner beast.\n\r",ch);
		act("$n takes a deep breath and forces back $s inner beast.",ch,NULL,NULL,TO_ROOM);
		ch->pcdata->stats[UNI_RAGE] = 0;
		if (IS_VAMPAFF(ch, VAM_NIGHTSIGHT)) power_nightsight(ch,ch,"");
		if (IS_VAMPAFF(ch, VAM_FANGS)) power_fangs(ch,ch,"");
		if (IS_VAMPAFF(ch, VAM_CLAWS)) power_claws(ch,ch,"");
		return;
	}
	if (IS_SET(ch->special, SPC_WOLFMAN))
	{
		send_to_char("You take a deep breath and calm yourself.\n\r",ch);
		act("$n takes a deep breath and tries to calm $mself.",ch,NULL,NULL,TO_ROOM);
		ch->pcdata->stats[UNI_RAGE] -= number_range(10,20);
		if (ch->pcdata->stats[UNI_RAGE] < 100) do_unwerewolf(ch,"");
		return;
	}
	send_to_char("But you are not in crinos form!\n\r",ch);
	return;
}
void power_rage( CHAR_DATA *ch, CHAR_DATA *victim, char *argument )
{
	if (IS_CLASS(ch, CLASS_VAMPIRE))
	{
		if ( ch->pcdata->stats[UNI_RAGE] >= 25 + (get_disc(ch,DISC_POTENCE) * 10) )
		{
			send_to_char("Your beast is already controlling you.\n\r",ch);
			return;
		}
		if (!IS_VAMPAFF(ch, VAM_NIGHTSIGHT)) power_nightsight(ch,ch,"");
		if (!IS_VAMPAFF(ch, VAM_FANGS)) power_fangs(ch,ch,"");
		if (!IS_VAMPAFF(ch, VAM_CLAWS)) power_claws(ch,ch,"");
		send_to_char("You bare yours fangs and growl as your inner beast consumes you.\n\r",ch);
		act("$n bares $s fangs and growls as $s inner beast consumes $m.",ch,NULL,NULL,TO_ROOM);
		ch->pcdata->stats[UNI_RAGE] += number_range(10,20);
		if (ch->beast > 0) do_beastlike(ch,"");
		WAIT_STATE(ch,12);
		return;
	}
	if (!IS_SET(ch->special, SPC_WOLFMAN))
	{
		send_to_char("You start snarling angrilly.\n\r",ch);
		act("$n starts snarling angrilly.",ch,NULL,NULL,TO_ROOM);
		ch->pcdata->stats[UNI_RAGE] += number_range(10,20);
		if (ch->pcdata->stats[UNI_RAGE] >= 100) do_werewolf(ch,"");
		WAIT_STATE(ch,12);
		return;
	}
	send_to_char("But you are already in a rage!\n\r",ch);
	return;
}
void power_shield( CHAR_DATA *ch,CHAR_DATA *victim, char *argument )
{
	SPHERE_DATA af;
	
	if(IS_CLASS(ch, CLASS_MAGE))
    {
        if (IS_SET(ch->sphere_spaffect,AFSPHERE_SHIELD) )
            return;
        af.spell_number = mage_affect_slot("Shield");
        af.type      = TYPE_SPHERE_SPAFFECT;
        af.duration  = 10 * has_sphere(ch,SPHERE_ENTROPY);
        af.bitvector = AFSPHERE_SHIELD;
        sphere_to_char( ch, &af );
        send_to_char( mage_affect_table[mage_affect_slot("Shield")].on_msg, ch );
        return;
    }
	if (!IS_IMMUNE(ch,IMM_SHIELDED) )
	{
		send_to_char("You shield your aura from those around you.\n\r",ch);
		SET_BIT(ch->immune, IMM_SHIELDED);
		return;
	}
	send_to_char("You stop shielding your aura.\n\r",ch);
	REMOVE_BIT(ch->immune, IMM_SHIELDED);
	return;
}



void power_spiritplane( CHAR_DATA *ch, CHAR_DATA *victim, char *argument )
{
	OBJ_DATA *obj;
	SPHERE_DATA af;
	char      arg [MAX_INPUT_LENGTH];
	argument = one_argument( argument, arg );
	
	if (ch->fighting != NULL)
	{
		send_to_char("Not while fighting.\n\r",ch);
		return;
	}

	if(IS_CLASS(ch,CLASS_MAGE))
	{
		if (ch->plane == PLANE_SPIRIT)
			return;

		af.spell_number = mage_affect_slot("Spiritplane");
		af.type      = TYPE_PLANE;
		af.duration  = 10 * has_sphere(ch,SPHERE_SPIRIT);
		sphere_to_char( ch, &af );
		ch->plane = PLANE_SPIRIT;
		shift_obj_plane(ch);
		send_to_char( mage_affect_table[mage_affect_slot("Spiritplane")].on_msg, ch );
		send_to_char("You fade into the plane of spirits and wraiths.\n\r",ch);
		act("$n flicker's from your view.",ch,NULL,NULL,TO_ROOM);
		do_look(ch,"auto");
		return;
	}


	if ( arg[0] == '\0' )
	{
		if (ch->plane == PLANE_NORMAL)
		{
			send_to_char("You fade into the plane of spirits and wraiths.\n\r",ch);
			act("$n flicker's from your view.",ch,NULL,NULL,TO_ROOM);
			ch->plane = PLANE_SPIRIT;
			shift_obj_plane(ch);
			do_look(ch,"auto");
			return;
		}
		ch->plane = PLANE_NORMAL;
		shift_obj_plane(ch);
		send_to_char("You fade back into the real world.\n\r",ch);
		act("A spirit flickers and $n fades into existance.",ch,NULL,NULL,TO_ROOM);
		do_look(ch,"auto");
		return;
	}

	if ( ( obj = get_obj_here( ch, arg ) ) == NULL )
	{
		send_to_char( "What do you wish to toss into the spirit plane?\n\r", ch );
		return;
	}

	if (obj->plane == PLANE_SPIRIT){
		obj->plane = PLANE_NORMAL;
		send_to_char( "You toss it to the ground and it vanishes.\n\r", ch );
	}
	else if (obj->plane == PLANE_NORMAL){
		obj->plane = PLANE_SPIRIT;
		send_to_char( "The object has become a shade lighter.\n\r", ch );
	}
	shift_obj_plane(ch);
	return;
}

void power_flex( CHAR_DATA *ch, CHAR_DATA *victim, char *argument )
{
	int sn;

	act("You flex your bulging muscles.",ch,NULL,NULL,TO_CHAR);
	act("$n flexes $s bulging muscles.",ch,NULL,NULL,TO_ROOM);
	if (IS_NPC(ch)) return;
	
	if ( IS_EXTRA(ch, TIED_UP) )
	{
		act("The ropes restraining you snap.",ch,NULL,NULL,TO_CHAR);
		act("The ropes restraining $n snap.",ch,NULL,NULL,TO_ROOM);
		REMOVE_BIT(ch->extra, TIED_UP);
	}
	if (is_affected(ch, gsn_web))
	{
		act("The webbing entrapping $n breaks away.",ch,NULL,NULL,TO_ROOM);
		send_to_char("The webbing entrapping you breaks away.\n\r",ch);
		REMOVE_BIT(ch->affected_by, AFF_WEBBED);
		if ( ( sn = skill_lookup( "arms" ) ) > 0 ) 
			affect_strip(ch, sn);
		if ( ( sn = skill_lookup( "web" ) ) > 0 ) 
			affect_strip(ch, sn);
	}
	if (IS_AFFECTED(ch, AFF_WEBBED))
	{
		act("The webbing entrapping $n breaks away.",ch,NULL,NULL,TO_ROOM);
		send_to_char("The webbing entrapping you breaks away.\n\r",ch);
		REMOVE_BIT(ch->affected_by, AFF_WEBBED);
		if ( ( sn = skill_lookup( "arms" ) ) > 0 ) 
			affect_strip(ch, sn);
		if ( ( sn = skill_lookup( "web" ) ) > 0 ) 
			affect_strip(ch, sn);
	}
	return;
}
void power_nightsight( CHAR_DATA *ch, CHAR_DATA *victim, char *argument )
{
	SPHERE_DATA af;
	
		if (IS_CLASS(ch,CLASS_MAGE))
        {
            if (IS_SET(ch->sight,SIGHT_NIGHTSIGHT))
                        return;
                    af.spell_number = mage_affect_slot("NightSight");
                    af.type      = TYPE_SIGHT;
                    af.duration  = 10 * has_sphere(ch,SPHERE_CORRESPONDENCE);
                    af.bitvector = SIGHT_NIGHTSIGHT;
                    sphere_to_char( ch, &af );
                    send_to_char( mage_affect_table[mage_affect_slot("NightSight")].on_msg, ch );
                    return;
        }
	if (IS_VAMPAFF(ch,VAM_NIGHTSIGHT) )
	{
		send_to_char("The red glow in your eyes fades.\n\r",ch);
		act("The red glow in $n's eyes fades.", ch, NULL, NULL, TO_ROOM);
		REMOVE_BIT(ch->pcdata->stats[UNI_AFF], VAM_NIGHTSIGHT);
		return;
	}
	send_to_char("Your eyes start glowing red.\n\r",ch);
	act("$n's eyes start glowing red.", ch, NULL, NULL, TO_ROOM);
	SET_BIT(ch->pcdata->stats[UNI_AFF], VAM_NIGHTSIGHT);
	return;
}

void power_moonbeam( CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
	int       dam;
    int 	  ST = ch->pcdata->powers[WPOWER_SPHINX];	
	
	if ( weather_info[ch->in_room->sector_type].sunlight != SUN_DARK )
	{
		send_to_char("The night has not fallen yet to use this gift.\n\r",ch);
		return;
	}	
	
	if ( ch->mana < 255 )
	{
		send_to_char("You don't have enough mana!\n\r",ch);
		return;
	}
	
	if ( ch->fighting == NULL )
		set_fighting(ch,victim);

	ch->mana -= 500;
	ch->hit -= number_range(20,250);
	set_attack_flag(ch,victim);
	dam = number_range( 1000, ST * 1000);
	damage( ch, victim, dam, TYPE_LIGHT );
	act("$n's moon beam hits $N dead on!",ch,NULL,victim,TO_NOTVICT);
	act("You hit $N with a powerful moon beam.",ch,NULL,victim,TO_CHAR);
	act("You get hit by $n's moon beam!",ch,NULL,victim,TO_VICT);
}


DECLARE_DO_FUN(do_say);
DECLARE_DO_FUN(do_open);

extern int find_path args(( int in_room_vnum, int out_room_vnum, CHAR_DATA *ch, int depth, int in_zone ));


void power_hunt( CHAR_DATA *ch, CHAR_DATA *victim, char *argument )
{
  char buf[MAX_STRING_LENGTH];
  GString *buf2;
  int direction;
  bool fArea;

  if( ch->move > 5 )
    ch->move -= 5;
  else
    {
      send_to_char( "You're too exhausted to hunt anyone!\n\r", ch );
      return;
    }

  /* only imps can hunt to different areas */
  fArea = ( get_trust(ch) < MAX_LEVEL );
  
  if (!IS_NPC(victim) && IS_SWWF(victim) && get_auspice(victim,AUSPICE_RAGABASH) > 1)
  {
	send_to_char("You failed.\n\r",ch);
	return;
  }


  if( ch->in_room == victim->in_room )
    {
      act( "$N is here!", ch, NULL, victim, TO_CHAR );
      return;
    }

  act( "$n carefully sniffs the air.", ch, NULL, NULL, TO_ROOM );
  WAIT_STATE( ch, 12 );
  direction = find_path( ch->in_room->vnum, victim->in_room->vnum, ch, -40000, fArea );

  if( direction == -1 )
    {
      act( "You couldn't find a path to $N from here.",
	  ch, NULL, victim, TO_CHAR );
      return;
    }
  
  if( direction < 0 || direction > 5 )
    {
      send_to_char( "Hmm... Something seems to be wrong.\n\r", ch );
      return;
    }

  /*
   * Display the results of the search.
   */
  sprintf( buf, "$N is %s from here.", dir_name[direction] );
  buf2 = g_string_new("");
  mxpconv(buf2,buf,ch); 
  act( buf2->str, ch, NULL, victim, TO_CHAR );
  g_string_free(buf2,TRUE);

  return;
}

void power_lightning(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    DESCRIPTOR_DATA *d;
    int dam, hp;
	GSList	*desc_list;
	
    if ( ch->in_room->sector_type == SECT_INSIDE || !IS_OUTSIDE(ch) )
    {
        send_to_char("You can only control the weather outside.\n\r",ch);
        return;
    }

    if (weather_info[ch->in_room->sector_type].sky != SKY_LIGHTNING && 
        weather_info[ch->in_room->sector_type].sky != SKY_RAINING )

        act( "A look of concentration crosses $n's face.", ch, NULL, NULL, TO_ROOM );

    for ( desc_list = descriptor_list; desc_list != NULL; desc_list = g_slist_next(desc_list) )
	{
		d = (DESCRIPTOR_DATA*)desc_list->data;
        if ( d->connected != CON_PLAYING ) 
            continue;
        if ( (victim = d->character) == NULL ) 
            continue;
        if ( IS_NPC(victim) ) 
            continue;
        if ( victim->in_room == NULL ) 
            continue;
        if ( victim->in_room->sector_type == SECT_INSIDE ) 
            continue;
        if ( victim->in_room != ch->in_room ) 
            continue;
        send_to_char( "Lightning flashes in the sky.\n\r", ch );
    }

    send_to_char( "A stream of lightning arcs down from the sky.\n\r", ch );
    act("A stream of lightning arcs down from the sky.", ch, NULL, NULL, TO_ROOM);

    dam = number_range(500,1000);
    hp = victim->hit;
    damage( ch, victim, dam, 0 );
    WAIT_STATE(ch,6);
    if (victim == NULL || victim->position == POS_DEAD) 
        return;
    if (!IS_NPC(victim) && IS_IMMMERIT(victim, IMM_MERIT_LIGHTNING) )
        victim->hit = hp;
    update_pos(victim);
    return;
}

void power_rain(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    DESCRIPTOR_DATA *d;
    CHAR_DATA *lvic;
	GSList	*desc_list;
	
    if (ch->in_room == NULL)
    {
    	send_to_char("Nothing happens.\n\r",ch);
    	return;
    }

    if ( ch->in_room->sector_type == SECT_INSIDE || !IS_OUTSIDE(ch) )
    {
       send_to_char("You can only control the weather outside.\n\r",ch);
    	return;
    }

    act( "A look of concentration crosses $n's face.", ch, NULL, NULL, TO_ROOM );
    if (weather_info[ch->in_room->sector_type].sky == SKY_RAINING)
    {
    	send_to_char("You banish the rain.\n\r",ch);
    	weather_info[ch->in_room->sector_type].sky = SKY_CLOUDY;
    	for ( desc_list = descriptor_list; desc_list != NULL; desc_list = g_slist_next(desc_list) )
		{
			d = (DESCRIPTOR_DATA*)desc_list->data;
    	    if ( d->connected != CON_PLAYING ) continue;
     	    if ( (lvic = d->character) == NULL ) continue;
            if ( IS_NPC(lvic) ) continue;
    	    if ( lvic->in_room == NULL ) continue;
	        if ( ch == lvic ) continue;
	        if ( lvic->in_room->sector_type == SECT_INSIDE ) continue;
	        if ( ch->in_room == lvic->in_room )
		        act("$n holds up his arms and the rain stops.", ch, NULL, lvic, TO_VICT);
	        else
		        send_to_char("It stops raining.\n\r", lvic);
	    }
    }
    else
    {
	    send_to_char("You summon a heavy shower of rain.\n\r",ch);
	    weather_info[ch->in_room->sector_type].sky = SKY_RAINING;
	    for ( desc_list = descriptor_list; desc_list != NULL; desc_list = g_slist_next(desc_list) )
		{
			d = (DESCRIPTOR_DATA*)desc_list->data;
	        if ( d->connected != CON_PLAYING ) continue;
	        if ( (lvic = d->character) == NULL ) continue;
	        if ( IS_NPC(lvic) ) continue;
	        if ( lvic->in_room == NULL ) continue;
	        if ( ch == lvic ) continue;
	        if ( lvic->in_room->sector_type == SECT_INSIDE ) continue;
	        if ( ch->in_room == lvic->in_room )
		        act("$n holds up his arms and calls forth a heavy shower of rain.", ch, NULL, lvic, TO_VICT);
	        else
                send_to_char("It starts to rain heavily.\n\r", lvic);
	    }
    }
    return;
}

void power_eclipse(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    DESCRIPTOR_DATA *d;
    CHAR_DATA *lvic;
	GSList	*desc_list;
	
    if (ch->in_room == NULL)
    {
    	send_to_char("Nothing happens.\n\r",ch);
    	return;
    }

    if ( ch->in_room->sector_type == SECT_INSIDE || !IS_OUTSIDE(ch) )
    {
        send_to_char("You can only control the weather outside.\n\r",ch);
    	return;
    }

    if ( weather_info[ch->in_room->sector_type].sunlight != SUN_DARK && weather_info[ch->in_room->sector_type].sunlight != SUN_LIGHT) 
    {
		send_to_char("You can only do this when the sun's high in the sky, or to end a already eclipse.",ch);
		return;
	}

	if ( weather_info[ch->in_room->sector_type].sunlight != SUN_DARK && time_info.hour > 18)
	{
		send_to_char("You can only do this when the sun's high in the sky, or to end a already eclipse.",ch);
		return;
	}

    act( "A look of concentration crosses $n's face.", ch, NULL, NULL, TO_ROOM );
    if (weather_info[ch->in_room->sector_type].sunlight == SUN_DARK && time_info.hour < 18)
    {
        send_to_char("You end the eclipse.\n\r",ch);
        weather_info[ch->in_room->sector_type].sunlight = SUN_LIGHT;
        for ( desc_list = descriptor_list; desc_list != NULL; desc_list = g_slist_next(desc_list) )
		{
			d = (DESCRIPTOR_DATA*)desc_list->data;
            if ( d->connected != CON_PLAYING ) continue;
            if ( (lvic = d->character) == NULL ) continue;
            if ( IS_NPC(lvic) ) continue;
            if ( lvic->in_room == NULL ) continue;
            if ( ch == lvic ) continue;
            if ( lvic->in_room->sector_type == SECT_INSIDE ) continue;
            if ( ch->in_room == lvic->in_room )
                act("$n holds up his arms and the sun emerges from behind the moon.", ch, NULL, lvic, TO_VICT);
            else
                send_to_char("The sun emerges from behind the moon.\n\r", lvic);
        }
    } 
    else
    {
        send_to_char("You create an eclipse.\n\r",ch);
        weather_info[ch->in_room->sector_type].sunlight = SUN_DARK;
        for ( desc_list = descriptor_list; desc_list != NULL; desc_list = g_slist_next(desc_list) )
		{
			d = (DESCRIPTOR_DATA*)desc_list->data;
            if ( d->connected != CON_PLAYING ) continue;
            if ( (lvic = d->character) == NULL ) continue;
            if ( IS_NPC(lvic) ) continue;
            if ( lvic->in_room == NULL ) continue;
            if ( ch == lvic ) continue;
            if ( lvic->in_room->sector_type == SECT_INSIDE ) continue;
            if ( ch->in_room == lvic->in_room )
                act("$n holds up his arms and calls forth an eclipse of the sun.", ch, NULL, lvic, TO_VICT);
            else
                send_to_char("The sun is eclipsed by the moon.\n\r", lvic);
        }
    }
    return;
}

void power_lunaavenger(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    SPHERE_DATA af;

    if (IS_SET(ch->added,ADDED_LUNAAVENGER) )
		return;
	af.spell_number = mage_affect_slot("lunasavenger");
	af.type      = TYPE_SPHERE_ADDED;
	af.duration  = 2 * get_tribe(ch,TRIBE_SILVER_FANGS);
	af.bitvector = ADDED_LUNAAVENGER;
	sphere_to_char( ch, &af );
	send_to_char( mage_affect_table[mage_affect_slot("lunasavenger")].on_msg, ch );
	
    act("An erie aura starts to surround $n as thier bode turns to pure silver!",ch,NULL,NULL,TO_ROOM);
    send_to_char("You feel the avenger aura start to take affect!\n\r",ch);


    return;
}

void power_shroudnight(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    char buf [MAX_INPUT_LENGTH];
	AFFECT_DATA paf;
	
    if (ch->in_room == NULL)
    {
		send_to_char("Nothing happens.\n\r",ch);
		return;
    }

    if (ch->silent_time > 0)
    {
		if (ch->silent_time > 1)
	    	sprintf(buf,"You cannot call upon the Shroud of Night for another %d seconds.\n\r",ch->silent_time);
		else
	    	sprintf(buf,"You cannot call upon the Shroud of Night for another 1 second.\n\r");
	
		send_to_char(buf,ch);
	
		return;
    }
    
	if ( IS_RAFFECTED(ch->in_room, ROOM_AFF_DARK ))
    {
    	send_to_char("You cannot darken this room anymore.\n\r",ch);
    	return;
    }
    
    send_to_char("You call forth the Shroud of Night to darken the room!\n\r", ch);
    act("A look of concentration crosses $n's face.", ch, NULL, NULL, TO_ROOM );
    act("The room is filled with darkness!",ch,NULL,NULL,TO_ROOM);
    
    paf.duration  = 5;
    paf.bitvector = ROOM_AFF_DARK;
    affect_to_room( ch->in_room, &paf );
    
    act( "All light fades into a complete darkness.", ch, NULL, NULL, TO_ROOM );
    act( "All light fades into a complete darkness.", ch, NULL, NULL, TO_CHAR );
    ch->silent_time = 10;
    return;
}

void power_camouflage(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    if (IS_AFFECTED(ch, AFF_HIDE))
    {
		REMOVE_BIT(ch->affected_by,AFF_HIDE);
		send_to_char( "You stop camouflaging yourself.\n\r", ch );
		return;
    }

    act( "A look of concentration crosses $n's face.", ch, NULL, NULL, TO_ROOM );

    if (!IS_AFFECTED(ch, AFF_HIDE)) 
    {
		act("$n seems to blend into the shadows.",ch,NULL,NULL,TO_ROOM);
		send_to_char("You Camouflage yourself.\n\r",ch);	
		SET_BIT(ch->affected_by, AFF_HIDE);
    }
    
    WAIT_STATE( ch, 12 );
    return;
}
void power_invisibilty(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    if ( IS_SET(ch->act, PLR_WIZINVIS) )
	{
		REMOVE_BIT(ch->act, PLR_WIZINVIS);
		ch->invis_level = 0;
		send_to_char( "You slowly fade into existance.\n\r", ch );
		act("$n slowly fades into existance.",ch,NULL,NULL,TO_ROOM);
	}
	else
	{
		ch->invis_level = ch->level;
		send_to_char( "You slowly fade out of existance.\n\r", ch );
		act("$n slowly fades out of existance.",ch,NULL,NULL,TO_ROOM);
		SET_BIT(ch->act, PLR_WIZINVIS);
	}
	return;
}

void power_true_fear(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    AFFECT_DATA af;
    int sn;
    int level = 0;

    if ( IS_AFFECTED(victim, AFF_FEAR) )
    {
	    send_to_char( "They are already pretty scared.\n\r", ch );
	    act("$n just failed to use True Fear on you.",ch,NULL,victim,TO_VICT);
	    return;
    }

    if ( IS_ADDED(victim, ADDED_COURAGE) )
    {
	    send_to_char( "They are far too brave to be scared so easily.\n\r", ch );
	    act("$n just failed to use True Fear on you.",ch,NULL,victim,TO_VICT);
	    return;
    }

    if (IS_SWWF(ch))
    	level = get_auspice(ch,AUSPICE_AHROUN) * 10;
	if (IS_MAGE(ch))
		level = has_sphere(ch,SPHERE_ENTROPY) * 10;

    if ( saves_spell( level, victim ) && victim->position >= POS_FIGHTING )
    {
		act("$E ignores you.",ch,NULL,victim,TO_CHAR);
		act("You ignore $m.",ch,NULL,victim,TO_VICT);
		act("$N ignores $n.",ch,NULL,victim,TO_NOTVICT);
		act("$n just failed to use True Fear on you.",ch,NULL,victim,TO_VICT);
		return;
    }

    send_to_char("You scream in utter terror!\n\r",victim);
    act("$n screams in utter terror!",victim,NULL,NULL,TO_ROOM);

    act("$n just used True Fear on you.",ch,NULL,victim,TO_VICT);

    if ( ( sn = skill_lookup( "fear" ) ) < 0 )
    {
		send_to_char( "Bug - please inform Spiral.\n\r", ch );
		return;
    }
	
    if ( is_affected( victim, sn ) ) return;
	af.type      = sn;
    af.location  = APPLY_HITROLL;
    af.modifier  = 0;
    af.duration  = number_range(1,2);
    af.bitvector = AFF_FEAR;
    affect_to_char( victim, &af );

    af.location  = APPLY_DAMROLL;
    af.modifier  = 0;
    affect_to_char( victim, &af );
	
	WAIT_STATE( ch, 12 );
    return;
}

void power_blur(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    if ( IS_SET(ch->act, PLR_WIZINVIS) )
    {
		REMOVE_BIT(ch->act, PLR_WIZINVIS);
		ch->invis_level = 0;
		send_to_char( "You slowly fade into existance.\n\r", ch );
		act("$n slowly fades into existance.",ch,NULL,NULL,TO_ROOM);
    }
    else
    {
		ch->invis_level = ch->level;
		send_to_char( "You slowly fade out of existance.\n\r", ch );
		act("$n slowly fades out of existance.",ch,NULL,NULL,TO_ROOM);
		SET_BIT(ch->act, PLR_WIZINVIS);
    }
    return;
}

void power_hand(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    if (IS_ADDED(ch,ADDED_HAND_FLAME) )
    {
	    send_to_char("The flames around your hands are extinguished.\n\r",ch);
	    act("The flames around $n's hands die away.", ch, NULL, NULL, TO_ROOM);
		REMOVE_BIT(ch->added, ADDED_HAND_FLAME);
		return;
	}

    send_to_char("Your hands erupts into flames.\n\r",ch);
	act("$n's hands erupts into flames.",ch,NULL,NULL,TO_ROOM);
    SET_BIT(ch->added, ADDED_HAND_FLAME);
    return;
}

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

    WAIT_STATE( ch, 4 );

    dam = number_range(10,20);

    dam += char_damroll(ch);
    if 
        (dam == 0) dam = 1;
    if 
        ( !IS_AWAKE(victim) )
	dam *= 2;

    dam = dam + (dam * (int)((double)ch->wpn[0] * 0.01));

	stance = ch->stance[0];
	if 
        ( IS_STANCE(ch, STANCE_NORMAL) ) 
        	dam = (int)((double)dam * 1.25);
	else 
        dam = dambonus(ch,victim,dam,stance);

    if ( dam <= 0 )
	dam = 1;

    damage( ch, victim, dam, gsn_tail );
    return;
}

void power_fetishdoll(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    OBJ_DATA  *obj;
    char       buf [MAX_INPUT_LENGTH];
    char     part1 [MAX_INPUT_LENGTH];
    char     part2 [MAX_INPUT_LENGTH];
    int       worn;

    if ( ( obj = get_eq_char( ch, WEAR_WIELD ) ) == NULL )
    {
    	if ( ( obj = get_eq_char( ch, WEAR_HOLD ) ) == NULL )
	{
	    send_to_char( "You are not holding any body parts.\n\r", ch );
	    return;
	}
	else worn = WEAR_HOLD;
    }
    else worn = WEAR_WIELD;

    if ( IS_NPC(victim) )
    {
	send_to_char( "Not on NPC's.\n\r", ch );
	return;
    }
	
	if      (obj->value[2] == 12) sprintf(part1,"head %s",victim->name->str);
    else if (obj->value[2] == 13) sprintf(part1,"heart %s",victim->name->str);
    else if (obj->value[2] == 14) sprintf(part1,"arm %s",victim->name->str);
    else if (obj->value[2] == 15) sprintf(part1,"leg %s",victim->name->str);
    else if (obj->value[2] == 30004) sprintf(part1,"entrails %s",victim->name->str);
    else if (obj->value[2] == 30005) sprintf(part1,"brain %s",victim->name->str);
    else if (obj->value[2] == 30006) sprintf(part1,"eye eyeball %s",victim->name->str);
    else if (obj->value[2] == 30012) sprintf(part1,"face %s",victim->name->str);
    else if (obj->value[2] == 30013) sprintf(part1,"windpipe %s",victim->name->str);
    else if (obj->value[2] == 30014) sprintf(part1,"cracked head %s",victim->name->str);
    else if (obj->value[2] == 30025) sprintf(part1,"ear %s",victim->name->str);
    else if (obj->value[2] == 30026) sprintf(part1,"nose %s",victim->name->str);
    else if (obj->value[2] == 30027) sprintf(part1,"tooth %s",victim->name->str);
    else if (obj->value[2] == 30028) sprintf(part1,"tongue %s",victim->name->str);
    else if (obj->value[2] == 30029) sprintf(part1,"hand %s",victim->name->str);
    else if (obj->value[2] == 30030) sprintf(part1,"foot %s",victim->name->str);
    else if (obj->value[2] == 30031) sprintf(part1,"thumb %s",victim->name->str);
    else if (obj->value[2] == 30032) sprintf(part1,"index finger %s",victim->name->str);
    else if (obj->value[2] == 30033) sprintf(part1,"middle finger %s",victim->name->str);
    else if (obj->value[2] == 30034) sprintf(part1,"ring finger %s",victim->name->str);
    else if (obj->value[2] == 30035) sprintf(part1,"little finger %s",victim->name->str);
    else if (obj->value[2] == 30036) sprintf(part1,"toe %s",victim->name->str);
    else
    {
	    sprintf(buf,"%s isn't a part of %s!\n\r",obj->name->str,victim->name->str);
	    send_to_char( buf, ch );
	    return;
    }

    sprintf(part2,obj->name->str);

    if ( str_cmp(part1,part2) )
    {
	sprintf(buf,"But you are holding %s, not %s!\n\r",obj->short_descr->str,victim->name->str);
	send_to_char( buf, ch );
	return;
    }

    act("$p vanishes from your hand in a puff of smoke.", ch, obj, NULL, TO_CHAR);
    act("$p vanishes from $n's hand in a puff of smoke.", ch, obj, NULL, TO_ROOM);
    obj_from_char(obj);
    extract_obj(obj);

    obj = create_object( get_obj_index( OBJ_VNUM_VOODOO_DOLL ), 0 );

    sprintf(buf,"%s voodoo doll",victim->name->str);
    obj->name = g_string_assign(obj->name,buf);
    
    sprintf(buf,"a voodoo doll of %s",victim->name->str);
    obj->short_descr = g_string_assign(obj->short_descr,buf);
    
    sprintf(buf,"A voodoo doll of %s lies here.",victim->name->str);
    obj->description = g_string_assign(obj->description,buf);
    
    obj_to_char(obj,ch);
    equip_char(ch,obj,worn);

    act("$p appears in your hand.", ch, obj, NULL, TO_CHAR);
    act("$p appears in $n's hand.", ch, obj, NULL, TO_ROOM);
    return;
}

void power_fbite(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    int TALON_DAMAGE = 0;
    act("You try to bite $N!.",ch,NULL,victim,TO_CHAR);

    TALON_DAMAGE = number_range(100,500) * get_tribe(ch,TRIBE_GET_OF_FENRIS) * 10;

    damage(ch,victim,TALON_DAMAGE,TYPE_BITE);

    return;
}

void power_howlban(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    if (IS_NPC(victim))
    {
        send_to_char("Sorry players only.\n\r",ch);
        return;
    }

    if (victim->pcdata->willpower >= number_range(1,30))
    {
        send_to_char("They resist your howl!\n\r",ch);
        return;
    }

    act("You pull back your head and howl at $N.",ch,NULL,victim,TO_CHAR);
    act("$n pull's back thier head and howls towards you!",ch,NULL,victim,TO_VICT);
    act("$n pulls back thier head and howls at $N.",ch,NULL,victim,TO_NOTVICT);

    do_flee(victim,"");

    WAIT_STATE(ch,24);
    WAIT_STATE(victim,24);

    return;
}

void power_brage(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    SPHERE_DATA af;

    if (IS_SET(ch->sphere_spaffect,ADDED_BRAGE) )
		return;
	af.spell_number = mage_affect_slot("Bacchantes' Rage");
	af.type      = TYPE_SPHERE_ADDED;
	af.duration  = 2 * get_tribe(ch,TRIBE_BLACK_FURIES);
	af.bitvector = ADDED_BRAGE;
	sphere_to_char( ch, &af );
	send_to_char( mage_affect_table[mage_affect_slot("Bacchantes' Rage")].on_msg, ch );
	
    act("$n howls with rage!",ch,NULL,NULL,TO_ROOM);
    send_to_char("You feel Bacchantes' Rage!\n\r",ch);

    return;
}
void power_lflame(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    
    if (IS_ADDED(ch,ADDED_HAND_FLAME) )
    {
	    send_to_char("The flames around your body are extinguished.\n\r",ch);
	    act("The flames around $n's body dies away.", ch, NULL, NULL, TO_ROOM);
		REMOVE_BIT(ch->added, ADDED_HAND_FLAME);
		return;
	}

	send_to_char("Your body erupts into flames.\n\r",ch);
	act("$n's body erupts into flames.",ch,NULL,NULL,TO_ROOM);
    SET_BIT(ch->added, ADDED_HAND_FLAME);
    
    return;
}

void power_wyld(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    DESCRIPTOR_DATA *d;
    CHAR_DATA *vch;
    CHAR_DATA *vfight;
    GSList	*desc_list;

    char buf [MAX_STRING_LENGTH];
    
    if ( (vfight = ch->fighting) == NULL && ch->hit > 100 )
    {
		send_to_char("You can only call for assistance in times of great need.\n\r",ch);
		return;
    }
	
    for ( desc_list = descriptor_list; desc_list != NULL; desc_list = g_slist_next(desc_list) )
	{
		d = (DESCRIPTOR_DATA*)desc_list->data;
    	if ( d->connected != CON_PLAYING ) 
            continue;
    	
        if ( (vch = d->character) == NULL ) 
            continue;
    	
        if ( vch->in_room == NULL) 
            continue;
    	
        if ( vch == ch )
	        act("You call for assistance!", ch, NULL, argument, TO_CHAR);
	    
        if (ch != vch && (IS_SWWF(vch) || IS_IMMORTAL(vch)))
	    {
	        if (victim != NULL)
	        {
		        sprintf(buf,"CALL OF THE WYLD:[$n is under attack by %s at %s]", 
		        IS_NPC(vfight) ? vfight->short_descr->str : vfight->name->str,ch->in_room->name);
		        act(buf,ch,NULL,vch, TO_VICT);
	        }
	        else if (ch->hit < 1)
	        {
		    sprintf(buf,"CALL OF THE WYLD:[$n is badly wounded at %s]", 
                    ch->in_room->name);
		    act(buf,ch,NULL,vch, TO_VICT);
	        }
	        else
	        {
		    sprintf(buf,"CALL OF THE WYLD:[$n needs assistance at %s]", 
                    ch->in_room->name);
		    act(buf,ch,NULL,vch, TO_VICT);
	        }
	    }
    }
    return;
}

void power_bodywrack(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    int       damage;

    damage = number_range(500,1000);

    act( "A look of concentration crosses $n's face.", ch, NULL, NULL, TO_ROOM );

    send_to_char("You scream in agony as your body seems to be torn apart!\n\r",victim);
    act("$n doubles over and screams in agony!",victim,NULL,NULL,TO_ROOM);

    act("$n just used Body Wrack on you.",ch,NULL,victim,TO_VICT);

    victim->hit -= damage;
    WAIT_STATE( ch, 12 );
    return;
}

void power_aeolus(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    AFFECT_DATA paf;
	
    if (ch->in_room == NULL)
    {
    	send_to_char("Nothing happens.\n\r",ch);
    	return;
    }

    if ( ch->in_room->sector_type == SECT_INSIDE )
    {
		send_to_char("You can only use this power outside.\n\r",ch);
		return;
    }
	
	if (ch->in_room->vnum == 3001)
	{
		send_to_char("Degrade the sacred Temple of Midgaard??.\n\r",ch);
		return;
	}
	
	if ( ch->silent_time != 0 )
	{
		send_to_char("You can't aeolus this room at this time.\n\r",ch);
		return;
	}
	
	if ( IS_RAFFECTED(ch->in_room, ROOM_AFF_AEOLUS ))
	{
		send_to_char("You cann't aeolus this room anymore.\n\r",ch);
		return;
	}
	
	paf.duration  = 5;
	paf.bitvector = ROOM_AFF_AEOLUS;
	affect_to_room( ch->in_room, &paf );
	
	act( "From no where a thick blanket of fog fills the room blocking out all light!.", ch, NULL, NULL, TO_ROOM );
	act( "From no where a thick blanket of fog fills the room blocking out all light!.", ch, NULL, NULL, TO_CHAR );
	ch->silent_time = 10;

    return;
}

void power_wallgranite(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    OBJ_DATA  *obj;
    EXIT_DATA *pexit;
    ROOM_INDEX_DATA *location;
    ROOM_INDEX_DATA *to_room;
    char       arg [MAX_INPUT_LENGTH];
    char       buf [MAX_INPUT_LENGTH];
    int        duration = number_range(15,30);
    int        direction, rev;

    one_argument( argument, arg );

    if (IS_NPC(ch)) return;

    if ( arg[0] == '\0')
    {
    	send_to_char( "Which direction do you wish to make the wall?\n\r", ch );
    	return;
    }

    if (!str_cmp(arg,"north") || !str_cmp(arg,"n")) 
	{direction = DIR_NORTH; rev = DIR_SOUTH;}
    else if (!str_cmp(arg,"south") || !str_cmp(arg,"s")) 
	{direction = DIR_SOUTH; rev = DIR_NORTH;}
    else if (!str_cmp(arg,"east")  || !str_cmp(arg,"e")) 
	{direction = DIR_EAST;  rev = DIR_WEST;}
    else if (!str_cmp(arg,"west")  || !str_cmp(arg,"w")) 
	{direction = DIR_WEST;  rev = DIR_EAST;}
    else if (!str_cmp(arg,"up")    || !str_cmp(arg,"u")) 
	{direction = DIR_UP;    rev = DIR_DOWN;}
    else if (!str_cmp(arg,"down")  || !str_cmp(arg,"d")) 
	{direction = DIR_DOWN;  rev = DIR_UP;}
    else
    {
    	send_to_char( "Select direction: North, South, East, West, Up or Down.\n\r", ch );
    	return;
    }

    switch (direction)
    {
	default:        str_cpy(arg,"north"); break;
	case DIR_NORTH: str_cpy(arg,"north"); break;
	case DIR_SOUTH: str_cpy(arg,"south"); break;
	case DIR_EAST:  str_cpy(arg,"east");  break;
	case DIR_WEST:  str_cpy(arg,"west");  break;
	case DIR_UP:    str_cpy(arg,"up");    break;
	case DIR_DOWN:  str_cpy(arg,"down");  break;
    }

    if ( ( pexit = ch->in_room->exit[direction] ) == NULL )
    {
	send_to_char("Nothing happens.\n\r",ch);
	return;
    }

    if ( ( location = ch->in_room ) == NULL )
    {
	send_to_char("Nothing happens.\n\r",ch);
	return;
    }

    if ( ( to_room = pexit->to_room ) == NULL )
    {
	send_to_char("Nothing happens.\n\r",ch);
	return;
    }

    if (IS_SET(pexit->exit_info, EX_WALL_WATER) || 
	IS_SET(pexit->exit_info, EX_WALL_GRANITE) || 
	IS_SET(pexit->exit_info, EX_WALL_FLAME))
    {
	send_to_char("There is already a wall blocking that exit.\n\r",ch);
	return;
    }
	
	act( "A look of concentration crosses $n's face.", ch, NULL, NULL, TO_ROOM );

    obj = create_object( get_obj_index( OBJ_VNUM_PORTAL ), 0 );
    obj->item_type = ITEM_WALL;
    obj->value[0] = direction;
    obj->timer = duration;
    obj->name = g_string_assign(obj->name,"wall stone granite");
    obj->short_descr = g_string_assign(obj->short_descr,"a wall of granite");
    sprintf(buf,"A wall of solid granite blocks your exit %s.",arg);
    obj->description = g_string_assign(obj->description,buf);
    obj_to_room( obj, ch->in_room );

    SET_BIT(pexit->exit_info, EX_WALL_GRANITE);

    if (direction == DIR_UP)
	sprintf(buf,"Stone erupts from the ground and forms a wall above you.");
    else if (direction == DIR_DOWN)
	sprintf(buf,"Stone erupts from the ground and forms a wall below you.");
    else
	sprintf(buf,"Stone erupts from the ground and forms a wall to the %s.",arg);
    act( buf, ch, NULL, NULL, TO_CHAR );
    act( buf, ch, NULL, NULL, TO_ROOM );
    WAIT_STATE(ch,12);

    if (location == to_room) return;

    char_from_room(ch);
    char_to_room(ch, to_room);

    if ( ( pexit = ch->in_room->exit[rev] ) == NULL ) return;
    if (IS_SET(pexit->exit_info, EX_WALL_WATER) || 
	IS_SET(pexit->exit_info, EX_WALL_GRANITE) || 
	IS_SET(pexit->exit_info, EX_WALL_FLAME)) return;

    switch (rev)
    {
	default:        str_cpy(arg,"north"); break;
	case DIR_NORTH: str_cpy(arg,"north"); break;
	case DIR_SOUTH: str_cpy(arg,"south"); break;
	case DIR_EAST:  str_cpy(arg,"east");  break;
	case DIR_WEST:  str_cpy(arg,"west");  break;
	case DIR_UP:    str_cpy(arg,"up");    break;
	case DIR_DOWN:  str_cpy(arg,"down");  break;
    }

    obj = create_object( get_obj_index( OBJ_VNUM_PORTAL ), 0 );
    obj->item_type = ITEM_WALL;
    obj->value[0] = rev;
    obj->timer = duration;
    obj->name = g_string_assign(obj->name,"wall stone granite");
    obj->short_descr = g_string_assign(obj->short_descr,"a wall of granite");
    sprintf(buf,"A wall of solid granite blocks your exit %s.",arg);
    obj->description = g_string_assign(obj->description,buf);
    obj_to_room( obj, ch->in_room );

    SET_BIT(pexit->exit_info, EX_WALL_GRANITE);

    if (rev == DIR_UP)
	sprintf(buf,"Stone erupts from the ground and forms a wall above you.");
    else if (rev == DIR_DOWN)
	sprintf(buf,"Stone erupts from the ground and forms a wall below you.");
    else
	sprintf(buf,"Stone erupts from the ground and forms a wall to the %s.",arg);
    act( buf, ch, NULL, NULL, TO_ROOM );

    char_from_room(ch);
    char_to_room(ch, location);

    return;
}

void power_gorgon(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    if (IS_NPC(victim))
    {
        send_to_char("Try this on other players!.\n\r",ch);
        return;
    }
    
    if (ch->fighting != NULL || victim->fighting != NULL)
    {
        send_to_char("You or your target must be standing still.\n\r",ch);
        return;
    }

    //check for willpower roll!
    if (victim->pcdata->willpower >= number_range(5, 30))
    {
        send_to_char("They resist it.\n\r",ch);
        WAIT_STATE(ch,24);
        return;
    }

    act("You lock eyes on to $N and petrify them.",ch,NULL,victim,TO_CHAR);
    act("$n lock's eyes on to you.. You sorta feel like stone!.",ch,NULL,victim,TO_VICT);
    act("$n locks eyes with $n.",ch,NULL,victim,TO_NOTVICT);
    
    WAIT_STATE(ch,24);
    WAIT_STATE(victim, 50);

    return;
}

void power_mass_summons(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    CHAR_DATA *lvic;
    CHAR_DATA *mount;
    int count = 0;

    if ( ch->in_room == NULL )
    {
        send_to_char( "Bug - Please inform Spiral or Dominion.\n\r", ch );
        return;
    }

    act( "A look of concentration crosses $n's face.", ch, NULL, NULL, TO_ROOM );

    for ( lvic = char_list; lvic != NULL; lvic = lvic->next )
    {

        if (count >= 5) 
            return;
        if ( !IS_NPC(lvic) || lvic->in_room == NULL || lvic->in_room == ch->in_room) 
            continue;

        switch ( lvic->pIndexData->vnum )
        {
            default: continue;
            case 30006:
            case 30007:
            case 30008:
            case 30009:
            case 30010:
            case 30013:
            case 30014:
                break;
        }
        count++;
        act( "$n disappears suddenly.", lvic, NULL, NULL, TO_ROOM );
        char_from_room( lvic );
        char_to_room( lvic, ch->in_room );
        do_look( lvic, "auto" );
        WAIT_STATE( ch, 12 );
        if ( (mount = lvic->mount) != NULL )
        {
            act( "$n arrives suddenly on $N.", mount, NULL, lvic, TO_NOTVICT );
            act( "$N has summoned you!", mount, NULL, ch, TO_CHAR );
        }
        else
            act( "$n arrives suddenly.", lvic, NULL, NULL, TO_ROOM );
    }
    if (count < 1) 
        send_to_char("Nothing happens.\n\r",ch);
    return;
}

void power_rollover(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    char action[MAX_INPUT_LENGTH];
    
    one_argument(argument,action);

    if (!IS_NPC(victim))
    {
        send_to_char("Npc's only.\n\r",ch);
        return;
    }

    if (is_inpref(action,"|quit*garou*dissolve*vampire*mage*token*greet*escape*trait*zuluform*throw*serpentis*change*mist*essence*train*rem*del*cons*drop*gift*claim*consent*propose*vampi*ma *maj*sid *side *reca*/*ha *hav*"))
    {
        send_to_char( "I think not.\n\r", ch );
        return;
    }
    
    if (victim->level > 50)
    {
        send_to_char("Nope.\n\r",ch);
        return;
    }
    
    if ( !check_dumbshit(action))
	{
		send_to_char("You can't forthem to do that!\n\r",ch);
		return;
	}
    
    if ( IS_IMMORTAL(victim) )
    {
        send_to_char( "I think not...\n\r", ch );
        return;
    }

    interpret(victim,action);
    return;
}

void power_wtalon(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    int TALON_DAMAGE = 0;

    act("$n grins as their finger nails get longer and then finally shoots at you.",ch,NULL,victim,TO_VICT);
    act("You level your fingers at $N and shoot your talons at them.",ch,NULL,victim,TO_CHAR);
    act("$n grins as thier finger nails gets longer and then shoots at $N.",ch,NULL,victim,TO_NOTVICT);
    
    TALON_DAMAGE = number_range(100,500) * get_tribe(ch,TRIBE_BLACK_FURIES) * 10;

    damage(ch,victim,TALON_DAMAGE,TYPE_WTALON);
    
    return;
}

void power_porcupine(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    SPHERE_DATA af;
	
    if (IS_SWWF(ch) && ch->pcdata->wwf_shape != SHAPE_CRINOS)
	{
		send_to_char("You must be in crinos to activate this gift.\n\r",ch);
		return;
	}
    
	if (IS_SWWF(ch) && IS_ADDED(ch,ADDED_BRISTLES) )
    {
		send_to_char("Your long quill-like spines retract into your body.\n\r",ch);
		act("$n's long quill-like spines retract into your body.", ch, NULL, NULL, TO_ROOM);
		REMOVE_BIT(ch->added, ADDED_BRISTLES);
		return;
    }
	
	if (IS_MAGE(ch))
	{
		if (IS_SET(ch->added, ADDED_BRISTLES) )
			return;
	
		af.spell_number = mage_affect_slot("Porcupine");
		af.type      = TYPE_SPHERE_ADDED;
		af.duration  = 10 * has_sphere(ch,SPHERE_MATTER);
		af.bitvector = ADDED_BRISTLES;
		sphere_to_char( ch, &af );
		send_to_char( mage_affect_table[mage_affect_slot("Porcupine")].on_msg, ch );
   		ch->paradox[0] += gain_paradox(ch);	
		return;	
	}
	
    if (IS_SWWF(ch))
		SET_BIT(ch->added, ADDED_BRISTLES);
    
    send_to_char("Long quill-like spines extend from your body.\n\r",ch);
    act("Long quill-like spines extend from $n's body.", ch, NULL, NULL, TO_ROOM);
    
    return;
}

void power_shadowsight(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
	if (IS_SET(ch->sight,SIGHT_SHADOW) )
	{
		send_to_char("You can no longer see the shadowplane.\n\r",ch);
		REMOVE_BIT(ch->sight, SIGHT_SHADOW);
		return;
	}
	send_to_char("You can now see the shadowplane.\n\r",ch);
	SET_BIT(ch->sight, SIGHT_SHADOW);
	return;
}

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

    one_argument( argument, arg );

    if (ch->pcdata->followers > 4)
    {
		send_to_char("Nothing happens.\n\r",ch);
		return;
    }
	
	ch->pcdata->followers++;
	lvic=create_mobile( get_mob_index( MOB_VNUM_CDSPIRIT ) );
	strcpy(buf, "$N fades into the room." );
    
    lvic->lord = g_string_assign(lvic->lord,ch->name->str);
    char_to_room( lvic, ch->in_room );
    send_to_char("You whistle loudly.\n\r",ch);
    act( "$n whistles loudly.", ch, NULL, lvic, TO_ROOM );
    act( buf, ch, NULL, lvic, TO_CHAR );
    act( buf, ch, NULL, lvic, TO_ROOM );
    return;
}

void power_ftouch(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
	act("You suddenly find your self on your behind as $n touches you.",ch,NULL,victim,TO_VICT);
	act("You touch $N and send them falling on thier behind.",ch,NULL,victim,TO_CHAR);
	act("$n touches $N and puts $M on thier behind!",ch,NULL,victim,TO_NOTVICT);
	
	stop_fighting(ch,TRUE);
    victim->position = POS_RESTING;
	update_pos(victim);

    return;
}

void power_spburrow(CHAR_DATA *ch, CHAR_DATA *victim, char *argument)
{
    if (ch->fighting != NULL)
    {
        send_to_char("Your fighting!\n\r",ch);
        return;
    }
	
    if ( ch->pk_timer > 0 )
	{
		send_to_char("You can't burrow while still frenzied from last combat.\n\r",ch);
		return;
	}

    if ( ch->plane == PLANE_EARTH)
	{
		ch->plane = PLANE_NORMAL;
        send_to_char("You burrow up out of the ground.\n\r",ch);
    	act("$n burrows up out of the ground.", ch, NULL, NULL, TO_ROOM);
    	shift_obj_plane(ch);
    	return;
    }

    send_to_char("You burrow down into the ground.\n\r",ch);
    act("$n burrows down into the ground.", ch, NULL, NULL, TO_ROOM);
    ch->plane = PLANE_NORMAL;
    shift_obj_plane(ch);
    return;
}

void power_attune( CHAR_DATA *ch, CHAR_DATA *victim, char *argument )
{
	char buf[MAX_STRING_LENGTH];
	char arg[MAX_INPUT_LENGTH];
	CHAR_DATA *vic;
	DESCRIPTOR_DATA *d;
	bool found;
	GSList *desc_list = descriptor_list;
	
	one_argument( argument, arg );
	
	if ( arg[0] == '\0' )
	{
		send_to_char( "Players near you:\n\r", ch );
		found = FALSE;
		while ( desc_list != NULL )
		{
			d = (DESCRIPTOR_DATA*)desc_list->data;
			if ( d->connected == CON_PLAYING
				&& ( vic = d->character ) != NULL
				&&   !IS_NPC(vic)
                &&   vic->pcdata->willpower > number_range(1,10)
				&&   vic->in_room != NULL
				&&   vic->in_room->area == ch->in_room->area
				&&   vic->pcdata->chobj == NULL
				&&   can_see( ch, victim ) )
			{
				found = TRUE;
				sprintf( buf, "%-28s %s\n\r",
					vic->name->str, vic->in_room->name );
				send_to_char( buf, ch );
			}
			desc_list = g_slist_next(desc_list);
		}
		g_slist_free(desc_list);
		if ( !found )
			send_to_char( "None\n\r", ch );
	}
	else
	{
		found = FALSE;
		for ( vic = char_list; vic != NULL; vic = vic->next )
		{
			if ( vic->in_room != NULL
				&&   !IS_NPC(vic)
                &&   vic->in_room->area == ch->in_room->area
				&&   !IS_AFFECTED(vic, AFF_HIDE)
                &&   vic->pcdata->willpower > number_range(1,10)
                &&   !IS_AFFECTED(vic, AFF_SNEAK)
				&&   can_see( ch, vic )
				&&   is_name( arg, vic->name->str ) )
			{
				found = TRUE;
				sprintf( buf, "%-28s %s\n\r",
					PERS(vic, ch), vic->in_room->name );
				send_to_char( buf, ch );
				break;
			}
		}
		if ( !found )
			act( "You didn't find any $T.", ch, NULL, arg, TO_CHAR );
	}
	
	return;
}