mage.c

src/mage.c · 196.5 KB

From the archive cotn-4.0.tar.gz

Download the archive   « Back to the archive contents

/***************************************************************************
 *  Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer,        *
 *  Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe.   *
 *                                                                         *
 *  Merc Diku Mud improvments copyright (C) 1992, 1993 by Michael          *
 *  Chastain, Michael Quan, and Mitchell Tse.                              *
 *                                                                         *
 *  In order to use any part of this 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.                                               *
 *                                                                         *
 *  Dystopia Mud improvements copyright (C) 2000, 2001 by Brian Graversen  *
 *                                                                         *
 *  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.                                                  *
 ***************************************************************************/
 /***************************************************************************
 *                                 _/                            _/        *
 *      _/_/_/  _/_/      _/_/_/  _/    _/_/    _/    _/    _/_/_/         *
 *     _/    _/    _/  _/        _/  _/    _/  _/    _/  _/    _/          *
 *    _/    _/    _/  _/        _/  _/    _/  _/    _/  _/    _/           *
 *   _/    _/    _/    _/_/_/  _/    _/_/      _/_/_/    _/_/_/            *
 ***************************************************************************
 * Mindcloud Copyright 2001-2003 by Jeff Boschee (Zarius),                 *
 * Additional credits are in the help file CODECREDITS                     *
 * All Rights Reserved.                                                    *
 ***************************************************************************/

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

void do_reveal(CHAR_DATA * ch, char *argument)
{
        CHAR_DATA *ich;

        if (IS_NPC(ch))
                return;
        if (!IS_CLASS(ch, CLASS_MAGE))
        {
                send_to_char("Huh?!?.\n\r", ch);
                return;
        }
        if (ch->mana < 5000)
        {
                send_to_char
                        ("You don't have the mystical energies to do this.\n\r",
                         ch);
                return;
        }
        act("$n mumles a few words, and you are suddenly blinded by a flash.",
            ch, NULL, NULL, TO_ROOM);
        send_to_char("You reveal everything hidden in the room.\n\r", ch);
        for (ich = ch->in_room->people; ich != NULL; ich = ich->next_in_room)
        {
                if (ich == ch || ich->trust > 6)
                        continue;
                affect_strip(ich, gsn_invis);
                affect_strip(ich, gsn_mass_invis);
                affect_strip(ich, gsn_sneak);
                if (IS_SET(ich->affected_by, AFF_HIDE))
                        REMOVE_BIT(ich->affected_by, AFF_HIDE);
                if (IS_SET(ich->affected_by, AFF_INVISIBLE))
                        REMOVE_BIT(ich->affected_by, AFF_INVISIBLE);
                if (IS_SET(ich->affected_by, AFF_SNEAK))
                        REMOVE_BIT(ich->affected_by, AFF_SNEAK);
                if (IS_SET(ich->act, PLR_WIZINVIS))
                        REMOVE_BIT(ich->act, PLR_WIZINVIS);
                if (IS_SET(ich->act, AFF_HIDE))
                        REMOVE_BIT(ich->act, AFF_HIDE);
                if (IS_SET(ich->affected_by, AFF_SHIFT))
                        REMOVE_BIT(ich->affected_by, AFF_SHIFT);
                if (IS_SET(ich->extra, EXTRA_EARTHMELD))
                        REMOVE_BIT(ich->extra, EXTRA_EARTHMELD);
                if (IS_AFFECTED(ch, AFF_SHADOWPLANE))
                        REMOVE_BIT(ch->affected_by, AFF_SHADOWPLANE);
                if (IS_AFFECTED(ch, AFF_PEACE))
                        REMOVE_BIT(ch->affected_by, AFF_PEACE);
                if (IS_AFFECTED(ch, AFF_ETHEREAL))
                        REMOVE_BIT(ch->affected_by, AFF_ETHEREAL);

                if (IS_CLASS(ich, CLASS_DROW)
                    && IS_SET(ich->newbits, NEW_DARKNESS))
                {
                        REMOVE_BIT(ich->newbits, NEW_DARKNESS);
                        REMOVE_BIT(ich->in_room->room_flags,
                                   ROOM_TOTAL_DARKNESS);
                }
                send_to_char("You are suddenly very visible.\n\r", ich);
        }
        ch->mana -= 5000;
        return;
}

void do_magearmor(CHAR_DATA * ch, char *argument)
{
        OBJ_INDEX_DATA *pObjIndex;
        OBJ_DATA *obj;
        char      arg[MAX_INPUT_LENGTH];
        int       vnum = 0;

        argument = one_argument(argument, arg);
        if (IS_NPC(ch))
                return;
        if (!IS_IMMORTAL(ch))
        {
                if (!IS_CLASS(ch, CLASS_MAGE))
                {
                        send_to_char("What?\n\r", ch);
                        return;
                }
        }
        if (arg[0] == '\0')
        {
                send_to_char
                        ("Please specify which piece of mage armor you wish to make: Dagger Staff\n\r"
                         "Ring Collar Robe Cap Leggings Boots Gloves Sleeves Cape Belt Bracer Mask.\n\r",
                         ch);
                return;
        }
        if (ch->practice < 100)
        {
                send_to_char
                        ("It costs 100 points of primal to create mage equipment.\n\r",
                         ch);
                return;
        }
        if (!str_cmp(arg, "mask"))
                vnum = 33013;
        else if (!str_cmp(arg, "belt"))
                vnum = 33011;
        else if (!str_cmp(arg, "cape"))
                vnum = 33010;
        else if (!str_cmp(arg, "ring"))
                vnum = 33002;
        else if (!str_cmp(arg, "collar"))
                vnum = 33003;
        else if (!str_cmp(arg, "robe"))
                vnum = 33004;
        else if (!str_cmp(arg, "cap"))
                vnum = 33005;
        else if (!str_cmp(arg, "leggings"))
                vnum = 33006;
        else if (!str_cmp(arg, "boots"))
                vnum = 33007;
        else if (!str_cmp(arg, "gloves"))
                vnum = 33008;
        else if (!str_cmp(arg, "sleeves"))
                vnum = 33009;
        else if (!str_cmp(arg, "bracer"))
                vnum = 33012;
        else if (!str_cmp(arg, "staff"))
                vnum = 33000;
        else if (!str_cmp(arg, "dagger"))
                vnum = 33001;
        else
        {
                do_magearmor(ch, "");
                return;
        }
        if (vnum == 0 || (pObjIndex = get_obj_index(vnum)) == NULL)
        {
                send_to_char("Missing object, please inform a God.\n\r", ch);
                return;
        }
        obj = create_object(pObjIndex, 50);
        obj->questowner = str_dup(ch->pcdata->switchname);
        obj->ownerid = ch->pcdata->playerid;
        obj_to_char(obj, ch);
        ch->practice -= 100;
        act("$p appears in your hands.", ch, obj, NULL, TO_CHAR);
        act("$p appears in $n's hands.", ch, obj, NULL, TO_ROOM);
        return;
}

void do_chaosmagic(CHAR_DATA * ch, char *argument)
{
        char      arg[MAX_STRING_LENGTH];
        CHAR_DATA *victim;
        int       sn, randnum, level;

        argument = one_argument(argument, arg);
        level = ch->spl[RED_MAGIC] / 4;

        if (IS_NPC(ch))
                return;
        if (!IS_CLASS(ch, CLASS_MAGE) && !IS_CLASS(ch, CLASS_LICH))
        {
                send_to_char("Huh?\n\r", ch);
                return;
        }
        if (IS_CLASS(ch, CLASS_LICH) && ch->pcdata->powers[CHAOS_MAGIC] < 1)
        {
                send_to_char("Not yet, not yet.\n\r", ch);
                return;
        }
        if (ch->mana < 1500)
        {
                send_to_char("You need more mana.\n\r", ch);
                return;
        }
        if (ch->in_room != NULL)
        {
                if (IS_SET(ch->in_room->room_flags, ROOM_SAFE))
                {
                        send_to_char
                                ("You cannot invoke the forces of chaos in a safe room.\n\r",
                                 ch);
                        return;
                }
        }
        if (arg[0] == '\0' && ch->fighting != NULL)
                victim = ch->fighting;
        else if ((victim = get_char_room(ch, NULL, arg)) == NULL)
        {
                send_to_char("They are not here.\n\r", ch);
                return;
        }
        randnum = number_range(1, 12);
        if (randnum == 1)
                sn = skill_lookup("spirit kiss");
        else if (randnum == 2)
                sn = skill_lookup("desanct");
        else if (randnum == 3)
                sn = skill_lookup("imp heal");
        else if (randnum == 4)
                sn = skill_lookup("imp fireball");
        else if (randnum == 5)
                sn = skill_lookup("imp faerie fire");
        else if (randnum == 6)
                sn = skill_lookup("imp teleport");
        else if (randnum == 7)
                sn = skill_lookup("change sex");
        else if (randnum == 8)
                sn = skill_lookup("shield");
        else if (randnum == 9)
                sn = skill_lookup("readaura");
        else if (randnum == 10)
                sn = skill_lookup("earthquake");
        else if (randnum == 11)
                sn = skill_lookup("gate");
        else if (randnum == 12)
                sn = skill_lookup("dispel magic");
        else
                sn = 0;
        if (sn > 0)
                (*skill_table[sn].spell_fun) (sn, level, ch, victim);
        ch->mana -= 1500;
        WAIT_STATE(ch, 6);
        return;
}

/* Syntax : chant <type> <color> <target>
 * ex. chant bless red self 
 */
