00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #if defined(macintosh)
00029 #include <types.h>
00030 #else
00031 #include <sys/types.h>
00032 #endif
00033 #include <stdio.h>
00034 #include <stdlib.h>
00035 #include <string.h>
00036 #include <time.h>
00037 #include "merc.h"
00038 #include "interp.h"
00039 #include "magic.h"
00040
00041
00042 extern char *target_name;
00043
00044 void spell_farsight (int sn, int level, CHAR_DATA * ch, void *vo, int target)
00045 {
00046 if (IS_AFFECTED (ch, AFF_BLIND))
00047 {
00048 send_to_char ("Maybe it would help if you could see?\n\r", ch);
00049 return;
00050 }
00051
00052 do_function (ch, &do_scan, target_name);
00053 }
00054
00055
00056 void spell_portal (int sn, int level, CHAR_DATA * ch, void *vo, int target)
00057 {
00058 CHAR_DATA *victim;
00059 OBJ_DATA *portal, *stone;
00060
00061 if ((victim = get_char_world (ch, target_name)) == NULL
00062 || victim == ch
00063 || victim->in_room == NULL
00064 || !can_see_room (ch, victim->in_room)
00065 || IS_SET (victim->in_room->room_flags, ROOM_SAFE)
00066 || IS_SET (victim->in_room->room_flags, ROOM_PRIVATE)
00067 || IS_SET (victim->in_room->room_flags, ROOM_SOLITARY)
00068 || IS_SET (victim->in_room->room_flags, ROOM_NO_RECALL)
00069 || IS_SET (ch->in_room->room_flags, ROOM_NO_RECALL)
00070 || victim->level >= level + 3 || (!IS_NPC (victim) && victim->level >= LEVEL_HERO)
00071 || (IS_NPC (victim) && IS_SET (victim->imm_flags, IMM_SUMMON))
00072 || (IS_NPC (victim) && saves_spell (level, victim, DAM_NONE))
00073 || (is_clan (victim) && !is_same_clan (ch, victim)))
00074 {
00075 send_to_char ("You failed.\n\r", ch);
00076 return;
00077 }
00078
00079 stone = get_eq_char (ch, WEAR_HOLD);
00080 if (!IS_IMMORTAL (ch)
00081 && (stone == NULL || stone->item_type != ITEM_WARP_STONE))
00082 {
00083 send_to_char ("You lack the proper component for this spell.\n\r",
00084 ch);
00085 return;
00086 }
00087
00088 if (stone != NULL && stone->item_type == ITEM_WARP_STONE)
00089 {
00090 act ("You draw upon the power of $p.", ch, stone, NULL, TO_CHAR);
00091 act ("It flares brightly and vanishes!", ch, stone, NULL, TO_CHAR);
00092 extract_obj (stone);
00093 }
00094
00095 if ((portal = create_object (get_obj_index (OBJ_VNUM_PORTAL), 0)) == NULL)
00096 {
00097 send_to_char("ERROR: Create_object returned NULL, please seek a coder.\n\r",ch);
00098 return;
00099 }
00100
00101 portal->timer = 2 + level / 25;
00102 portal->value[3] = victim->in_room->vnum;
00103
00104 obj_to_room (portal, ch->in_room);
00105
00106 act ("$p rises up from the ground.", ch, portal, NULL, TO_ROOM);
00107 act ("$p rises up before you.", ch, portal, NULL, TO_CHAR);
00108 }
00109
00110 void spell_nexus (int sn, int level, CHAR_DATA * ch, void *vo, int target)
00111 {
00112 CHAR_DATA *victim;
00113 OBJ_DATA *portal, *stone;
00114 ROOM_INDEX_DATA *to_room, *from_room;
00115
00116 from_room = ch->in_room;
00117
00118 if ((victim = get_char_world (ch, target_name)) == NULL
00119 || victim == ch
00120 || (to_room = victim->in_room) == NULL
00121 || !can_see_room (ch, to_room) || !can_see_room (ch, from_room)
00122 || IS_SET (to_room->room_flags, ROOM_SAFE)
00123 || IS_SET (from_room->room_flags, ROOM_SAFE)
00124 || IS_SET (to_room->room_flags, ROOM_PRIVATE)
00125 || IS_SET (to_room->room_flags, ROOM_SOLITARY)
00126 || IS_SET (to_room->room_flags, ROOM_NO_RECALL)
00127 || IS_SET (from_room->room_flags, ROOM_NO_RECALL)
00128 || victim->level >= level + 3 || (!IS_NPC (victim) && victim->level >= LEVEL_HERO)
00129 || (IS_NPC (victim) && IS_SET (victim->imm_flags, IMM_SUMMON))
00130 || (IS_NPC (victim) && saves_spell (level, victim, DAM_NONE))
00131 || (is_clan (victim) && !is_same_clan (ch, victim)))
00132 {
00133 send_to_char ("You failed.\n\r", ch);
00134 return;
00135 }
00136
00137 stone = get_eq_char (ch, WEAR_HOLD);
00138 if (!IS_IMMORTAL (ch)
00139 && (stone == NULL || stone->item_type != ITEM_WARP_STONE))
00140 {
00141 send_to_char ("You lack the proper component for this spell.\n\r",
00142 ch);
00143 return;
00144 }
00145
00146 if (stone != NULL && stone->item_type == ITEM_WARP_STONE)
00147 {
00148 act ("You draw upon the power of $p.", ch, stone, NULL, TO_CHAR);
00149 act ("It flares brightly and vanishes!", ch, stone, NULL, TO_CHAR);
00150 extract_obj (stone);
00151 }
00152
00153
00154 if ((portal = create_object (get_obj_index (OBJ_VNUM_PORTAL), 0)) == NULL)
00155 {
00156 send_to_char("ERROR: Create_object returned NULL, please seek a coder.\n\r",ch);
00157 return;
00158 }
00159
00160 portal->timer = 1 + level / 10;
00161 portal->value[3] = to_room->vnum;
00162
00163 obj_to_room (portal, from_room);
00164
00165 act ("$p rises up from the ground.", ch, portal, NULL, TO_ROOM);
00166 act ("$p rises up before you.", ch, portal, NULL, TO_CHAR);
00167
00168
00169 if (to_room == from_room)
00170 return;
00171
00172
00173 if ((portal = create_object (get_obj_index (OBJ_VNUM_PORTAL), 0)) == NULL)
00174 {
00175 send_to_char("ERROR: Create_object returned NULL, please seek a coder.\n\r",ch);
00176 return;
00177 }
00178
00179 portal->timer = 1 + level / 10;
00180 portal->value[3] = from_room->vnum;
00181
00182 obj_to_room (portal, to_room);
00183
00184 if (to_room->people != NULL)
00185 {
00186 act ("$p rises up from the ground.", to_room->people, portal, NULL,
00187 TO_ROOM);
00188 act ("$p rises up from the ground.", to_room->people, portal, NULL,
00189 TO_CHAR);
00190 }
00191 }