/*************************************************************************** * Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer, * * Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe. * * * * Merc Diku Mud improvments copyright (C) 1992, 1993 by Michael * * Chastain, Michael Quan, and Mitchell Tse. * * * * In order to use any part of this Merc Diku Mud, you must comply with * * both the original Diku license in 'license.doc' as well the Merc * * license in 'license.txt'. In particular, you may not remove either of * * these copyright notices. * * * * Much time and thought has gone into this software and you are * * benefitting. We hope that you share your changes too. What goes * * around, comes around. * ***************************************************************************/ /*************************************************************************** * ROM 2.4 is copyright 1993-1998 Russ Taylor * * ROM has been brought to you by the ROM consortium * * Russ Taylor (rtaylor@hypercube.org) * * Gabrielle Taylor (gtaylor@hypercube.org) * * Brian Moore (zump@rom.org) * * By using this code, you have agreed to follow the terms of the * * ROM license, in the file Rom24/doc/rom.license * ***************************************************************************/ #if defined(macintosh) #include <types.h> #else #include <sys/types.h> #endif #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include "merc.h" #include "interp.h" #include "magic.h" extern char *target_name; void spell_farsight( int sn, int level, CHAR_DATA *ch, void *vo,int target) { if (IS_AFFECTED(ch,AFF_BLIND)) { send_to_char("Maybe it would help if you could see?\n\r",ch); return; } do_function(ch, &do_scan, target_name); } void spell_portal( int sn, int level, CHAR_DATA *ch, void *vo,int target) { CHAR_DATA *victim; OBJ_DATA *portal, *stone; if ( ( victim = get_char_world( ch, target_name ) ) == NULL || victim == ch || victim->in_room == NULL || !can_see_room(ch,victim->in_room) || 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(ch->in_room->room_flags, ROOM_NO_RECALL) || victim->level >= level + 3 || (!IS_NPC(victim) && victim->level >= LEVEL_HERO) /* NOT trust */ || (IS_NPC(victim) && IS_SET(victim->imm_flags,IMM_SUMMON)) || (IS_NPC(victim) && saves_spell( level, victim,DAM_NONE) ) || (is_clan(victim) && !is_same_clan(ch,victim))) { send_to_char( "You failed.\n\r", ch ); return; } stone = get_eq_char(ch,WEAR_HOLD); if (!IS_IMMORTAL(ch) && (stone == NULL || stone->item_type != ITEM_WARP_STONE)) { send_to_char("You lack the proper component for this spell.\n\r",ch); return; } if (stone != NULL && stone->item_type == ITEM_WARP_STONE) { act("You draw upon the power of $p.",ch,stone,NULL,TO_CHAR); act("It flares brightly and vanishes!",ch,stone,NULL,TO_CHAR); extract_obj(stone); } portal = create_object(get_obj_index(OBJ_VNUM_PORTAL),0); portal->timer = 2 + level / 25; portal->value[3] = victim->in_room->vnum; obj_to_room(portal,ch->in_room); act("$p rises up from the ground.",ch,portal,NULL,TO_ROOM); act("$p rises up before you.",ch,portal,NULL,TO_CHAR); } void spell_nexus( int sn, int level, CHAR_DATA *ch, void *vo, int target) { CHAR_DATA *victim; OBJ_DATA *portal, *stone; ROOM_INDEX_DATA *to_room, *from_room; from_room = ch->in_room; if ( ( victim = get_char_world( ch, target_name ) ) == NULL || victim == ch || (to_room = victim->in_room) == NULL || !can_see_room(ch,to_room) || !can_see_room(ch,from_room) || IS_SET(to_room->room_flags, ROOM_SAFE) || IS_SET(from_room->room_flags,ROOM_SAFE) || IS_SET(to_room->room_flags, ROOM_PRIVATE) || IS_SET(to_room->room_flags, ROOM_SOLITARY) || IS_SET(to_room->room_flags, ROOM_NO_RECALL) || IS_SET(from_room->room_flags,ROOM_NO_RECALL) || victim->level >= level + 3 || (!IS_NPC(victim) && victim->level >= LEVEL_HERO) /* NOT trust */ || (IS_NPC(victim) && IS_SET(victim->imm_flags,IMM_SUMMON)) || (IS_NPC(victim) && saves_spell( level, victim,DAM_NONE) ) || (is_clan(victim) && !is_same_clan(ch,victim))) { send_to_char( "You failed.\n\r", ch ); return; } stone = get_eq_char(ch,WEAR_HOLD); if (!IS_IMMORTAL(ch) && (stone == NULL || stone->item_type != ITEM_WARP_STONE)) { send_to_char("You lack the proper component for this spell.\n\r",ch); return; } if (stone != NULL && stone->item_type == ITEM_WARP_STONE) { act("You draw upon the power of $p.",ch,stone,NULL,TO_CHAR); act("It flares brightly and vanishes!",ch,stone,NULL,TO_CHAR); extract_obj(stone); } /* portal one */ portal = create_object(get_obj_index(OBJ_VNUM_PORTAL),0); portal->timer = 1 + level / 10; portal->value[3] = to_room->vnum; obj_to_room(portal,from_room); act("$p rises up from the ground.",ch,portal,NULL,TO_ROOM); act("$p rises up before you.",ch,portal,NULL,TO_CHAR); /* no second portal if rooms are the same */ if (to_room == from_room) return; /* portal two */ portal = create_object(get_obj_index(OBJ_VNUM_PORTAL),0); portal->timer = 1 + level/10; portal->value[3] = from_room->vnum; obj_to_room(portal,to_room); if (to_room->people != NULL) { act("$p rises up from the ground.",to_room->people,portal,NULL,TO_ROOM); act("$p rises up from the ground.",to_room->people,portal,NULL,TO_CHAR); } } /* new spells added below here */ void spell_iceshield( int sn, int level, CHAR_DATA *ch, void *vo, int target) { CHAR_DATA *victim = (CHAR_DATA *) vo; AFFECT_DATA af; if (IS_SHIELDED(victim, SHD_ICE)) { if(victim == ch) send_to_char("You are already surrounded by an {Cicy{x shield.\n\r", ch); else act("$N is already surrounded by an {Cicy{x shield.",ch,NULL,victim,TO_CHAR); return; } if (IS_NPC(victim)) { send_to_char("You failed.\n\r", ch); return; } /* if ( (skill_table[sn].skill_level[victim->class] > LEVEL_HERO) && (victim->level < LEVEL_IMMORTAL) ) { send_to_char("You are surrounded by an {Cicy{x shield.\n\r", victim); act("$n is surrounded by an {Cicy{x shield.",victim, NULL,NULL,TO_ROOM); send_to_char("Your {Cicy{x shield quickly melts away.\n\r", victim); act("$n's {Cicy{x shield quickly melts away.",victim, NULL,NULL,TO_ROOM); return; } */ af.where = TO_SHIELDS; af.type = sn; af.level = level; af.duration = level/6; af.location = APPLY_NONE; af.modifier = 0; af.bitvector = SHD_ICE; affect_to_char(victim, &af); send_to_char("You are surrounded by an {Cicy{x shield.\n\r", victim); act("$n is surrounded by an {Cicy{x shield.",victim, NULL,NULL,TO_ROOM); return; } void spell_fireshield(int sn, int level, CHAR_DATA *ch, void *vo, int target) { CHAR_DATA *victim = (CHAR_DATA *) vo; AFFECT_DATA af; if (IS_SHIELDED(victim, SHD_FIRE)) { if (victim == ch) send_to_char("You are already surrounded by a {Rfirey{x shield.\r\n", ch); else act("$N is already surrounded by a {Rfiery{x shield.",ch,NULL,victim,TO_CHAR); return; } if (IS_NPC(victim)) { send_to_char("You failed.\n\r", ch); return; } /* if ( (skill_table[sn].skill_level[victim->class] > LEVEL_HERO) && (victim->level < LEVEL_IMMORTAL) ) { send_to_char("You are surrounded by a {Rfiery{x shield.\n\r", victim); act("$n is surrounded by a {Rfiery{x shield.",victim, NULL,NULL,TO_ROOM); send_to_char("Your {Rfirey{x shield gutters out.\n\r", victim); act("$n's {Rfirey{x shield gutters out.",victim, NULL,NULL,TO_ROOM); return; } */ af.where = TO_SHIELDS; af.type = sn; af.level = level; af.duration = level/6; af.location = APPLY_NONE; af.modifier = 0; af.bitvector = SHD_FIRE; affect_to_char(victim, &af); send_to_char("You are surrounded by a {Rfiery{x shield.\n\r", victim); act("$n is surrounded by a {Rfiery{x shield.",victim, NULL,NULL,TO_ROOM); return; } void spell_shockshield(int sn, int level, CHAR_DATA *ch, void *vo, int target) { CHAR_DATA *victim = (CHAR_DATA *) vo; AFFECT_DATA af; if (IS_SHIELDED(victim, SHD_SHOCK)) { if (victim == ch) send_to_char("You are already surrounded in a {Bcrackling{x shield.\n\r", ch); else act("$N is already surrounded by a {Bcrackling{x shield.",ch, NULL, victim, TO_CHAR); return; } if (IS_NPC(victim)) { send_to_char("You failed.\n\r", ch); return; } /* if ( (skill_table[sn].skill_level[victim->class] > LEVEL_HERO) && (victim->level < LEVEL_IMMORTAL) ) { send_to_char("You are surrounded by a {Bcrackling{x shield.\n\r", victim); act("$n is surrounded by a {Bcrackling{x shield.",victim, NULL,NULL,TO_ROOM); send_to_char("Your {Bcrackling{x shield sizzles and fades.\n\r", victim); act("$n's {Bcrackling{x shield sizzles and fades.",victim, NULL,NULL,TO_ROOM); return; } */ af.where = TO_SHIELDS; af.type = sn; af.level = level; af.duration = level/6; af.location = APPLY_NONE; af.modifier = 0; af.bitvector = SHD_SHOCK; affect_to_char(victim, &af); send_to_char("You are surrounded by a {Bcrackling{x field.\n\r",victim); act("$n is surrounded by a {Bcrackling{x shield.",victim, NULL,NULL, TO_ROOM); return; } /* void spell_quest_pill( int sn, int level, CHAR_DATA *ch, void *vo,int target ) { CHAR_DATA *victim = (CHAR_DATA *) vo; if (IS_NPC(victim)) return; victim->qps++; send_to_char( "{YYou've gained a {RQuest Point{Y!{x\n\r", victim ); if ( ch != victim ) send_to_char( "Ok.\n\r", ch ); return; } */