void do_chant(CHAR_DATA * ch, char *argument)
{
        char      arg1[MAX_STRING_LENGTH];
        char      arg2[MAX_STRING_LENGTH];
        char      buf1[MAX_STRING_LENGTH];
        char      buf2[MAX_STRING_LENGTH];
        char      buf3[MAX_STRING_LENGTH];
        CHAR_DATA *victim;
        AFFECT_DATA af;
        int       i = 0, dam = 0, count = 0, sn = 0;
        int       red_magic = ch->spl[RED_MAGIC];
        int       blue_magic = ch->spl[BLUE_MAGIC];
        int       green_magic = ch->spl[GREEN_MAGIC];
        int       purple_magic = ch->spl[PURPLE_MAGIC];
        int       yellow_magic = ch->spl[YELLOW_MAGIC];
        int       magic_power =
                ch->spl[RED_MAGIC] + ch->spl[BLUE_MAGIC] +
                ch->spl[GREEN_MAGIC] + ch->spl[PURPLE_MAGIC] +
                ch->spl[YELLOW_MAGIC];

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

        if (IS_NPC(ch))
                return;
        if (!IS_CLASS(ch, CLASS_MAGE) && !IS_CLASS(ch, CLASS_LICH))
        {
                send_to_char("Huh?\n\r", ch);
                return;
        }
        if (arg1[0] == '\0')
        {
                send_to_char
                        ("Syntax : chant <bless/curse/damage/heal> <target>.\n\r",
                         ch);
                return;
        }
        if (IS_ITEMAFF(ch, ITEMA_AFFENTROPY))
        {
                magic_power += 100;
                red_magic += 20;
                yellow_magic += 20;
                purple_magic += 20;
                green_magic += 20;
                blue_magic += 20;
        }
        if (!str_cmp(arg1, "heal"))
        {
                if (arg2[0] == '\0')
                        victim = ch;
                else if ((victim = get_char_room(ch, NULL, arg2)) == NULL)
                {
                        send_to_char("They are not here.\n\r", ch);
                        return;
                }
                if (ch->mana < 4500)
                {
                        send_to_char("You need 4500 mana.\n\r", ch);
                        return;
                }
                act("$n channels lifeforce from the five elements into $N.",
                    ch, NULL, victim, TO_NOTVICT);
                act("You channel lifeforce from the five elements into $N.",
                    ch, NULL, victim, TO_CHAR);
                act("$n channels lifeforce from the five elements into you.",
                    ch, NULL, victim, TO_VICT);
                WAIT_STATE(ch, 8);
                ch->mana -= 4500;
                victim->hit =
                        UMIN(victim->hit + (magic_power * 1.5),
                             victim->max_hit);
                return;
        }
        else if (!str_cmp(arg1, "damage"))
        {
                if (arg2[0] == '\0' && ch->fighting != NULL)
                        victim = ch->fighting;
                else if ((victim = get_char_room(ch, NULL, arg2)) == NULL)
                {
                        send_to_char("They are not here.\n\r", ch);
                        return;
                }
                if (ch->mana < 5000)
                {
                        send_to_char("You need 5000 mana.\n\r", ch);
                        return;
                }
                if (victim == ch)
                {
                        send_to_char
                                ("You really don't want to hurt yourself.\n\r",
                                 ch);
                        return;
                }
                if (is_safe(ch, victim))
                        return;
                if (victim->position == POS_DEAD
                    || ch->in_room != victim->in_room)
                        return;
                if (IS_AFFECTED(ch, AFF_PEACE))
                        REMOVE_BIT(ch->affected_by, AFF_PEACE);
                if (victim->position > POS_STUNNED)
                {
                        if (ch->fighting == NULL)
                                set_fighting(ch, victim, TRUE);
                        if (victim->fighting == NULL)
                                set_fighting(victim, ch, FALSE);
                }
                WAIT_STATE(ch, 8);
                ch->mana -= 5000;
                dam = number_range(red_magic * 4, red_magic * 5);
                dam += char_damroll(ch);
                dam = cap_dam(ch, victim, dam);
                if (!IS_NPC(victim))
                {
//      if (IS_CLASS(ch, CLASS_MAGE) && dam > 600) dam = number_range(580,620);
                        if (dam > 1000)
                                dam = number_range(950, 1050);
                }
                xprintf(buf1,
                        "$n calls for the forces of #Rhell#n to destroy $N [#C%d#n]",
                        dam);
                xprintf(buf2,
                        "You call for the forces of #Rhell#n to destroy $N [#C%d#n]",
                        dam);
                xprintf(buf3,
                        "$n calls for the forces of #Rhell#n to destroy you [#C%d#n]",
                        dam);
                act(buf1, ch, NULL, victim, TO_NOTVICT);
                act(buf2, ch, NULL, victim, TO_CHAR);
                act(buf3, ch, NULL, victim, TO_VICT);
                hurt_person(ch, victim, dam);
                if (victim->position == POS_DEAD
                    || ch->in_room != victim->in_room)
                        return;
                dam = number_range(blue_magic * 4, blue_magic * 5);
                dam += char_damroll(ch);
                dam = cap_dam(ch, victim, dam);
                if (!IS_NPC(victim))
                {
//      if (IS_CLASS(ch, CLASS_MAGE) && dam > 600) dam = number_range(580,620);
                        if (dam > 1000)
                                dam = number_range(950, 1050);
                }
                xprintf(buf1,
                        "$n summons a supernatural #Bstorm#n to strike $N with lightning [#C%d#n]",
                        dam);
                xprintf(buf2,
                        "You summon a supernatural #Bstorm#n to strike $N with lightning [#C%d#n]",
                        dam);
                xprintf(buf3,
                        "$n summons a supernatural #Bstorm#n to strike you with lightning [#C%d#n]",
                        dam);
                act(buf1, ch, NULL, victim, TO_NOTVICT);
                act(buf2, ch, NULL, victim, TO_CHAR);
                act(buf3, ch, NULL, victim, TO_VICT);
                hurt_person(ch, victim, dam);
                if (victim->position == POS_DEAD
                    || ch->in_room != victim->in_room)
                        return;
                dam = number_range(green_magic * 4, green_magic * 5);
                dam += char_damroll(ch);
                dam = cap_dam(ch, victim, dam);
                if (!IS_NPC(victim))
                {
//      if (IS_CLASS(ch, CLASS_MAGE) && dam > 600) dam = number_range(580,620);
                        if (dam > 1000)
                                dam = number_range(950, 1050);
                }
                xprintf(buf1,
                        "$n calls for #Gthorns#n to grow from the earth and pierce $N [#C%d#n]",
                        dam);
                xprintf(buf2,
                        "You call for #Gthorns#n to grow from the earth and pierce $N [#C%d#n]",
                        dam);
                xprintf(buf3,
                        "$n calls for #Gthorns#n to grow from the earth and pierce You [#C%d#n]",
                        dam);
                act(buf1, ch, NULL, victim, TO_NOTVICT);
                act(buf2, ch, NULL, victim, TO_CHAR);
                act(buf3, ch, NULL, victim, TO_VICT);
                hurt_person(ch, victim, dam);
                if (victim->position == POS_DEAD
                    || ch->in_room != victim->in_room)
                        return;
                dam = number_range(purple_magic * 4, purple_magic * 5);
                dam += char_damroll(ch);
                dam = cap_dam(ch, victim, dam);
                if (!IS_NPC(victim))
                {
//      if (IS_CLASS(ch, CLASS_MAGE) && dam > 600) dam = number_range(580,620);
                        if (dam > 1000)
                                dam = number_range(950, 1050);
                }
                xprintf(buf1,
                        "$n calls on the powers of the #punderdark#n to shatter $N's bones [#C%d#n]",
                        dam);
                xprintf(buf2,
                        "You call on the powers of the #punderdark#n to shatter $N's bones [#C%d#n]",
                        dam);
                xprintf(buf3,
                        "$n calls on the powers of the #punderdark#n to shatter your bones [#C%d#n]",
                        dam);
                act(buf1, ch, NULL, victim, TO_NOTVICT);
                act(buf2, ch, NULL, victim, TO_CHAR);
                act(buf3, ch, NULL, victim, TO_VICT);
                hurt_person(ch, victim, dam);
                if (victim->position == POS_DEAD
                    || ch->in_room != victim->in_room)
                        return;
                dam = number_range(yellow_magic * 4, yellow_magic * 5);
                dam += char_damroll(ch);
                dam = cap_dam(ch, victim, dam);
                if (!IS_NPC(victim))
                {
//      if (IS_CLASS(ch, CLASS_MAGE) && dam > 600) dam = number_range(580,620);
                        if (dam > 1000)
                                dam = number_range(950, 1050);
                }
                xprintf(buf1,
                        "$n spews forth a shower of #Yacid#n striking $N [#C%d#n]",
                        dam);
                xprintf(buf2,
                        "you spew forth a shower of #Yacid#n striking $N [#C%d#n]",
                        dam);
                xprintf(buf3,
                        "$n spews forth a shower of #Yacid#n striking you [#C%d#n]",
                        dam);
                act(buf1, ch, NULL, victim, TO_NOTVICT);
                act(buf2, ch, NULL, victim, TO_CHAR);
                act(buf3, ch, NULL, victim, TO_VICT);
                hurt_person(ch, victim, dam);
                return;
        }
        else if (!str_cmp(arg1, "bless"))
        {
                if ((victim = get_char_room(ch, NULL, arg2)) == NULL)
                {
                        send_to_char("They are not here.\n\r", ch);
                        return;
                }
                if (ch->mana < 5500)
                {
                        send_to_char("You need 5500 mana.\n\r", ch);
                        return;
                }
                if (victim->position == POS_DEAD
                    || ch->in_room != victim->in_room)
                        return;
                count = 0;
                for (i = 0; i < 5; i++)
                {
                        if (i == 0)
                        {
                                sn = skill_lookup("purple sorcery");
                                dam = purple_magic;
                        }
                        if (i == 1)
                        {
                                sn = skill_lookup("yellow sorcery");
                                dam = yellow_magic;
                        }
                        if (i == 2)
                        {
                                sn = skill_lookup("green sorcery");
                                dam = green_magic;
                        }
                        if (i == 3)
                        {
                                sn = skill_lookup("red sorcery");
                                dam = red_magic;
                        }
                        if (i == 4)
                        {
                                sn = skill_lookup("blue sorcery");
                                dam = blue_magic;
                        }
                        if (is_affected(victim, sn))
                                continue;

                        count++;

                        af.type = sn;
                        af.duration = dam / 4;
                        af.location = APPLY_HIT;
                        af.modifier = dam * 2;
                        af.bitvector = 0;
                        affect_to_char(victim, &af);
                        af.type = sn;
                        af.duration = dam / 4;
                        af.location = APPLY_AC;
                        af.modifier = -dam / 2;
                        af.bitvector = 0;
                        affect_to_char(victim, &af);
                        af.type = sn;
                        af.duration = dam / 4;
                        af.location = APPLY_MOVE;
                        af.modifier = dam * 2;
                        af.bitvector = 0;
                        affect_to_char(victim, &af);
                        af.type = sn;
                        af.duration = dam / 4;
                        af.location = APPLY_MANA;
                        af.modifier = dam * 2;
                        af.bitvector = 0;
                        affect_to_char(victim, &af);
                        af.type = sn;
                        af.duration = dam / 4;
                        af.location = APPLY_HITROLL;
                        af.modifier = dam / 3;
                        af.bitvector = 0;
                        affect_to_char(victim, &af);
                        af.type = sn;
                        af.duration = dam / 4;
                        af.location = APPLY_DAMROLL;
                        af.modifier = dam / 3;
                        af.bitvector = 0;
                        affect_to_char(victim, &af);
                }
                ch->mana -= count * 1100;
                WAIT_STATE(ch, 6);
                xprintf(buf1, "You bless $N with the power of the elements.");
                xprintf(buf2,
                        "The power of the five elements fills your body.");
                act(buf1, ch, NULL, victim, TO_CHAR);
                act(buf2, ch, NULL, victim, TO_VICT);
                return;
        }
        else if (!str_cmp(arg1, "curse"))
        {
                if ((victim = get_char_room(ch, NULL, arg2)) == NULL)
                {
                        send_to_char("They are not here.\n\r", ch);
                        return;
                }
                if (ch->mana < 4500)
                {
                        send_to_char("You need 4500 mana.\n\r", ch);
                        return;
                }
                if (victim->level < 3)
                {
                        send_to_char
                                ("Not on mortal, thier bodies cant handles the strain....poor little buggers.\n\r",
                                 ch);
                        return;
                }
                if (victim->position == POS_DEAD
                    || ch->in_room != victim->in_room)
                        return;
                count = 0;
                for (i = 0; i < 5; i++)
                {
                        if (i == 0)
                        {
                                sn = skill_lookup("purple sorcery");
                                dam = purple_magic;
                        }
                        if (i == 1)
                        {
                                sn = skill_lookup("yellow sorcery");
                                dam = yellow_magic;
                        }
                        if (i == 2)
                        {
                                sn = skill_lookup("green sorcery");
                                dam = green_magic;
                        }
                        if (i == 3)
                        {
                                sn = skill_lookup("red sorcery");
                                dam = red_magic;
                        }
                        if (i == 4)
                        {
                                sn = skill_lookup("blue sorcery");
                                dam = blue_magic;
                        }
                        if (is_affected(victim, sn))
                                continue;

                        count++;

                        af.type = sn;
                        af.duration = dam / 4;
                        af.location = APPLY_HIT;
                        af.modifier = -dam * 2;
                        af.bitvector = 0;
                        affect_to_char(victim, &af);
                        af.type = sn;
                        af.duration = dam / 4;
                        af.location = APPLY_AC;
                        af.modifier = dam / 2;
                        af.bitvector = 0;
                        affect_to_char(victim, &af);
                        af.type = sn;
                        af.duration = dam / 4;
                        af.location = APPLY_MOVE;
                        af.modifier = -dam * 2;
                        af.bitvector = 0;
                        affect_to_char(victim, &af);
                        af.type = sn;
                        af.duration = dam / 4;
                        af.location = APPLY_MANA;
                        af.modifier = -dam * 2;
                        af.bitvector = 0;
                        affect_to_char(victim, &af);
                        af.type = sn;
                        af.duration = dam / 4;
                        af.location = APPLY_HITROLL;
                        af.modifier = -dam / 3;
                        af.bitvector = 0;
                        affect_to_char(victim, &af);
                        af.type = sn;
                        af.duration = dam / 4;
                        af.location = APPLY_DAMROLL;
                        af.modifier = -dam / 3;
                        af.bitvector = 0;
                        affect_to_char(victim, &af);
                }
                ch->mana -= count * 900;
                WAIT_STATE(ch, 6);
                xprintf(buf1, "You curse $N with the power of the elements.");
                xprintf(buf2,
                        "The power of the five elements wrecks your body.");
                act(buf1, ch, NULL, victim, TO_CHAR);
                act(buf2, ch, NULL, victim, TO_VICT);
                return;
        }
        send_to_char("Syntax : chant <bless/curse/damage/heal> <target>.\n\r",
                     ch);
        return;
}

