[Circle] New Teleport

From: Franco (awe@mt.arias.net)
Date: 07/26/96


spell (how often is the original used anyway, cept by a few snoopy morts?). You
have to change the spello/mag_assign_spell or wotever functions in
spell_parser.c
to have the spell accept a TAR_VICT_WORLD (I think). 

                        Enjoy

                        Franco

/* New and improved teleport spell */
ASPELL(spell_teleport)
{
  struct room_data *newroom = 0;
  struct room_data *casting_room, *target_room;
  struct obj_data *foolz_objs;
  int randroom = 0, prob = 0, NR = 0, i;
  
  extern int top_of_world;

  if (ch == NULL || victim == NULL)
	  return;

  casting_room = &world[ch->in_room];
  target_room = &world[victim->in_room];

  if (GET_LEVEL(victim) > LVL_IMMORT && GET_LEVEL(ch) < LVL_IMMORT) {
	  send_to_char("Your mortal magic is foiled..\r\n", ch);
	  return;
  }
  /*
  if (IS_SET(casting_room->room_flags, ROOM_NOTELEPORT)) {
	  send_to_char("This room blocks your attempt to teleport.\r\n", ch);
	  return;
  }

  if (IS_SET(target_room->room_flags, ROOM_NOTELEPORT)) {
	  send_to_char("The destination room blocks your teleport.\r\n", ch);
	  return;
  }
  */
  if (IS_SET(casting_room->room_flags, ROOM_NOMAGIC)) {
	  send_to_char("Your magic fizzles out and dies.\r\n", ch);
	  return;
  }

  
  if (IS_NPC(victim)) {
	  send_to_char("You cannot get an image of the location..\r\n", ch);
	  return;
  }

  newroom = &world[victim->in_room];

  if (IS_SET(newroom->room_flags, ROOM_NOMAGIC)) {
	  send_to_char("Your destination's anti-magic barrier prevents the
spell.\r\n", ch);
	  return;
  }

  if (IS_SET(newroom->room_flags, ROOM_TUNNEL)) {
	  send_to_char("The size of the destination prevents your
teleportation.\r\n", ch);
	  return;
  }

  prob = number(1,100);

  if (GET_LEVEL(ch) >= LVL_IMMORT)
	  prob = 50;

  if (prob >= 3 && prob <= 90) {
	send_to_char("Your magic takes affect as your begin to shift
locations...\r\n", ch);
	act("$n slowly disappears, teleporting away.", TRUE, ch, 0, 0, TO_NOTVICT);

    NR = victim->in_room;

	char_from_room(ch);
	char_to_room(ch, NR);

	act("$n teleports into the room.", TRUE, ch, 0, 0, TO_ROOM);
	send_to_char("You have teleported on target..\r\n\r\n", ch);
	look_at_room(ch, 0);
	return;
  }
  
  if (prob < 3) {
	  send_to_char("Your spell goes awry as you teleport into solid
matter!\r\n\r\n", ch);
	  act("$n miscasts a teleport spell, and disappears.", TRUE, ch, 0, 0,
TO_NOTVICT);

  	  for (i = 0; i < NUM_WEARS; i++) 
		if (GET_EQ(ch, i))
		  unequip_char(ch, i);
	  while (ch->carrying) {
			foolz_objs = ch->carrying;
			extract_obj(foolz_objs);
	  }
	  extract_char(ch);
	  sprintf(buf, "(GC) %s has misteleported, attempting to teleport to %s,
and died.", GET_NAME(ch), GET_NAME(victim));
	  mudlog(buf, BRF, LVL_IMMORT, TRUE);
	  log(buf);
	  return;
  }

  if (prob < 90) {
	  send_to_char("Your spell goes awry as you teleport into an unknown
place!\r\n", ch);
	  act("$n miscasts a teleport spell, and disappears.", TRUE, 0, 0, 0,
TO_NOTVICT);

      do {
		randroom = number(0, top_of_world);
      }
	  while (ROOM_FLAGGED(randroom, ROOM_PRIVATE | ROOM_DEATH));

	
	  char_from_room(ch);
	  char_to_room(ch, randroom);
	  act("$n teleports into the room.", TRUE, ch, 0, 0, TO_ROOM);
	  send_to_char("You luckily have not died during teleportation.\r\n\r\n", ch);
	  look_at_room(victim, 0);
	  return;
  }
}

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/07/00 PST