/*
    On the mud I used to play for almost ten years, had a mage class with some
	pretty nifty changes to come of the default spells. Basicly, teleport is
	a reversed version of do_summon but it's specific to mages.

	On that mud, mages would get locate object around level 6 or so, then around
	level 24, a mage would get teleport. It's simular to portal as it acts like
	a one way transportation spell but it has a drawback.. I removed the level
	check between the caster and the mob for one reason.. If you teleport to
	a mob that is much higher than you and you die, because he's aggie or whatever,
	then it's up to the player to be more carefull when using the spell.

    If you are a mage and you are in New Talos or some area other than Midgaard, you
	can simply type, c tele fido and you will go to that room provided you passed all
	of the room_flag checks.

	Chris
	cbunting99@gmail.com

    // EXAMPLE

	3074/3074hp 3183/3183m 2924/2928mv> c tele beggar
	You close your eyes and pray.
	You step out of a shimmering portal.
	The North Wall of the Tavern ( Inside )
	[Exits: east south west]
	Party-goers mingle here in front of the bar.  They seem to be
	having a great time and wish for you to join them.  You can
	continue on to the south, east or north.
	A townsman is here downing drinks.
	A beggar is here with his hand out.
	A townsman is here downing drinks.

	3074/3074hp 3148/3183m 2928/2928mv>

 */

// In const.c, make sure you change your spell to TAR_IGNORE AND POS_STANDING

    {
        "teleport", {},
        spell_teleport, TAR_IGNORE, POS_STANDING,
        NULL, 35, 12,
        "", "!Teleport!"},


// Replace teleport with the following code.

void spell_teleport (int sn, int level, CHAR_DATA * ch, void *vo, int target)
{
    CHAR_DATA *victim;
	ROOM_INDEX_DATA *from_room;

	from_room = ch->in_room;

    if ((victim = get_char_world (ch, target_name)) == NULL || victim == ch
            || victim->in_room == NULL
            || IS_SET (victim->in_room->room_flags, ROOM_SAFE)
            || IS_SET (victim->in_room->room_flags, ROOM_PRIVATE)
            || IS_SET (victim->in_room->room_flags, ROOM_SOLITARY)
            || IS_SET (victim->in_room->room_flags, ROOM_NO_RECALL)
		    || IS_SET (victim->in_room->room_flags, ROOM_NO_PORTAL)
		    || IS_SET (from_room->room_flags, ROOM_NO_PORTAL)
		    || victim->fighting != NULL
		    || (IS_NPC (victim) && saves_spell (level, victim)))
    {
        send_to_char ("Your spell fizzles.\n\r", ch);
        return;
    }

    act ("$n slowly fades out of existence.", ch, NULL, NULL, TO_ROOM);
    char_from_room (ch);
    char_to_room (ch, victim->in_room);
    act ("$n steps out of a shimmering portal.", ch, NULL, NULL, TO_ROOM);
	act ("You step out of a shimmering portal.", ch, NULL, NULL, TO_CHAR);
    do_look (ch, "auto");
    return;
}