/* Syntax : invoke <list/learn/spell> <none/power/power>
 * ex. invoke learn stoneskin
 * ex. invoke spell stoneskin
 */
void do_invoke(CHAR_DATA * ch, char *argument)
{
        char      arg1[MAX_STRING_LENGTH];
        char      arg2[MAX_STRING_LENGTH];
        char      buf[MAX_STRING_LENGTH];
        int       shieldcost = 25;
        int       steelshieldcost = 5;
        int       beastcost = 10;
        int       illusioncost = 5;
        int       defshieldcost = 5;

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

        if (IS_NPC(ch))
                return;
        if (!IS_CLASS(ch, CLASS_MAGE))
        {
                send_to_char("Huh?\n\r", ch);
                return;
        }
        if (arg1[0] == '\0')
        {
                if (ch->pcdata->powers[PINVOKE] > 0)
                        send_to_char
                                ("* You have the power to teleport yourself anywhere.\n\r",
                                 ch);
                if (ch->pcdata->powers[PINVOKE] > 1)
                        send_to_char
                                ("* You know how to invoke mageshields.\n\r",
                                 ch);
                if (ch->pcdata->powers[PINVOKE] > 2)
                        send_to_char
                                ("* You have the power to scry on far away places.\n\r",
                                 ch);
                if (ch->pcdata->powers[PINVOKE] > 3)
                        send_to_char
                                ("* You can discharge your shields in a shower of power.\n\r",
                                 ch);
                if (ch->pcdata->powers[PINVOKE] > 4)
                        send_to_char
                                ("* A deflector shield defends you in combat.\n\r",
                                 ch);
                if (ch->pcdata->powers[PINVOKE] > 5)
                        send_to_char
                                ("* You have the power to turn your skin into solid steel.\n\r",
                                 ch);
                if (ch->pcdata->powers[PINVOKE] > 7)
                        send_to_char
                                ("* You have mastered the power of illusions.\n\r",
                                 ch);
                if (ch->pcdata->powers[PINVOKE] > 8)
                        send_to_char
                                ("* You can invoke the power of the beast.\n\r",
                                 ch);
                if (ch->pcdata->powers[PINVOKE] > 6
                    && ch->pcdata->powers[PINVOKE] < 10)
                        send_to_char
                                ("* You have a deeper understanding of magic.\n\r",
                                 ch);
                if (ch->pcdata->powers[PINVOKE] > 9)
                        send_to_char
                                ("* You have mastered the art of magic.\n\r",
                                 ch);
                xprintf(buf, "invokes Learned (%d).\n\r",
                        ch->pcdata->powers[PINVOKE]);
                send_to_char(buf, ch);
                return;
        }
        if (!str_cmp(arg1, "learn"))
        {
                int       cost = (ch->pcdata->powers[PINVOKE] + 1) * 20;

                if (ch->pcdata->powers[PINVOKE] >= 10)
                {
                        send_to_char
                                ("You have already gained all the known invokes.\n\r",
                                 ch);
                        return;
                }
                else if (cost > ch->practice)
                {
                        send_to_char("you don't have enough primal.\n\r", ch);
                        return;
                }
                else
                {
                        ch->pcdata->powers[PINVOKE] += 1;
                        ch->practice -= cost;
                        send_to_char
                                ("You gain a deeper understanding of the mystical powers.\n\r",
                                 ch);
                }
                return;
        }
        else if (!str_cmp(arg1, "steelshield"))
        {
                if (ch->pcdata->powers[PINVOKE] < 6)
                {
                        send_to_char("You don't have that invoke yet.\n\r",
                                     ch);
                        return;
                }
                if (!IS_ITEMAFF(ch, ITEMA_STEELSHIELD)
                    && ch->practice >= steelshieldcost)
                {
                        SET_BIT(ch->itemaffect, ITEMA_STEELSHIELD);
                        ch->practice -= steelshieldcost;
                        send_to_char("Your skin turns to solid steel.\n\r",
                                     ch);
                        return;
                }
                else if (IS_ITEMAFF(ch, ITEMA_STEELSHIELD))
                {
                        send_to_char
                                ("Your skin cannot become any harder.\n\r",
                                 ch);
                        return;
                }
                else
                {
                        send_to_char
                                ("it costs 5 primal to activate steelskin.\n\r",
                                 ch);
                        return;
                }
        }
        else if (!str_cmp(arg1, "beast"))
        {
                if (ch->pcdata->powers[PINVOKE] < 9)
                {
                        send_to_char("You don't have that invoke yet.\n\r",
                                     ch);
                        return;
                }
                if (!IS_ITEMAFF(ch, ITEMA_BEAST) && ch->practice >= beastcost)
                {
                        SET_BIT(ch->itemaffect, ITEMA_BEAST);
                        ch->practice -= beastcost;
                        send_to_char
                                ("Your let your inner beast take control over your actions.\n\r",
                                 ch);
                        return;
                }
                else if (IS_ITEMAFF(ch, ITEMA_BEAST))
                {
                        send_to_char
                                ("You feel the beast inside of you roar, but nothing else happens.\n\r",
                                 ch);
                        return;
                }
                else
                {
                        send_to_char
                                ("it costs 10 primal to let the beast take over.\n\r",
                                 ch);
                        return;
                }
        }
        else if (!str_cmp(arg1, "illusions"))
        {
                if (ch->pcdata->powers[PINVOKE] < 8)
                {
                        send_to_char("You don't have that invoke yet.\n\r",
                                     ch);
                        return;
                }
                if (!IS_ITEMAFF(ch, ITEMA_ILLUSIONS)
                    && ch->practice >= illusioncost)
                {
                        SET_BIT(ch->itemaffect, ITEMA_ILLUSIONS);
                        ch->practice -= illusioncost;
                        send_to_char
                                ("You conjure several images of yourself, making it impossibly to tell which is really you.\n\r",
                                 ch);
                        return;
                }
                else if (IS_ITEMAFF(ch, ITEMA_ILLUSIONS))
                {
                        send_to_char
                                ("You cannot summon any more illusions.\n\r",
                                 ch);
                        return;
                }
                else
                {
                        send_to_char
                                ("it costs 5 primal to invoke the illusions of yourself.\n\r",
                                 ch);
                        return;
                }
                return;
        }
        else if (!str_cmp(arg1, "deflector"))
        {
                if (ch->pcdata->powers[PINVOKE] < 5)
                {
                        send_to_char("You don't have that invoke yet.\n\r",
                                     ch);
                        return;
                }
                if (!IS_ITEMAFF(ch, ITEMA_DEFLECTOR)
                    && ch->practice >= defshieldcost)
                {
                        SET_BIT(ch->itemaffect, ITEMA_DEFLECTOR);
                        ch->practice -= defshieldcost;
                        send_to_char
                                ("A shield appears in the air, preventing people from hitting you.\n\r",
                                 ch);
                        return;
                }
                else if (IS_ITEMAFF(ch, ITEMA_DEFLECTOR))
                {
                        send_to_char
                                ("You cannot summon any more shields.\n\r",
                                 ch);
                        return;
                }
                else
                {
                        send_to_char
                                ("it costs 5 primal to summon a shield.\n\r",
                                 ch);
                        return;
                }
        }
        else if (!str_cmp(arg1, "mageshield") || !str_cmp(arg1, "shield"))
        {
                if (ch->pcdata->powers[PINVOKE] < 2)
                {
                        send_to_char("You don't have that invoke yet.\n\r",
                                     ch);
                        return;
                }
                if (!IS_SET(ch->newbits, NEW_MULTIARMS))
                        SET_BIT(ch->newbits, NEW_MULTIARMS);
                if (!IS_ITEMAFF(ch, ITEMA_MAGESHIELD)
                    && ch->practice >= shieldcost)
                {
                        SET_BIT(ch->itemaffect, ITEMA_MAGESHIELD);
                        ch->practice -= shieldcost;
                        send_to_char
                                ("A layer of mystic shields envelopes your body.\n\r",
                                 ch);
                        return;
                }
                else if (IS_ITEMAFF(ch, ITEMA_MAGESHIELD))
                {
                        send_to_char("You are allready shielded.\n\r", ch);
                        return;
                }
                else
                {
                        send_to_char("The cost is 25 primal.\n\r", ch);
                        return;
                }
        }
        else if (!str_cmp(arg1, "all"))
        {
                int       totalcost = 0;

                if (ch->pcdata->powers[PINVOKE] < 9)
                {
                        send_to_char
                                ("You don't have all invokes, so theres no point in invoking them all.\n\r",
                                 ch);
                        return;
                }
                if (!IS_ITEMAFF(ch, ITEMA_MAGESHIELD))
                        totalcost += shieldcost;
                if (!IS_ITEMAFF(ch, ITEMA_DEFLECTOR))
                        totalcost += defshieldcost;
                if (!IS_ITEMAFF(ch, ITEMA_ILLUSIONS))
                        totalcost += illusioncost;
                if (!IS_ITEMAFF(ch, ITEMA_BEAST))
                        totalcost += beastcost;
                if (!IS_ITEMAFF(ch, ITEMA_STEELSHIELD))
                        totalcost += steelshieldcost;
                if (totalcost == 0)
                {
                        send_to_char("You already have all invokes on.\n\r",
                                     ch);
                        return;
                }
                if (ch->practice < totalcost)
                {
                        send_to_char("You don't have the primal.\n\r", ch);
                        return;
                }
                if (!IS_ITEMAFF(ch, ITEMA_MAGESHIELD))
                        SET_BIT(ch->itemaffect, ITEMA_MAGESHIELD);
                if (!IS_ITEMAFF(ch, ITEMA_DEFLECTOR))
                        SET_BIT(ch->itemaffect, ITEMA_DEFLECTOR);
                if (!IS_ITEMAFF(ch, ITEMA_ILLUSIONS))
                        SET_BIT(ch->itemaffect, ITEMA_ILLUSIONS);
                if (!IS_ITEMAFF(ch, ITEMA_BEAST))
                        SET_BIT(ch->itemaffect, ITEMA_BEAST);
                if (!IS_ITEMAFF(ch, ITEMA_STEELSHIELD))
                        SET_BIT(ch->itemaffect, ITEMA_STEELSHIELD);
                send_to_char("You invoke all your powers.\n\r", ch);
                ch->practice -= totalcost;
                return;
        }
        send_to_char
                ("invoke <learn/mageshield/deflector/steelshield/illusions/beast/all>.\n\r",
                 ch);
        return;
}

/* syntax : magics
 * shows all class powers in effect
 */
void do_magics(CHAR_DATA * ch, char *argument)
{
        if (IS_NPC(ch))
                return;
        if (!IS_CLASS(ch, CLASS_MAGE))
        {
                send_to_char("Huh?\n\r", ch);
                return;
        }
        if (IS_ITEMAFF(ch, ITEMA_MAGESHIELD))
                send_to_char
                        ("* Your skin is covered in a layer of mystical energies.\n\r",
                         ch);
        if (IS_ITEMAFF(ch, ITEMA_BEAST))
                send_to_char
                        ("* Your inner beast is in control of your actions.\n\r",
                         ch);
        if (IS_ITEMAFF(ch, ITEMA_STEELSHIELD))
                send_to_char("* Your skin is solid steel.\n\r", ch);
        if (IS_ITEMAFF(ch, ITEMA_DEFLECTOR))
                send_to_char
                        ("* A shield hovers in the air, defending you.\n\r",
                         ch);
        if (IS_ITEMAFF(ch, ITEMA_ILLUSIONS))
                send_to_char
                        ("* Several images of you stand by your side.\n\r",
                         ch);
        return;
}

/* syntax : discharge
 * (drops all elementalshields in one BIG blast)
 */
void do_discharge(CHAR_DATA * ch, char *argument)
{
        CHAR_DATA *vch;
        CHAR_DATA *vch_next;
        CHAR_DATA *mount;
        char      buf1[MAX_STRING_LENGTH];
        char      buf2[MAX_STRING_LENGTH];
        char      buf3[MAX_STRING_LENGTH];
        int       magic_power =
                ch->spl[RED_MAGIC] + ch->spl[BLUE_MAGIC] +
                ch->spl[GREEN_MAGIC] + ch->spl[PURPLE_MAGIC] +
                ch->spl[YELLOW_MAGIC];
        int       dam;

        if (IS_NPC(ch))
                return;
        if (!IS_CLASS(ch, CLASS_MAGE))
        {
                send_to_char("Huh?\n\r", ch);
                return;
        }
        if (ch->pcdata->powers[PINVOKE] < 4)    /* 4 is just a test */
        {
                send_to_char("You don't have that invoke yet.\n\r", ch);
                return;
        }
        if (IS_ITEMAFF(ch, ITEMA_AFFENTROPY))
                magic_power += 100;
        if (IS_ITEMAFF(ch, ITEMA_MAGESHIELD))
        {
                REMOVE_BIT(ch->itemaffect, ITEMA_MAGESHIELD);
                for (vch = ch->in_room->people; vch != NULL; vch = vch_next)
                {
                        vch_next = vch->next_in_room;
                        if (vch != ch)
                        {
                                if (is_safe(ch, vch))
                                        continue;
                                if ((mount = ch->mount) != NULL)
                                        if (mount == vch)
                                                continue;
                                dam = number_range(magic_power * 7 / 2,
                                                   magic_power * 9 / 2) +
                                        ch->damroll;
                                if (IS_AFFECTED(vch, AFF_SANCTUARY))
                                        dam *= 0.5;
                                xprintf(buf1,
                                        "$n's mystical shields explodes in a shower of flames striking $N [#C%d#n]",
                                        dam);
                                xprintf(buf2,
                                        "Your mystical shields explodes in a shower of flames striking $N [#C%d#n]",
                                        dam);
                                xprintf(buf3,
                                        "$n's mystical shields explodes in a shower of flames striking you [#C%d#n]",
                                        dam);
                                act(buf1, ch, NULL, vch, TO_NOTVICT);
                                act(buf2, ch, NULL, vch, TO_CHAR);
                                act(buf3, ch, NULL, vch, TO_VICT);
                                hurt_person(ch, vch, dam);
                                if (vch->position > POS_STUNNED)
                                {
                                        if (vch->fighting == NULL)
                                                set_fighting(vch, ch, TRUE);
                                        if (ch->fighting == NULL)
                                                set_fighting(ch, vch, FALSE);
                                }
                        }
                }
        }
        return;
}


/* syntax : teleport <target>
 * ex : teleport satan
 */
void do_teleport(CHAR_DATA * ch, char *argument)
{
        char      arg[MAX_INPUT_LENGTH];
        ROOM_INDEX_DATA *location;
        CHAR_DATA *victim;

        one_argument(argument, arg);
        if (IS_NPC(ch))
                return;
        if (!IS_CLASS(ch, CLASS_MAGE))
        {
                send_to_char("Huh?\n\r", ch);
                return;
        }
        if (ch->pcdata->powers[PINVOKE] < 1)    /* 1 is just a test */
        {
                send_to_char("You don't have that invoke yet.\n\r", ch);
                return;
        }
        if ((victim = get_char_world(ch, arg)) == NULL)
        {
                send_to_char("Teleport to whom?\n\r", ch);
                return;
        }
        if (IS_SET(victim->in_room->room_flags, ROOM_ASTRAL))
        {
                stc("You can't find it's room.\n\r", ch);
                return;
        }
        if (IS_IMMUNE(victim, IMM_TRAVEL) && !IS_NPC(victim))
        {
                send_to_char("I don't think they want you to do that.\n\r",
                             ch);
                return;
        }
        if (IS_SET(ch->in_room->room_flags, ROOM_ASTRAL))
        {
                stc("Your room is not connected to the astral plane.\n\r",
                    ch);
                return;
        }
        if (IS_SET(victim->act, ACT_NOTRAVEL))
        {
                send_to_char("No Can Do.\n\r", ch);
                return;
        }
        location = victim->in_room;
        if (ch->mana < 250)
        {
                send_to_char("You don't have the mana to cast teleport.\n\r",
                             ch);
                return;
        }
        act("You utter a single powerword.", ch, NULL, NULL, TO_CHAR);
        act("$n utters a strange sounding word and disappers.", ch, NULL,
            NULL, TO_ROOM);
        ch->mana -= 250;
        char_from_room(ch);
        char_to_room(ch, location);
        do_look(ch, "auto");
        act("You materialize.", ch, NULL, NULL, TO_CHAR);
        act("$n suddenly appear from out of nowhere.", ch, NULL, NULL,
            TO_ROOM);
        return;
}

/* syntax : objectgate <object>
 * ex. objectgate 2.bells
 */
void do_objectgate(CHAR_DATA * ch, char *argument)
{
        OBJ_DATA *obj;
        char      arg1[MAX_INPUT_LENGTH];

        argument = one_argument(argument, arg1);

        if (IS_NPC(ch))
                return;
        if (!IS_CLASS(ch, CLASS_MAGE) && !IS_CLASS(ch, CLASS_LICH))
        {
                send_to_char("Huh?\n\r", ch);
                return;
        }
        if (IS_CLASS(ch, CLASS_LICH) && ch->pcdata->powers[CON_LORE] < 1)
        {
                send_to_char("But you don't know how to do that silly.\n\r",
                             ch);
                return;
        }
        if (arg1[0] == '\0')
        {
                send_to_char
                        ("What object do you want to attempt to gate?\n\r",
                         ch);
                return;
        }
        if ((obj = get_obj_world(ch, arg1)) == NULL)
        {
                send_to_char("No such object.\n\r", ch);
                return;
        }
        if (IS_SET(obj->quest, QUEST_ARTIFACT)
            || IS_SET(obj->quest, QUEST_RELIC))
        {
                send_to_char("You cannot grab artifacts or relics.\n\r", ch);
                return;
        }
        if (IS_OBJ_STAT(obj, ITEM_NOLOCATE))
        {
                send_to_char("You wish.\n\r", ch);
                return;
        }
        if (obj->carried_by != NULL)
        {
                send_to_char("Someone is holding the item.\n\r", ch);
                return;
        }
        if (obj->in_room == NULL)
        {
                send_to_char("It seems to be inside something.\n\r", ch);
                return;
        }
        if (!IS_SET(obj->wear_flags, ITEM_TAKE))
        {
                send_to_char("This item is too big.\n\r", ch);
                return;
        }
        if (IS_SET(obj->in_room->room_flags, ROOM_ASTRAL))
        {
                send_to_char("You can't find it's room.\n\r", ch);
                return;
        }
        if (IS_SET(ch->in_room->room_flags, ROOM_ASTRAL))
        {
                send_to_char
                        ("Your room is not connected to the astral plane.\n\r",
                         ch);
                return;
        }
        obj_from_room(obj);
        obj_to_char(obj, ch);
        send_to_char("The item appears in your hand.\n\r", ch);
        return;
}

/* 
 * for affect spells
 */

void do_bewitch(CHAR_DATA * ch, char *argument)
{
        /*
         * ged
         */
        WAIT_STATE(ch, 2);
        return;
}


void do_mageskill(CHAR_DATA * ch, char *argument)
{
        char      arg1[MAX_INPUT_LENGTH];
        char      arg2[MAX_INPUT_LENGTH];
        char      buf[MAX_STRING_LENGTH];

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

        if (IS_NPC(ch))
                return;

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

        if (arg1[0] == '\0' && arg2[0] == '\0')
        {
                stc(" #o_________________________________#n\n\r", ch);
                stc("#o/  _\\                             \\#n\n\r", ch);
                stc("#o\\ (_/_____________________________/#n\n\r", ch);
                stc(" #o\\           #0.:#pS#Pkills#0:.        #o\\#n\n\r",
                    ch);
                xprintf(buf,
                        "  #o\\   #P*#cS#Cpritual #cK#Carma       #0[#P%d#0]#o \\#n\n\r",
                        ch->pcdata->powers[MAGE_SK]);
                stc(buf, ch);
                xprintf(buf,
                        "   #o\\   #P*#cS#Corcery #cS#Cpell #cU#Cse    #0[#P%d#0]#o \\#n\n\r",
                        ch->pcdata->powers[MAGE_SSU]);
                stc(buf, ch);
                xprintf(buf,
                        "  #o__\\   #P*#cM#Cagical #cS#Cpell #cU#Cse    #0[#P%d#0] #o\\#n\n\r",
                        ch->pcdata->powers[MAGE_MSU]);
                stc(buf, ch);
                xprintf(buf,
                        " #o/ )_\\   #P*#cN#Caturalism #cS#Cpell #cU#Cse #0[#P%d#0] #o\\#n\n\r",
                        ch->pcdata->powers[MAGE_NSU]);
                stc(buf, ch);
                stc(" #o\\___/_____________________________/#n\n\r", ch);
                return;
        }

        else if (!str_cmp(arg2, "learn") && !str_cmp(arg1, "sk"))
        {
                int       cost;
                int       max = 5;

                cost = (ch->pcdata->powers[MAGE_SK] + 1) * 2000000;
                if (ch->pcdata->powers[MAGE_SK] >= max)
                {
                        xprintf(buf,
                                "#0You've learned as much #cS#Cpiritual #cK#Carma #0as possible at this point in time!#n\n\r");
                        send_to_char(buf, ch);
                        return;
                }
                if (cost > ch->exp)
                {
                        xprintf(buf,
                                "#0You need #P%d #0exp to improve this skill any further!#n\n\r",
                                cost);
                        send_to_char(buf, ch);
                        return;
                }
                ch->pcdata->powers[MAGE_SK] += 1;
                ch->exp -= cost;
                xprintf(buf,
                        "#0You further your studies in #cS#Cpiritual #cK#Carma!#n\n\r");
                send_to_char(buf, ch);
        }

        else if (!str_cmp(arg2, "learn") && !str_cmp(arg1, "ssu"))
        {
                int       cost;
                int       max = 5;

                cost = (ch->pcdata->powers[MAGE_SSU] + 1) * 2000000;
                if (ch->pcdata->powers[MAGE_SSU] >= max)
                {
                        xprintf(buf,
                                "#0You've learned as much #rS#Rorcery #rS#Rpell #rU#Rse #0as possible at this point in time!#n\n\r");
                        send_to_char(buf, ch);
                        return;
                }
                if (cost > ch->exp)
                {
                        xprintf(buf,
                                "#0You need #P%d #0exp to improve this skill any further!#n\n\r",
                                cost);
                        send_to_char(buf, ch);
                        return;
                }
                ch->pcdata->powers[MAGE_SSU] += 1;
                ch->exp -= cost;
                xprintf(buf,
                        "#0You further your studies in #rS#Rorcery #rS#Rpell #rU#Rse!#n\n\r");
                send_to_char(buf, ch);
        }

        else if (!str_cmp(arg2, "learn") && !str_cmp(arg1, "msu"))
        {
                int       cost;
                int       max = 5;

                cost = (ch->pcdata->powers[MAGE_MSU] + 1) * 2000000;
                if (ch->pcdata->powers[MAGE_MSU] >= max)
                {
                        xprintf(buf,
                                "#0You've learned as much #lM#Lagical #lS#Lpell #lU#Lse #0as possible at this point in time!#n\n\r");
                        send_to_char(buf, ch);
                        return;
                }
                if (cost > ch->exp)
                {
                        xprintf(buf,
                                "#0You need #P%d #0exp to improve this skill any further!#n\n\r",
                                cost);
                        send_to_char(buf, ch);
                        return;
                }
                ch->pcdata->powers[MAGE_MSU] += 1;
                ch->exp -= cost;
                xprintf(buf,
                        "#0You further your studies in #lM#Lagical #lS#Lpell #lU#Lse!#n\n\r");
                send_to_char(buf, ch);
        }

        else if (!str_cmp(arg2, "learn") && !str_cmp(arg1, "nsu"))
        {
                int       cost;
                int       max = 5;

                cost = (ch->pcdata->powers[MAGE_NSU] + 1) * 2000000;
                if (ch->pcdata->powers[MAGE_NSU] >= max)
                {
                        xprintf(buf,
                                "#0You've learned as much #gN#Gaturalism #gS#Gpell #gU#Gse #0as possible at this point in time!#n\n\r");
                        send_to_char(buf, ch);
                        return;
                }
                if (cost > ch->exp)
                {
                        xprintf(buf,
                                "#0You need #P%d #0exp to improve this skill any further!#n\n\r",
                                cost);
                        send_to_char(buf, ch);
                        return;
                }
                ch->pcdata->powers[MAGE_NSU] += 1;
                ch->exp -= cost;
                xprintf(buf,
                        "#0You further your studies in #gN#Gaturalism #gS#Gpell #gU#Gse!#n\n\r");
                send_to_char(buf, ch);
        }
        else
                send_to_char
                        ("#PTo learn skills, type #0Mageskill #c<#Csk#c/#Cssu#c/#Cnsu#c/#Cmsu#c> #0Learn.#n\n\r",
                         ch);
        return;
}

void do_magespells(CHAR_DATA * ch, char *argument)
{
        char      arg1[MAX_INPUT_LENGTH];
        char      arg2[MAX_INPUT_LENGTH];
        char      buf[MAX_STRING_LENGTH];

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

        if (IS_NPC(ch))
                return;

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

        if (arg1[0] == '\0' && arg2[0] == '\0')
        {
                stc("                #W.-~~~~~~~~~-._       _.-~~~~~~~~~-.#n\n\r", ch);
                stc("            #l__#W.'  #C((#0Spells#C))  #W~.   .~   #C((#yIndex#C))  #7`.#l__#n\n\r", ch);
                xprintf(buf,
                        "          #l.'#7// #rS#Rorcery    #P[#0%d#P]   #7\\#0.#7/   #lM#Lagical     #P[#0%d#P]#7\\\\#l`.#n\n\r",
                        ch->pcdata->powers[MAGE_SORCERY],
                        ch->pcdata->powers[MAGE_MAGIC]);
                stc(buf, ch);
                xprintf(buf,
                        "        #l.'#7//  #gN#Gaturalism #P[#0%d#P]     #0|     #oE#ynchantment #P[#0%d#P]#7 \\\\#l`.#n\n\r",
                        ch->pcdata->powers[MAGE_NATURALISM],
                        ch->pcdata->powers[MAGE_ENCHANTMENT]);
                stc(buf, ch);
                stc("      #l.'#7// #W.-~\"\"\"\"\"\"\"~~~~-._     #0|#W     _,-~~~~\"\"\"\"\"\"\"~-. #7\\\\#l`.#n\n\r", ch);
                stc("    #L.'#7//#W.-\"                 `-.  #0|#7  #W.-'                 \"-.#7\\\\#L`.#n\n\r", ch);
                stc("  #L.'#7//______.============-..   \\ #0|#7 /   ..-============.______\\\\#L`.#n\n\r", ch);
                stc("#L.'______________________________#7\\#0|#7/#L______________________________`.#n\n\r", ch);
                stc("Syntax: magespells (sorcery, enchantment, naturalism, magical) [scribe]#n\n\r", ch);
                return;
        }

//Fuckin Output
        if (arg2[0] == '\0')
        {
                if (!str_cmp(arg1, "sorcery"))
                {
                        stc("      ___________________   ___________________\n\r", ch);
                        stc("  #R.-#7/|       #0~~#P**#0~~      #7\\ /      #0~~#P**#0~~       #7|\\#R-.#n\n\r", ch);
                        stc("  #R|#7||#W|   #rS#Rorcery #rS#Rpells   #7:     #CM#cana  #CC#cost     #W|#7||#R|#n\n\r", ch);
                        stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        if (ch->pcdata->powers[MAGE_SORCERY] > 0)
                        {
                                stc("  #R|#7||#W|   #rNerve Blank      #7:        #y2000        #W|#7||#R|#n\n\r", ch);
                        }
                        else
                        {
                                stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        }
                        if (ch->pcdata->powers[MAGE_SORCERY] > 1)
                        {
                                stc("  #R|#7||#W|   #rAcid Arrow       #7:        #y3000        #W|#7||#R|#n\n\r", ch);
                        }
                        else
                        {
                                stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        }
                        if (ch->pcdata->powers[MAGE_SORCERY] > 2)
                        {
                                stc("  #R|#7||#W|   #rEther Blast      #7:        #y3000        #W|#7||#R|#n\n\r", ch);
                        }
                        else
                        {
                                stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        }
                        if (ch->pcdata->powers[MAGE_SORCERY] > 3)
                        {
                                if (IS_SET(ch->sohbits, SOH_SPECFIRE))
                                {
                                        stc("  #R|#7||#W|   #rDemon Fire       #7:        #y5000        #W|#7||#R|#n\n\r", ch);
                                }
                                else if (IS_SET(ch->sohbits, SOH_SPECICE))
                                {
                                        stc("  #R|#7||#W|   #rIcy Chill        #7:        #y5000        #W|#7||#R|#n\n\r", ch);
                                }
                                else if (IS_SET
                                         (ch->sohbits, SOH_SPECLIGHTNING))
                                {
                                        stc("  #R|#7||#W|   #rElectroBolt      #7:        #y5000        #W|#7||#R|#n\n\r", ch);
                                }
                                else
                                {
                                        stc("  #R|#7||#W|   #rElemental Spell  #7:        #y5000        #W|#7||#R|#n\n\r", ch);
                                }
                        }
                        else
                        {
                                stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        }
                        if (ch->pcdata->powers[MAGE_SORCERY] > 4)
                        {
                                stc("  #R|#7||#W|   #rEngulf           #7:        #y7000        #W|#7||#R|#n\n\r", ch);
                        }
                        else
                        {
                                stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        }
                        stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        stc("  #R|#7||#W|       #0~~#C**#0~~       #7:       #0~~#C**#0~~       #W|#7||#R|#n\n\r", ch);
                        stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        stc("  #R|#7|/====================#W\\#7:#W/#7====================#W\\#7|#R|#n\n\r", ch);
                        stc("  #R`---------------------~#r___#R~--------------------''#n\n\r", ch);
                        stc("Syntax: magespells (sorcery, enchantment, naturalism, magical) [scribe]#n\n\r", ch);
                        return;
                }
        }


        if (arg2[0] == '\0')
        {
                if (!str_cmp(arg1, "magical"))
                {
                        stc("      ___________________   ___________________\n\r", ch);
                        stc("  #R.-#7/#W|       #0~~#P**#0~~      #W\\ /      #0~~#P**#0~~       #W|#7\\#R-.#n\n\r", ch);
                        stc("  #R|#7||#W|   #lMa#Lgic#7a#Wl S#7p#Lel#lls   #7:     #CM#cana  #CC#cost     #W|#7||#R|#n\n\r", ch);
                        stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        if (ch->pcdata->powers[MAGE_MAGIC] > 0)
                        {
                                stc("  #R|#7||#W|   #LThird Eye        #7:        #y1000        #W|#7||#R|#n\n\r", ch);
                        }
                        else
                        {
                                stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        }
                        if (ch->pcdata->powers[MAGE_MAGIC] > 1)
                        {
                                stc("  #R|#7||#W|   #LScry             #7:        #y1500        #W|#7||#R|#n\n\r", ch);
                        }
                        else
                        {
                                stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        }
                        if (ch->pcdata->powers[MAGE_MAGIC] > 2)
                        {
                                stc("  #R|#7||#W|   #LTeleport         #7:        #y2000        #W|#7||#R|#n\n\r", ch);
                        }
                        else
                        {
                                stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        }
                        if (ch->pcdata->powers[MAGE_MAGIC] > 3)
                        {
                                stc("  #R|#7||#W|   #LSlow             #7:        #y3000        #W|#7||#R|#n\n\r", ch);
                        }
                        else
                        {
                                stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        }
                        if (ch->pcdata->powers[MAGE_MAGIC] > 4)
                        {
                                stc("  #R|#7||#W|   #LHaste            #7:        #y5000        #W|#7||#R|#n\n\r", ch);
                        }
                        else
                        {
                                stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        }
                        stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        stc("  #R|#7||#W|       #0~~#C**#0~~       #7:       #0~~#C**#0~~       #W|#7||#R|#n\n\r", ch);
                        stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        stc("  #R|#7|/====================#W\\#7:#W/#7====================#W\\#7|#R|#W\n\r", ch);
                        stc("  #R`---------------------~#r___#R~--------------------''#n\n\r", ch);
                        stc("Syntax: magespells (sorcery, enchantment, naturalism, magical) [scribe]#n\n\r", ch);
                        return;
                }
        }

        if (arg2[0] == '\0')
        {
                if (!str_cmp(arg1, "naturalism"))
                {
                        stc("      ___________________   ___________________\n\r", ch);
                        stc("  #R.-#7/#W|       #0~~#P**#0~~      #W\\ /      #0~~#P**#0~~       #W|#7\\#R-.#n\n\r", ch);
                        stc("  #R|#7||#W|  #GN#gaturalism #GS#gpells #7:     #CM#cana  #CC#cost     #W|#7||#R|#n\n\r", ch);
                        stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        if (ch->pcdata->powers[MAGE_NATURALISM] > 0)
                        {
                                stc("  #R|#7||#W|   #GEagle Eye        #7:        #y2000        #W|#7||#R|#n\n\r", ch);
                        }
                        else
                        {
                                stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        }
                        if (ch->pcdata->powers[MAGE_NATURALISM] > 1)
                        {
                                stc("  #R|#7||#W|   #GOgre Strength    #7:        #y3000        #W|#7||#R|#n\n\r", ch);
                        }
                        else
                        {
                                stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        }
                        if (ch->pcdata->powers[MAGE_NATURALISM] > 2)
                        {
                                stc("  #R|#7||#W|   #GLight Shards     #7:        #y5000        #W|#7||#R|#n\n\r", ch);
                        }
                        else
                        {
                                stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        }
                        if (ch->pcdata->powers[MAGE_NATURALISM] > 3)
                        {
                                stc("  #R|#7||#W|   #GSoul Mend        #7:        #y2000        #W|#7||#R|#n\n\r", ch);
                        }
                        else
                        {
                                stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        }
                        if (ch->pcdata->powers[MAGE_NATURALISM] > 4)
                        {
                                stc("  #R|#7||#W|   #GRegenerate       #7:        #y6000        #W|#7||#R|#n\n\r", ch);
                        }
                        else
                        {
                                stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        }
                        stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        stc("  #R|#7||#W|       #0~~#C**#0~~       #7:       #0~~#C**#0~~       #W|#7||#R|#n\n\r", ch);
                        stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        stc("  #R|#7|/====================#W\\#7:#W/#7====================#W\\#7|#R|#W\n\r", ch);
                        stc("  #R`---------------------~#r___#R~--------------------''#n\n\r", ch);
                        stc("Syntax: magespells (sorcery, enchantment, naturalism, magical) [scribe]#n\n\r", ch);
                        return;
                }
        }

        if (arg2[0] == '\0')
        {
                if (!str_cmp(arg1, "enchantment"))
                {
                        stc("      ___________________   ___________________\n\r", ch);
                        stc("  #R.-#7/#W|       #0~~#P**#0~~      #W\\ /      #0~~#P**#0~~       #W|#7\\#R-.#n\n\r", ch);
                        stc("  #R|#7||#W| #oE#ynchantment #oS#ypells #7:     #CM#cana  #CC#cost     #W|#7||#R|#n\n\r", ch);
                        stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        if (ch->pcdata->powers[MAGE_ENCHANTMENT] > 0)
                        {
                                stc("  #R|#7||#W|   #yElemental Rune   #7:        #y2000        #W|#7||#R|#n\n\r", ch);
                        }
                        else
                        {
                                stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        }
                        if (ch->pcdata->powers[MAGE_ENCHANTMENT] > 1)
                        {
                                stc("  #R|#7||#W|   #yChaos Rune       #7:        #y3000        #W|#7||#R|#n\n\r", ch);
                        }
                        else
                        {
                                stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        }
                        if (ch->pcdata->powers[MAGE_ENCHANTMENT] > 2)
                        {
                                stc("  #R|#7||#W|   #yClown Rune       #7:        #y3000        #W|#7||#R|#W\n\r", ch);
                        }
                        else
                        {
                                stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        }
                        if (ch->pcdata->powers[MAGE_ENCHANTMENT] > 3)
                        {
                                if (IS_SET(ch->sohbits, SOH_SPECFIRE))
                                {
                                        stc("  #R|#7||#W|   #yFire Enchant     #7:       #y10000        #W|#7||#R|#n\n\r", ch);
                                }
                                else if (IS_SET(ch->sohbits, SOH_SPECICE))
                                {
                                        stc("  #R|#7||#W|   #yFrost Enchant    #7:       #y10000        #W|#7||#R|#n\n\r", ch);
                                }
                                else if (IS_SET
                                         (ch->sohbits, SOH_SPECLIGHTNING))
                                {
                                        stc("  #R|#7||#W|   #yLightning Enchant#7:       #y10000        #W|#7||#R|#n\n\r", ch);
                                }
                                else
                                {
                                        stc("  #R|#7||#W|   #yElemental Enchant#7:       #y10000        #W|#7||#R|#n\n\r", ch);
                                }
                        }
                        else
                        {
                                stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        }
                        if (ch->pcdata->powers[MAGE_ENCHANTMENT] > 4)
                        {
                                stc("  #R|#7||#W|   #yMagic Plating    #7:       #y15000        #W|#7||#R|#n\n\r", ch);
                        }
                        else
                        {
                                stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        }
                        stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        stc("  #R|#7||#W|       #0~~#C**#0~~       #7:       #0~~#C**#0~~       #W|#7||#R|#n\n\r", ch);
                        stc("  #R|#7||#W|                    #7:                    #W|#7||#R|#n\n\r", ch);
                        stc("  #R|#7|/====================#W\\#7:#W/#7====================#W\\#7|#R|#n\n\r", ch);
                        stc("  #R`---------------------~#r___#R~--------------------''#n\n\r", ch);
                        stc("Syntax: magespells (sorcery, enchantment, naturalism, magical) [scribe]#n\n\r", ch);
                        return;
                }
        }


        else if (!str_cmp(arg2, "scribe") && !str_cmp(arg1, "sorcery"))
        {
                int       cost;
                int       max = 5;

                cost = (ch->pcdata->powers[MAGE_SORCERY] + 1) * 1000000;
                if (ch->pcdata->powers[MAGE_SORCERY] >= max)
                {
                        xprintf(buf,
                                "#0You've learned as many #rS#Rorcery #rS#Rpells #0as possible at this point in time!#n\n\r");
                        send_to_char(buf, ch);
                        return;
                }
                if (cost > ch->exp)
                {
                        xprintf(buf,
                                "#0You need #P%d #0exp to improve this skill any further!#n\n\r",
                                cost);
                        send_to_char(buf, ch);
                        return;
                }
                ch->pcdata->powers[MAGE_SORCERY] += 1;
                ch->exp -= cost;
                xprintf(buf, "#0You learn a new #rS#Rorcery #0Spell!#n\n\r");
                send_to_char(buf, ch);
        }

        else if (!str_cmp(arg2, "scribe") && !str_cmp(arg1, "enchantment"))
        {
                int       cost;
                int       max = 5;

                cost = (ch->pcdata->powers[MAGE_ENCHANTMENT] + 1) * 1000000;
                if (ch->pcdata->powers[MAGE_ENCHANTMENT] >= max)
                {
                        xprintf(buf,
                                "#0You've learned as many #oE#ynchantment #oS#ypells #0as possible at this point in time!#n\n\r");
                        send_to_char(buf, ch);
                        return;
                }
                if (cost > ch->exp)
                {
                        xprintf(buf,
                                "#0You need #P%d #0exp to improve this skill any further!#n\n\r",
                                cost);
                        send_to_char(buf, ch);
                        return;
                }
                ch->pcdata->powers[MAGE_ENCHANTMENT] += 1;
                ch->exp -= cost;
                xprintf(buf,
                        "#0You learn a new #oE#ynchant #oS#ypell!#n\n\r");
                send_to_char(buf, ch);
        }

        else if (!str_cmp(arg2, "scribe") && !str_cmp(arg1, "naturalism"))
        {
                int       cost;
                int       max = 5;

                cost = (ch->pcdata->powers[MAGE_NATURALISM] + 1) * 1000000;
                if (ch->pcdata->powers[MAGE_NATURALISM] >= max)
                {
                        xprintf(buf,
                                "#0You've learned as many #gN#Gaturalism #gS#Gpells #0as possible at this point in time!#n\n\r");
                        send_to_char(buf, ch);
                        return;
                }
                if (cost > ch->exp)
                {
                        xprintf(buf,
                                "#0You need #P%d #0exp to improve this skill any further!#n\n\r",
                                cost);
                        send_to_char(buf, ch);
                        return;
                }
                ch->pcdata->powers[MAGE_NATURALISM] += 1;
                ch->exp -= cost;
                xprintf(buf,
                        "#0You learn a new #gN#Gaturalism #0Spell!#n\n\r");
                send_to_char(buf, ch);
        }

        else if (!str_cmp(arg2, "scribe") && !str_cmp(arg1, "magic"))
        {
                int       cost;
                int       max = 5;

                cost = (ch->pcdata->powers[MAGE_MAGIC] + 1) * 1000000;
                if (ch->pcdata->powers[MAGE_MAGIC] >= max)
                {
                        xprintf(buf,
                                "#0You've learned as many #lM#Lagical #lS#Lpells #0as possible at this point in time!#n\n\r");
                        send_to_char(buf, ch);
                        return;
                }
                if (cost > ch->exp)
                {
                        xprintf(buf,
                                "#0You need #P%d #0exp to improve this skill any further!#n\n\r",
                                cost);
                        send_to_char(buf, ch);
                        return;
                }
                ch->pcdata->powers[MAGE_MAGIC] += 1;
                ch->exp -= cost;
                xprintf(buf, "#0You learn a new #lM#Lagical #0Spell!#n\n\r");
                send_to_char(buf, ch);
        }
        else
                send_to_char
                        ("#PTo learn spells, type #0spells #c<#Csorcery#c/#Cenchantment#c/#Cnaturalism#c/#Cmagic#c> #0Scribe.#n\n\r",
                         ch);
        return;
}

void do_specialize(CHAR_DATA * ch, char *argument)
{
        char      arg1[MAX_INPUT_LENGTH];
        char      buf[MAX_STRING_LENGTH];

        argument = one_argument(argument, arg1);

        if (IS_NPC(ch))
                return;

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

        if (IS_SET(ch->sohbits, SOH_SPECLIGHTNING)
            || IS_SET(ch->sohbits, SOH_SPECFIRE)
            || IS_SET(ch->sohbits, SOH_SPECICE))
        {
                stc("#PYou've already specialized your magic!#n\n\r", ch);
                return;
        }

        if (arg1[0] == '\0')
        {
                stc("#0Syntax: #PSpecialize #C<#ylightning#0/#Cice#0/#Rfire#C>#n\n\r", ch);
                return;
        }

        if (!str_cmp(arg1, "lightning"))
        {
                stc("#0You specialize in #oLi#ygh#Wtn#yin#yg M#Wa#ygi#oc!#n\n\r", ch);
                SET_BIT(ch->sohbits, SOH_SPECLIGHTNING);
                xprintf(buf,
                        "#P%s #0has specialized in #oLi#ygh#Wtn#yin#yg M#Wa#ygi#oc!#n",
                        ch->pcdata->switchname);
                do_info(ch, buf);
                return;
        }

        else if (!str_cmp(arg1, "ice"))
        {
                stc("#0You specialize in #LI#Cc#7e M#Wa#Cgi#Lc!#n\n\r", ch);
                SET_BIT(ch->sohbits, SOH_SPECICE);
                xprintf(buf,
                        "#P%s #0has specialized in #LI#Cc#7e M#Wa#Cgi#Lc!#n",
                        ch->pcdata->switchname);
                do_info(ch, buf);
                return;
        }

        else if (!str_cmp(arg1, "fire"))
        {
                stc("#0You specialize in #rF#Ri#yr#7e #WM#7a#yg#Ri#rc!#n\n\r",
                    ch);
                SET_BIT(ch->sohbits, SOH_SPECFIRE);
                xprintf(buf,
                        "#P%s #0has specialized in #rF#Ri#yr#7e #WM#7a#yg#Ri#rc!#n",
                        ch->pcdata->switchname);
                do_info(ch, buf);
                return;
        }

        else
                stc("#0Syntax: #PSpecialize #C<#ylightning#0/#Cice#0/#Rfire#C>#n\n\r", ch);
        return;
}


void do_sorchant(CHAR_DATA * ch, char *argument)
{
        OBJ_DATA *obj = NULL;
        char      arg1[MAX_INPUT_LENGTH];
        int       cost;
        int       failure;  /*Chance of your spell to fizzle */
        int       chance;   /*% to check for success/failure */
        bool      sorcstaff = FALSE;

        chance = number_range(1, 100);
        argument = one_argument(argument, arg1);

        if (IS_NPC(ch))
                return;

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

        if (IS_SET(ch->sohbits, SOH_SPELLREADY))
        {
                stc("#PYou've already got a spell readied!  Type 'mindblank' to clear it!#n\n\r", ch);
                return;
        }

        if (IS_SET(ch->in_room->room_flags, ROOM_SILENCE))
        {
                stc("You cannot speak! The room has been silenced!\n\r", ch);
                return;
        }


        if (arg1[0] == '\0')
        {
                stc("#0Chant which Spell?#n\n\r", ch);
                return;
        }

        if (((obj = get_eq_char(ch, WEAR_WIELD)) != NULL)
            && (obj->pIndexData->vnum == 33000))
                sorcstaff = TRUE;
        else
                sorcstaff = FALSE;

        /*
         * We'll start first with Magical Spells
         */
        if (!str_cmp(arg1, "thirdeye"))
        {
                int       lag;

                cost = 1000;
                failure = 110 - ch->pcdata->powers[MAGE_MSU] * 20;
                lag = 5 - ch->pcdata->powers[MAGE_MSU];

                if (ch->mana < cost)
                {
                        stc("#pN#Pot enough mana!#n\n\r", ch);
                        return;
                }

                stc("#PY#0ou begin chanting the spidery language of magic...#n\n\r", ch);
                act("#C$n #0begins chanting the spidery language of magic...#n", ch, NULL, NULL, TO_ROOM);


                if (ch->pcdata->powers[MAGE_MAGIC] < 1)
                {
                        stc("#pYou attempt to cast the spell, but alas you haven't the knowledge.#n\n\r", ch);
                        stc("#CYour spell fizzles and leaves your mind!#n\n\r", ch);
                        ch->mana -= cost;
                        WAIT_STATE(ch, lag);
                        return;
                }

                if ((obj = get_obj_wear(ch, "newt eye", TRUE)) == NULL)
                {
                        send_to_char("You lack the spell component!\n\r", ch);
                        stc("#CYour spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                if (failure >= chance)
                {
                        stc("#CYou mispronounce a syllable and your spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                stc("#pY#Pour spell comes to mind.#n\n\r", ch);
                SET_BIT(ch->sohbits, SOH_SPELLTRUESIGHT);
                SET_BIT(ch->sohbits, SOH_SPELLREADY);
                if (sorcstaff == FALSE)
                {
                        extract_obj(obj);
                        stc("#0Your spell component #Rflashes #0and #Rburns #0out of reality!#n\n\r", ch);
                }
                WAIT_STATE(ch, lag);
                return;
        }

        else if (!str_cmp(arg1, "scry"))
        {
                int       lag;

                cost = 1500;
                failure = 110 - ch->pcdata->powers[MAGE_MSU] * 20;
                lag = 5 - ch->pcdata->powers[MAGE_MSU];

                if (ch->mana < cost)
                {
                        stc("#pN#Pot enough mana!#n\n\r", ch);
                        return;
                }

                stc("#PY#0ou begin chanting the spidery language of magic...#n\n\r", ch);
                act("#C$n #0begins chanting the spidery language of magic...#n", ch, NULL, NULL, TO_ROOM);


                if (ch->pcdata->powers[MAGE_MAGIC] < 2)
                {
                        stc("#pYou attempt to cast the spell, but alas you haven't the knowledge.#n\n\r", ch);
                        stc("#CYour spell fizzles and leaves your mind!#n\n\r", ch);
                        ch->mana -= cost;
                        WAIT_STATE(ch, lag);
                        return;
                }

                if ((obj = get_obj_wear(ch, "eye beholder", TRUE)) == NULL)
                {
                        send_to_char("You lack the spell component!\n\r", ch);
                        stc("#CYour spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                if (failure >= chance)
                {
                        stc("#CYou mispronounce a syllable and your spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                stc("#pY#Pour spell comes to mind.#n\n\r", ch);
                SET_BIT(ch->sohbits, SOH_SPELLSCRY);
                SET_BIT(ch->sohbits, SOH_SPELLREADY);
                if (sorcstaff == FALSE)
                        stc("#0Your spell component #gg#Gl#7o#Gw#gs #ybrightly#0!#n\n\r", ch);
                WAIT_STATE(ch, lag);
                return;
        }

        else if (!str_cmp(arg1, "teleport"))
        {
                int       lag;

                cost = 2000;
                failure = 110 - ch->pcdata->powers[MAGE_MSU] * 20;
                lag = 5 - ch->pcdata->powers[MAGE_MSU];

                if (ch->mana < cost)
                {
                        stc("#pN#Pot enough mana!#n\n\r", ch);
                        return;
                }

                if (ch->position == POS_FIGHTING)
                {
                        stc("Not in a fight!\n\r", ch);
                        return;
                }

                stc("#PY#0ou begin chanting the spidery language of magic...#n\n\r", ch);
                act("#C$n #0begins chanting the spidery language of magic...#n", ch, NULL, NULL, TO_ROOM);
                ch->mana -= cost;

                if (ch->pcdata->powers[MAGE_MAGIC] < 3)
                {
                        stc("#pYou attempt to cast the spell, but alas you haven't the knowledge.#n\n\r", ch);
                        stc("#CYour spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                if (failure >= chance)
                {
                        stc("#CYou mispronounce a syllable and your spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                stc("#pY#Pour spell comes to mind.#n\n\r", ch);
                SET_BIT(ch->sohbits, SOH_SPELLTELEPORT);
                SET_BIT(ch->sohbits, SOH_SPELLREADY);
                WAIT_STATE(ch, lag);
                return;
        }

        else if (!str_cmp(arg1, "slow"))
        {
                int       lag;

                cost = 3000;
                failure = 110 - ch->pcdata->powers[MAGE_MSU] * 20;
                lag = 12 - ch->pcdata->powers[MAGE_MSU];

                if (ch->mana < cost)
                {
                        stc("#pN#Pot enough mana!#n\n\r", ch);
                        return;
                }

                stc("#PY#0ou begin chanting the spidery language of magic...#n\n\r", ch);
                act("#C$n #0begins chanting the spidery language of magic...#n", ch, NULL, NULL, TO_ROOM);


                if (ch->pcdata->powers[MAGE_MAGIC] < 4)
                {
                        stc("#pYou attempt to cast the spell, but alas you haven't the knowledge.#n\n\r", ch);
                        stc("#CYour spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                if ((obj = get_obj_wear(ch, "spirit plasma", TRUE)) == NULL)
                {
                        send_to_char("You lack the spell component!\n\r", ch);
                        stc("#CYour spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                if (failure >= chance)
                {
                        stc("#CYou mispronounce a syllable and your spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                stc("#pY#Pour spell comes to mind.#n\n\r", ch);
                SET_BIT(ch->sohbits, SOH_SPELLSLOW);
                SET_BIT(ch->sohbits, SOH_SPELLREADY);
                ch->mana -= cost;
                stc("#0Your spell component #gg#Gl#7o#Gw#gs #ybrightly#0!#n\n\r", ch);
                WAIT_STATE(ch, lag);
                return;
        }

        else if (!str_cmp(arg1, "haste"))
        {
                int       lag;

                cost = 5000;
                failure = 110 - ch->pcdata->powers[MAGE_MSU] * 20;
                lag = 17 - ch->pcdata->powers[MAGE_MSU];

                if (ch->mana < cost)
                {
                        stc("#pN#Pot enough mana!#n\n\r", ch);
                        return;
                }

                stc("#PY#0ou begin chanting the spidery language of magic...#n\n\r", ch);
                act("#C$n #0begins chanting the spidery language of magic...#n", ch, NULL, NULL, TO_ROOM);


                if (ch->pcdata->powers[MAGE_MAGIC] < 5)
                {
                        stc("#pYou attempt to cast the spell, but alas you haven't the knowledge.#n\n\r", ch);
                        stc("#CYour spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                if ((obj = get_obj_wear(ch, "monkey paw", TRUE)) == NULL)
                {
                        send_to_char("You lack the spell component!\n\r", ch);
                        stc("#CYour spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                if (failure >= chance)
                {
                        stc("#CYou mispronounce a syllable and your spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                stc("#pY#Pour spell comes to mind.#n\n\r", ch);
                SET_BIT(ch->sohbits, SOH_SPELLHASTE);
                SET_BIT(ch->sohbits, SOH_SPELLREADY);
                ch->mana -= cost;
                stc("#0Your spell component #gg#Gl#7o#Gw#gs #ybrightly#0!#n\n\r", ch);
                WAIT_STATE(ch, lag);
                return;
        }

        /*
         * Sorcery Spells
         */
        else if (!str_cmp(arg1, "nerveblank"))
        {
                int       lag;

                cost = 2000;
                failure = 110 - ch->pcdata->powers[MAGE_SSU] * 20;
                lag = 5 - ch->pcdata->powers[MAGE_SSU];

                if (ch->mana < cost)
                {
                        stc("#pN#Pot enough mana!#n\n\r", ch);
                        return;
                }

                act("#PY#0ou begin chanting the spidery language of magic...#n", ch, NULL, NULL, TO_CHAR);
                act("#C$n #0begins chanting the spidery language of magic...#n", ch, NULL, NULL, TO_ROOM);
                ch->mana -= cost;
                if (ch->pcdata->powers[MAGE_SORCERY] < 1)
                {
                        stc("#pYou attempt to cast the spell, but alas you haven't the knowledge.#n\n\r", ch);
                        stc("#CYour spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                if ((obj = get_obj_wear(ch, "white powder", TRUE)) == NULL)
                {
                        send_to_char("You lack the spell component!\n\r", ch);
                        stc("#CYour spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                if (failure >= chance)
                {
                        stc("#CYou mispronounce a syllable and your spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                stc("#pY#Pour spell comes to mind.#n\n\r", ch);
                SET_BIT(ch->sohbits, SOH_SPELLSORC1);
                SET_BIT(ch->sohbits, SOH_SPELLREADY);
                if (sorcstaff == FALSE)
                {
                        extract_obj(obj);
                        stc("#0Your spell component #Rflashes #0and #Rburns #0out of reality!#n\n\r", ch);
                }
                WAIT_STATE(ch, lag);
                return;
        }

        else if (!str_cmp(arg1, "acidarrow"))
        {
                int       lag;

                cost = 3000;
                failure = 110 - ch->pcdata->powers[MAGE_SSU] * 20;
                lag = 11 - ch->pcdata->powers[MAGE_SSU];

                if (ch->mana < cost)
                {
                        stc("#pN#Pot enough mana!#n\n\r", ch);
                        return;
                }

                stc("#PY#0ou begin chanting the spidery language of magic...#n\n\r", ch);
                act("#C$n #0begins chanting the spidery language of magic...#n", ch, NULL, NULL, TO_ROOM);
                ch->mana -= cost;

                if (ch->pcdata->powers[MAGE_SORCERY] < 2)
                {
                        stc("#pYou attempt to cast the spell, but alas you haven't the knowledge.#n\n\r", ch);
                        stc("#CYour spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                if ((obj =
                     get_obj_wear(ch, "weapon arrowhead", TRUE)) == NULL)
                {
                        send_to_char("You lack the spell component!\n\r", ch);
                        stc("#CYour spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                if (failure >= chance)
                {
                        stc("#CYou mispronounce a syllable and your spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                stc("#pY#Pour spell comes to mind.#n\n\r", ch);
                SET_BIT(ch->sohbits, SOH_SPELLSORC2);
                SET_BIT(ch->sohbits, SOH_SPELLREADY);
                if (sorcstaff == FALSE)
                        stc("#0Your spell component #gg#Gl#7o#Gw#gs #ybrightly#0!#n\n\r", ch);
                WAIT_STATE(ch, lag);
                return;
        }

        else if (!str_cmp(arg1, "etherblast"))
        {
                int       lag;

                cost = 3000;
                failure = 110 - ch->pcdata->powers[MAGE_SSU] * 20;
                lag = 13 - ch->pcdata->powers[MAGE_SSU];

                if (ch->mana < cost)
                {
                        stc("#pN#Pot enough mana!#n\n\r", ch);
                        return;
                }

                stc("#PY#0ou begin chanting the spidery language of magic...#n\n\r", ch);
                act("#C$n #0begins chanting the spidery language of magic...#n", ch, NULL, NULL, TO_ROOM);
                ch->mana -= cost;

                if (ch->pcdata->powers[MAGE_SORCERY] < 3)
                {
                        stc("#pYou attempt to cast the spell, but alas you haven't the knowledge.#n\n\r", ch);
                        stc("#CYour spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                if ((obj = get_obj_wear(ch, "wyrm tooth", TRUE)) == NULL)
                {
                        send_to_char("You lack the spell component!\n\r", ch);
                        stc("#CYour spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                if (failure >= chance)
                {
                        stc("#CYou mispronounce a syllable and your spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                stc("#pY#Pour spell comes to mind.#n\n\r", ch);
                SET_BIT(ch->sohbits, SOH_SPELLSORC3);
                SET_BIT(ch->sohbits, SOH_SPELLREADY);
                ch->mana -= cost;
                stc("#0Your spell component #gg#Gl#7o#Gw#gs #ybrightly#0!#n\n\r", ch);
                WAIT_STATE(ch, lag);
                return;
        }

        else if (!str_cmp(arg1, "icychill"))
        {
                int       lag;

                cost = 5000;
                failure = 110 - ch->pcdata->powers[MAGE_SSU] * 20;
                lag = 11 - ch->pcdata->powers[MAGE_SSU];

                if (!IS_SET(ch->sohbits, SOH_SPECICE))
                {
                        stc("#CYou are not specialized in that elemental field!#n\n\r", ch);
                        return;
                }

                if (ch->mana < cost)
                {
                        stc("#pN#Pot enough mana!#n\n\r", ch);
                        return;
                }

                stc("#PY#0ou begin chanting the spidery language of magic...#n\n\r", ch);
                act("#C$n #0begins chanting the spidery language of magic...#n", ch, NULL, NULL, TO_ROOM);
                ch->mana -= cost;

                if (ch->pcdata->powers[MAGE_SORCERY] < 4)
                {
                        stc("#pYou attempt to cast the spell, but alas you haven't the knowledge.#n\n\r", ch);
                        stc("#CYour spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                if (failure >= chance)
                {
                        stc("#CYou mispronounce a syllable and your spell fizzles and leaves your mind!#n\n\r", ch);
                        WAIT_STATE(ch, lag);
                        return;
                }

                stc("#pY#Pour spell comes to mind.#n\n\r", ch);
                SET_BIT(ch->sohbits, SOH_SPELLSORC4);
                SET_BIT(ch->sohbits, SOH_SPELLREADY);
                WAIT_STATE(ch, lag);
                return;
        }

        else if (!str_cmp(arg1, "demonfire"))
        {
                int       lag;

                cost = 5000;
                failure = 110 - ch->pcdata->powers[MAGE_SSU] * 20;
                lag = 11 - ch->pcdata->powers[MAGE_SSU];

                if (!IS_SET(ch->sohbits, SOH_SPECFIRE))
                {
                        stc("#CYou are not specialized in that elemental field!#n\n\r", ch);
                        return;
                }

                if (ch->mana < cost)
                {
                        stc("#pN#Pot enough mana!#n\n\r", ch);
                        return;
                }

                stc("#PY#0ou begin chanting the spidery language of magic...#n\n\r", ch);
                act("#C$n #0begins chanting the spidery language of magic...#n", ch, NULL, NULL, TO_ROOM);
                ch->mana -= cost;

                if (c

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

Site Stats

Snippets: 1791
Codebases: 571