--- act_comm.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/act_comm.c Sat Aug 14 16:03:25 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - **************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - /*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * * By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -76,6 +74,13 @@ update_clanlist(ch, ch->clead, FALSE, TRUE); if (is_clan(ch)) update_clanlist(ch, ch->clead, FALSE, FALSE); + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } sprintf( strsave, "%s%s", PLAYER_DIR, capitalize( ch->name ) ); wiznet("$N turns $Mself into line noise.",ch,NULL,0,0,0); stop_fighting(ch,TRUE); @@ -83,7 +88,7 @@ { update_wizlist(ch, 1); } - do_quit(ch,""); + do_quit(ch, ""); unlink(strsave); return; } @@ -115,37 +120,81 @@ if (IS_NPC(ch)) return; - if ((ch->class < MAX_CLASS/2) && (!IS_HERO(ch))) { - send_to_char("You must be a Hero in the first tier to reroll.\n\r",ch); - return; - } - if (ch->pcdata->confirm_reroll) { + DESCRIPTOR_DATA *d; + bool found = FALSE; + if (argument[0] != '\0') { send_to_char("Reroll status removed.\n\r",ch); ch->pcdata->confirm_reroll = FALSE; return; } - else + for ( d = descriptor_list; d != NULL; d = d->next ) { - if (is_clead(ch)) - update_clanlist(ch, ch->clead, FALSE, TRUE); - if (is_clan(ch)) - update_clanlist(ch, ch->clead, FALSE, FALSE); - sprintf( strsave, "%s%s", PLAYER_DIR, capitalize( ch->name ) ); - wiznet("$N turns $Mself into line noise.",ch,NULL,0,0,0); - stop_fighting(ch,TRUE); - SET_BIT( ch->act, PLR_REROLL ); - ch->pcdata->tier = 1; - if (ch->level > HERO) + if ( d->connected == CON_PLAYING && + d->character == ch) { - update_wizlist(ch, 1); + found = TRUE; + break; } - do_quit(ch,""); + } + if (!found) + { + send_to_char( "Can't find your descriptor, aborted\n\r",ch); return; - } + } + + if (is_clead(ch)) + update_clanlist(ch, ch->clead, FALSE, TRUE); + if (is_clan(ch)) + update_clanlist(ch, ch->clead, FALSE, FALSE); + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } + sprintf( strsave, "%s%s", PLAYER_DIR, capitalize( ch->name ) ); + wiznet("$N returns to $S birth.",ch,NULL,0,0,0); + stop_fighting(ch,TRUE); + if (ch->level > HERO) + update_wizlist(ch, 1); + if (ch->pcdata->tier == 1) + SET_BIT( ch->act, PLR_SECOND ); + if (ch->pcdata->tier == 2) + SET_BIT( ch->act, PLR_THIRD ); + send_to_char("Hit return to continue.\n\r", ch); + ch->was_in_room = ch->in_room; + char_from_room( ch ); + if ( ch == char_list ) + { + char_list = ch->next; + } + else + { + CHAR_DATA *prev; + + for ( prev = char_list; prev != NULL; prev = prev->next ) + { + if ( prev->next == ch ) + { + prev->next = ch->next; + break; + } + } + + if ( prev == NULL ) + { + bug( "Extract_char: char not found.", 0 ); + return; + } + } + + d->connected = CON_REROLL; + return; } if (argument[0] != '\0') @@ -155,7 +204,13 @@ } send_to_char("Type reroll again to confirm this command.\n\r",ch); - send_to_char("WARNING: this command is irreversible.\n\r",ch); + send_to_char("WARNING: this command is irreversible,\n\r",ch); + send_to_char("and will set you back to level 1, as a newbie!\n\r",ch); + send_to_char("You will lose {B{zEVERYTHING{x you are carrying!\n\r",ch); + if (IS_HERO(ch)) + { + send_to_char("{RIf you are moving to the next tier, see {zADVANCE{x{R instead!{x\n\r",ch); + } send_to_char("Typing reroll with an argument will undo reroll status.\n\r", ch); ch->pcdata->confirm_reroll = TRUE; @@ -163,6 +218,77 @@ } +void do_advance( CHAR_DATA *ch, char *argument) +{ + char arg[MAX_INPUT_LENGTH]; + char buf[MAX_STRING_LENGTH]; + char name[MAX_STRING_LENGTH]; + int old_tier; + + if (IS_NPC(ch)) + return; + + if (!IS_HERO(ch)) { + send_to_char("You must be a Hero to advance to next tier.\n\r",ch); + return; + } + + if (ch->pcdata->advanced != 0) + { + send_to_char("Sorry, only one advance per hero.\n\r",ch); + return; + } + + if (ch->pcdata->tier == 2) + { + send_to_char("Sorry, no fourth tier is available (yet).\n\r",ch); + return; + } + + argument = one_argument( argument, arg ); + + if (arg[0] == '\0') + { + send_to_char( "Syntax: advance .\n\r", ch ); + return; + } + + if ( check_char_exist( arg ) ) + { + send_to_char( "That name is already in use, or is illegal.\n\r", ch ); + return; + } + + old_tier = ch->pcdata->tier; + sprintf(name, "%s", str_dup(ch->name)); + ch->name = str_dup(arg); + ch->pcdata->tier++; + if (ch->pcdata->tier == 1) + SET_BIT( ch->act, PLR_SECOND ); + if (ch->pcdata->tier == 2) + SET_BIT( ch->act, PLR_THIRD ); + + save_char_obj( ch ); + + REMOVE_BIT( ch->act, PLR_SECOND ); + REMOVE_BIT( ch->act, PLR_THIRD ); + + buf[0] = '\0'; + strcat(buf, "A new pfile by the name "); + strcat(buf, capitalize(ch->name)); + strcat(buf, " has been saved.\n\r"); + + ch->name = str_dup(name); + ch->pcdata->tier = old_tier; + send_to_char( buf, ch ); + buf[0] = '\0'; + if (ch->level == LEVEL_HERO) + ch->pcdata->advanced = 1; + wiznet("$N has advanced to next tier.",ch,NULL,0,0,get_trust(ch)); + + return; +} + /* RT code to display channel status */ void do_channels( CHAR_DATA *ch, char *argument) @@ -254,6 +380,9 @@ if (IS_SET(ch->comm,COMM_STORE)) send_to_char("You store tells during fights.\n\r",ch); + if (IS_SET(ch->comm,COMM_TITLE_LOCK)) + send_to_char("Your title does not change when leveling.\n\r",ch); + if (IS_SET(ch->comm,COMM_SNOOP_PROOF)) send_to_char("You are immune to snooping.\n\r",ch); @@ -388,6 +517,11 @@ DESCRIPTOR_DATA *d; int wtime; + if (ch->newbie != 0) + { + send_to_char("You do not yet have access to this channel.\n\r",ch); + return; + } if (argument[0] == '\0' ) { if (IS_SET(ch->comm,COMM_NOAUCTION)) @@ -524,7 +658,12 @@ REMOVE_BIT(ch->comm,COMM_NOGOSSIP); - sprintf( buf, "You gossip '{H%s{x'\n\r", argument ); + if (ch->newbie != 0) + { + sprintf( buf, "You newbie '{a%s{x'\n\r", argument ); + } else { + sprintf( buf, "You gossip '{H%s{x'\n\r", argument ); + } send_to_char( buf, ch ); for ( d = descriptor_list; d != NULL; d = d->next ) { @@ -546,10 +685,23 @@ if (!str_cmp(ch->name,victim->pcdata->forget[pos])) found = TRUE; } + if ((ch->newbie != 0) && (!IS_IMMORTAL(victim)) + && (victim->newbie == 0)) + { + found = TRUE; + } if (!found) { - act_new( "$n gossips '{H$t{x'", - ch,argument, d->character, TO_VICT,POS_SLEEPING ); + if (ch->newbie != 0) + { + act_new( "$n newbies '{a$t{x'", + ch,argument, d->character, + TO_VICT,POS_SLEEPING ); + } else { + act_new( "$n gossips '{H$t{x'", + ch,argument, d->character, + TO_VICT,POS_SLEEPING ); + } } } } @@ -569,7 +721,12 @@ { send_to_char("You are not on a quest!\n\r",ch); return; - } + } + if (ch->newbie != 0) + { + send_to_char("You do not yet have access to this channel.\n\r",ch); + return; + } if (argument[0] == '\0' ) { if (IS_SET(ch->comm,COMM_NOQGOSSIP)) @@ -676,6 +833,13 @@ buf[0] = '\0'; bufy[0] = '\0'; bufz[0] = '\0'; + + if (ch->newbie != 0) + { + send_to_char("You do not yet have access to this channel.\n\r",ch); + return; + } + if (argument[0] == '\0' ) { if (IS_SET(ch->comm,COMM_NOGRATS)) @@ -775,6 +939,12 @@ DESCRIPTOR_DATA *d; int wtime; + if (ch->newbie != 0) + { + send_to_char("You do not yet have access to this channel.\n\r",ch); + return; + } + if (argument[0] == '\0' ) { if (IS_SET(ch->comm,COMM_NOQUOTE)) @@ -875,6 +1045,11 @@ DESCRIPTOR_DATA *d; int wtime; + if (ch->newbie != 0) + { + send_to_char("You do not yet have access to this channel.\n\r",ch); + return; + } if (argument[0] == '\0' ) { if (IS_SET(ch->comm,COMM_NOASK)) @@ -975,6 +1150,11 @@ DESCRIPTOR_DATA *d; int wtime; + if (ch->newbie != 0) + { + send_to_char("You do not yet have access to this channel.\n\r",ch); + return; + } if (argument[0] == '\0' ) { if (IS_SET(ch->comm,COMM_NOASK)) @@ -1075,6 +1255,12 @@ DESCRIPTOR_DATA *d; int wtime; + if (ch->newbie != 0) + { + send_to_char("You do not yet have access to this channel.\n\r",ch); + return; + } + if (argument[0] == '\0' ) { if (IS_SET(ch->comm,COMM_NOMUSIC)) @@ -1216,6 +1402,13 @@ return; } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } act( "$n says '{S$T{x'", ch, NULL, argument, TO_ROOM ); act( "You say '{S$T{x'", ch, NULL, argument, TO_CHAR ); return; @@ -1227,6 +1420,11 @@ { DESCRIPTOR_DATA *d; + if (ch->newbie != 0) + { + send_to_char("You do not yet have access to this channel.\n\r",ch); + return; + } if (argument[0] == '\0' ) { if (IS_SET(ch->comm,COMM_SHOUTSOFF)) @@ -1354,6 +1552,12 @@ victim->tells++; return; } + if ((ch->newbie != 0) && (!IS_IMMORTAL(victim)) + && (victim->newbie == 0)) + { + send_to_char("You can only tell to immortals or other newbies.\n\r",ch); + return; + } if (!IS_NPC(victim)) { @@ -1422,6 +1626,8 @@ return; } + if (argument[0] == '=') + argument++; act( "You tell $N '{U$t{x'", ch, argument, victim, TO_CHAR ); act_new("$n tells you '{U$t{x'",ch,argument,victim,TO_VICT,POS_DEAD); victim->reply = ch; @@ -1552,7 +1758,11 @@ send_to_char( "You can't yell.\n\r", ch ); return; } - + if (ch->newbie != 0) + { + send_to_char("You do not yet have access to this channel.\n\r",ch); + return; + } if ( argument[0] == '\0' ) { send_to_char( "Yell what?\n\r", ch ); @@ -1610,6 +1820,13 @@ return; } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } act( "{B$n $T{x", ch, NULL, argument, TO_ROOM ); act( "{B$n $T{x", ch, NULL, argument, TO_CHAR ); return; @@ -1635,6 +1852,13 @@ return; } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } act( "{c$n $t{x", ch, argument, NULL, TO_CHAR ); for (vch = ch->in_room->people; vch != NULL; vch = vch->next_in_room) @@ -2048,6 +2272,13 @@ level = UMIN( ch->level, sizeof(pose_table) / sizeof(pose_table[0]) - 1 ); pose = number_range(0, level); + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } if (ch->class < MAX_CLASS/2) { act( pose_table[pose].message[2*ch->class+0], ch, NULL, NULL, TO_CHAR ); @@ -2109,9 +2340,16 @@ send_to_char( "You're not DEAD yet.\n\r", ch ); return; } - send_to_char( "{rReality is attacking you!{x\n\r",ch); - send_to_char( "{cYou hit Reality hard!{x\n\r",ch); - send_to_char( "{BReality's truth does UNSPEAKABLE things to you!{x\n\r\n\r",ch); + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } + send_to_char( "{RReality is attacking you!{x\n\r",ch); + send_to_char( "{hYou hit Reality hard!{x\n\r",ch); + send_to_char( "{iReality's truth does UNSPEAKABLE things to you!{x\n\r\n\r",ch); WAIT_STATE(ch,25 * PULSE_VIOLENCE); act( "$n has left the game.", ch, NULL, NULL, TO_ROOM ); sprintf( log_buf, "%s has quit.", ch->name ); @@ -2161,18 +2399,27 @@ if ( ch->position == POS_FIGHTING ) { lose = (ch->desc != NULL) ? 25 : 50; - gain_exp( ch, 0 - lose ); + if (!IS_SET(ch->act, PLR_LQUEST)) + gain_exp( ch, 0 - lose ); stop_fighting( ch, TRUE ); } if ( ch->position < POS_STUNNED ) { lose = (ch->desc != NULL) ? 50 : 100; - gain_exp( ch, 0 - lose ); + if (!IS_SET(ch->act, PLR_LQUEST)) + gain_exp( ch, 0 - lose ); } - send_to_char( "{rReality is attacking you!{x\n\r",ch); - send_to_char( "{cYou hit Reality hard!{x\n\r",ch); - send_to_char( "{BReality's truth does UNSPEAKABLE things to you!{x\n\r\n\r",ch); + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } + send_to_char( "{RReality is attacking you!{x\n\r",ch); + send_to_char( "{hYou hit Reality hard!{x\n\r",ch); + send_to_char( "{iReality's truth does UNSPEAKABLE things to you!{x\n\r\n\r",ch); WAIT_STATE(ch,25 * PULSE_VIOLENCE); act( "$n has left the game.", ch, NULL, NULL, TO_ROOM ); sprintf( log_buf, "%s has quit.", ch->name ); @@ -2246,6 +2493,12 @@ return; } + if (IS_SET(victim->in_room->room_flags,ROOM_CLAN_ENT)) + { + send_to_char( "Not in this room!\n\r", ch); + return; + } + if ( victim == ch ) { if ( ch->master == NULL ) @@ -2274,6 +2527,13 @@ return; } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } REMOVE_BIT(ch->act,PLR_NOFOLLOW); if ( ch->master != NULL ) @@ -2494,9 +2754,17 @@ if ( is_same_group( gch, ch ) ) { sprintf( buf, - "[%2d %s] %-16s %4d/%4d hp %4d/%4d mana %4d/%4d mv %5ld xp\n\r", + "[%2d %s%s%s] %-16s %4d/%4d hp %4d/%4d mana %4d/%4d mv %5ld xp\n\r", gch->level, - IS_NPC(gch) ? "Mob" : class_table[gch->class].who_name, + IS_NPC(gch) ? "Mob": + (gch->pcdata->tier != 2) ? class_table[gch->class].who_name : + class_table[gch->class].swho_name, + IS_NPC(gch) ? "": + (gch->pcdata->tier != 2) ? "" : + "/", + IS_NPC(gch) ? "": + (gch->pcdata->tier != 2) ? "" : + class_table[gch->clasb].swho_name, capitalize( PERS(gch, ch) ), gch->hit, gch->max_hit, gch->mana, gch->max_mana, @@ -2754,6 +3022,11 @@ char buf[MAX_STRING_LENGTH]; CHAR_DATA *gch; + if (ch->newbie != 0) + { + send_to_char("You do not yet have access to this channel.\n\r",ch); + return; + } if ( argument[0] == '\0' ) { send_to_char( "Tell your group what?\n\r", ch ); @@ -2844,7 +3117,12 @@ send_to_char( " gossip grats gtell\n\r",ch); send_to_char( " immtalk music ask\n\r",ch); send_to_char( " quote say shout\n\r",ch); - send_to_char( " tell wiznet mobsay\n\r",ch); + send_to_char( " tell ", ch); + if (IS_IMMORTAL(ch)) + send_to_char( "wiznet", ch); + else + send_to_char( "levnet", ch); + send_to_char( " mobsay\n\r",ch); send_to_char( " room condition fight\n\r",ch); send_to_char( " opponent witness disarm\n\r",ch); send_to_char( " qgossip\n\r",ch); @@ -3022,10 +3300,10 @@ ch->color_tel = ccolor; send_to_char( "tell/reply channel set.\n\r",ch); } - else if (!str_prefix(arg,"wiznet")) + else if (!str_prefix(arg,"wiznet") || !str_prefix(arg,"levnet")) { ch->color_wiz = ccolor; - send_to_char( "wiznet channel set.\n\r",ch); + send_to_char( "wiznet/levnet channel set.\n\r",ch); } else if (!str_prefix(arg,"mobsay")) { --- act_enter.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/act_enter.c Sat Aug 14 20:31:11 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -95,6 +93,37 @@ return; } + if (portal->item_type == ITEM_CORPSE_PC && !str_cmp(portal->owner, ch->name) && ch->spirit) + { + OBJ_DATA *obj; + OBJ_DATA *obj_next; + + for ( obj = portal->contains; obj != NULL; obj = obj_next ) + { + obj_next = obj->next_content; + obj_from_obj( obj ); + if ( obj->item_type == ITEM_MONEY) + { + if (obj->value[0] > 0) + add_cost(ch,obj->value[0],VALUE_SILVER); + if (obj->value[1] > 0) + add_cost(ch,obj->value[1],VALUE_GOLD); + if (obj->value[2] > 0) + add_cost(ch,obj->value[2],VALUE_PLATINUM); + extract_obj( obj ); + } else { + obj_to_char( obj, ch ); + } + } + extract_obj( portal ); + ch->spirit = 0; + send_to_char("You reach down and touch your corpse, and are suddenly\n\r",ch); + send_to_char("sucked inside. You wake up to the agonizing pain of your last\n\r",ch); + send_to_char("battle, and slowly climb to your feet.\n\r",ch); + return; + } + + if (portal->item_type != ITEM_PORTAL || (IS_SET(portal->value[1],EX_CLOSED) && !IS_TRUSTED(ch,KNIGHT))) { @@ -123,6 +152,7 @@ if (location == NULL || location == old_room || !can_see_room(ch,location) + || !can_see_door(ch,(long)portal->value[1]) || (room_is_private(ch,location) && !IS_TRUSTED(ch,IMPLEMENTOR))) { act("$p doesn't seem to go anywhere.",ch,portal,NULL,TO_CHAR); @@ -158,7 +188,7 @@ else act("$n has arrived through $p.",ch,portal,NULL,TO_ROOM); - do_look(ch,"auto"); + do_look(ch, "auto"); /* charges */ if (portal->value[0] > 0) @@ -172,6 +202,37 @@ if (old_room == location) return; + if (ch->shadowed) + { + for ( fch = ch->shadower->in_room->people; fch != NULL; fch = fch->next_in_room ) + { + if (IS_NPC(fch)) + continue; + if (fch == ch->shadower) + continue; + if (!IS_IMMORTAL(fch)) + continue; + if (fch->level < get_trust(ch->shadower)) + continue; + act( "$n slips out of the room.", ch->shadower, NULL, fch, TO_VICT ); + } + char_from_room( ch->shadower ); + char_to_room( ch->shadower, location ); + for ( fch = ch->shadower->in_room->people; fch != NULL; fch = fch->next_in_room ) + { + if (IS_NPC(fch)) + continue; + if (fch == ch->shadower) + continue; + if (!IS_IMMORTAL(fch)) + continue; + if (fch->level < get_trust(ch->shadower)) + continue; + act( "$n silently slips into the room.", ch->shadower, NULL, fch, TO_VICT ); + } + act( "You follow $N.", ch->shadower, NULL, ch, TO_CHAR ); + do_look( ch->shadower, "auto" ); + } for ( fch = old_room->people; fch != NULL; fch = fch_next ) { fch_next = fch->next_in_room; @@ -182,7 +243,7 @@ if ( fch->master == ch && IS_AFFECTED(fch,AFF_CHARM) && fch->position < POS_STANDING) - do_stand(fch,""); + do_stand(fch, ""); if ( fch->master == ch && fch->position == POS_STANDING) { @@ -198,7 +259,7 @@ } act( "You follow $N.", fch, NULL, ch, TO_CHAR ); - do_enter(fch,argument); + do_enter(fch, argument); } } --- act_info.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/act_info.c Sat Aug 14 20:31:11 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -55,6 +53,7 @@ DECLARE_DO_FUN( do_affects ); DECLARE_DO_FUN( do_play ); DECLARE_DO_FUN( do_inventory ); +DECLARE_DO_FUN( do_mstat ); @@ -109,6 +108,7 @@ void show_char_to_char_1 args( ( CHAR_DATA *victim, CHAR_DATA *ch ) ); void show_char_to_char args( ( CHAR_DATA *list, CHAR_DATA *ch ) ); bool check_blind args( ( CHAR_DATA *ch ) ); +void check_lore args( ( CHAR_DATA *ch, OBJ_DATA *obj ) ); @@ -193,6 +193,7 @@ int count; bool fCombine; + /* * Alloc space for output lines. */ @@ -251,7 +252,7 @@ { if (prgpstrShow[iShow][0] == '\0') { - free_string(prgpstrShow[iShow]); + free_string(prgpstrShow[iShow], "act_info.c/show_list_to_char #1"); continue; } @@ -269,20 +270,20 @@ } add_buf(output,prgpstrShow[iShow]); add_buf(output,"\n\r"); - free_string( prgpstrShow[iShow] ); + free_string( prgpstrShow[iShow], "act_info.c/show_list_to_char #2" ); } if ( fShowNothing && nShow == 0 ) { if ( IS_NPC(ch) || IS_SET(ch->comm, COMM_COMBINE) ) - send_to_char( " ", ch ); - send_to_char( "Nothing.\n\r", ch ); + add_buf(output," "); + add_buf(output, "Nothing.\n\r"); } /* * Clean up. */ - free_mem( prgpstrShow, count * sizeof(char *) ); - free_mem( prgnShow, count * sizeof(int) ); + free_mem( prgpstrShow, count * sizeof(char *), "act_info.c/show_list_to_char #1" ); + free_mem( prgnShow, count * sizeof(int), "act_info.c/show_list_to_char #2" ); return output; } @@ -311,7 +312,11 @@ if ( IS_GOOD(victim) && IS_AFFECTED(ch, AFF_DETECT_GOOD) ) buf[32] = 'G'; if ( IS_SHIELDED(victim, SHD_SANCTUARY) ) buf[35] = 'S'; - if ( victim->on_quest) buf[38] = 'Q'; + if ( victim->on_quest ) + { + if (!IS_NPC(victim) || IS_IMMORTAL(ch)) + buf[38] = 'Q'; + } if (!strcmp(buf, "{x[{y.{D.{c.{b.{w.{C.{r.{B.{R.{Y.{W.{G.{x]") ) buf[0] = '\0'; if ( IS_SET(victim->comm,COMM_AFK ) ) strcat( buf, "[{yAFK{x]"); @@ -334,7 +339,11 @@ if ( IS_GOOD(victim) && IS_AFFECTED(ch, AFF_DETECT_GOOD) ) strcat( buf, "({YGolden Aura{x)"); if ( IS_SHIELDED(victim, SHD_SANCTUARY) ) strcat( buf, "({WWhite Aura{x)"); - if ( victim->on_quest) strcat( buf, "({GQuest{x)"); + if ( victim->on_quest ) + { + if (!IS_NPC(victim) || IS_IMMORTAL(ch)) + strcat( buf, "({GQuest{x)"); + } } if ( !IS_NPC(victim) && IS_SET(victim->act, PLR_TWIT ) ) strcat( buf, "({rTWIT{x)"); @@ -354,126 +363,132 @@ && victim->position == POS_STANDING && ch->on == NULL ) strcat( buf, victim->pcdata->title ); - switch ( victim->position ) + if (victim->spirit) + { + strcat( buf, " is DEAD!!" ); + } else { - case POS_DEAD: strcat( buf, " is DEAD!!" ); break; - case POS_MORTAL: strcat( buf, " is mortally wounded." ); break; - case POS_INCAP: strcat( buf, " is incapacitated." ); break; - case POS_STUNNED: strcat( buf, " is lying here stunned." ); break; - case POS_SLEEPING: - if (victim->on != NULL) - { - if (IS_SET(victim->on->value[2],SLEEP_AT)) - { - sprintf(message," is sleeping at %s.", - victim->on->short_descr); - strcat(buf,message); - } - else if (IS_SET(victim->on->value[2],SLEEP_ON)) - { - sprintf(message," is sleeping on %s.", - victim->on->short_descr); - strcat(buf,message); + switch ( victim->position ) + { + case POS_DEAD: strcat( buf, " is DEAD!!" ); break; + case POS_MORTAL: strcat( buf, " is mortally wounded." ); break; + case POS_INCAP: strcat( buf, " is incapacitated." ); break; + case POS_STUNNED: strcat( buf, " is lying here stunned." ); break; + case POS_SLEEPING: + if (victim->on != NULL) + { + if (IS_SET(victim->on->value[2],SLEEP_AT)) + { + sprintf(message," is sleeping at %s.", + victim->on->short_descr); + strcat(buf,message); + } + else if (IS_SET(victim->on->value[2],SLEEP_ON)) + { + sprintf(message," is sleeping on %s.", + victim->on->short_descr); + strcat(buf,message); + } + else + { + sprintf(message, " is sleeping in %s.", + victim->on->short_descr); + strcat(buf,message); + } } - else + else + strcat(buf," is sleeping here."); + break; + case POS_RESTING: + if (victim->on != NULL) { - sprintf(message, " is sleeping in %s.", - victim->on->short_descr); - strcat(buf,message); + if (IS_SET(victim->on->value[2],REST_AT)) + { + sprintf(message," is resting at %s.", + victim->on->short_descr); + strcat(buf,message); + } + else if (IS_SET(victim->on->value[2],REST_ON)) + { + sprintf(message," is resting on %s.", + victim->on->short_descr); + strcat(buf,message); + } + else + { + sprintf(message, " is resting in %s.", + victim->on->short_descr); + strcat(buf,message); + } } - } - else - strcat(buf," is sleeping here."); - break; - case POS_RESTING: - if (victim->on != NULL) - { - if (IS_SET(victim->on->value[2],REST_AT)) - { - sprintf(message," is resting at %s.", - victim->on->short_descr); - strcat(buf,message); - } - else if (IS_SET(victim->on->value[2],REST_ON)) - { - sprintf(message," is resting on %s.", - victim->on->short_descr); - strcat(buf,message); - } - else - { - sprintf(message, " is resting in %s.", - victim->on->short_descr); - strcat(buf,message); - } - } - else - strcat( buf, " is resting here." ); - break; - case POS_SITTING: - if (victim->on != NULL) - { - if (IS_SET(victim->on->value[2],SIT_AT)) - { - sprintf(message," is sitting at %s.", - victim->on->short_descr); - strcat(buf,message); - } - else if (IS_SET(victim->on->value[2],SIT_ON)) - { - sprintf(message," is sitting on %s.", - victim->on->short_descr); - strcat(buf,message); - } else + strcat( buf, " is resting here." ); + break; + case POS_SITTING: + if (victim->on != NULL) { - sprintf(message, " is sitting in %s.", - victim->on->short_descr); - strcat(buf,message); + if (IS_SET(victim->on->value[2],SIT_AT)) + { + sprintf(message," is sitting at %s.", + victim->on->short_descr); + strcat(buf,message); + } + else if (IS_SET(victim->on->value[2],SIT_ON)) + { + sprintf(message," is sitting on %s.", + victim->on->short_descr); + strcat(buf,message); + } + else + { + sprintf(message, " is sitting in %s.", + victim->on->short_descr); + strcat(buf,message); + } } - } - else - strcat(buf, " is sitting here."); - break; - case POS_STANDING: - if (victim->on != NULL) - { - if (IS_SET(victim->on->value[2],STAND_AT)) - { - sprintf(message," is standing at %s.", - victim->on->short_descr); - strcat(buf,message); - } - else if (IS_SET(victim->on->value[2],STAND_ON)) + else + strcat(buf, " is sitting here."); + break; + case POS_STANDING: + if (victim->on != NULL) { - sprintf(message," is standing on %s.", - victim->on->short_descr); - strcat(buf,message); + if (IS_SET(victim->on->value[2],STAND_AT)) + { + sprintf(message," is standing at %s.", + victim->on->short_descr); + strcat(buf,message); + } + else if (IS_SET(victim->on->value[2],STAND_ON)) + { + sprintf(message," is standing on %s.", + victim->on->short_descr); + strcat(buf,message); + } + else + { + sprintf(message," is standing in %s.", + victim->on->short_descr); + strcat(buf,message); + } } else + strcat( buf, " is here." ); + break; + case POS_FIGHTING: + strcat( buf, " is here, fighting " ); + if ( victim->fighting == NULL ) + strcat( buf, "thin air??" ); + else if ( victim->fighting == ch ) + strcat( buf, "YOU!" ); + else if ( victim->in_room == victim->fighting->in_room ) { - sprintf(message," is standing in %s.", - victim->on->short_descr); - strcat(buf,message); + strcat( buf, PERS( victim->fighting, ch ) ); + strcat( buf, "." ); } - } - else - strcat( buf, " is here." ); - break; - case POS_FIGHTING: - strcat( buf, " is here, fighting " ); - if ( victim->fighting == NULL ) - strcat( buf, "thin air??" ); - else if ( victim->fighting == ch ) - strcat( buf, "YOU!" ); - else if ( victim->in_room == victim->fighting->in_room ) - { - strcat( buf, PERS( victim->fighting, ch ) ); - strcat( buf, "." ); - } - else - strcat( buf, "someone who left??" ); - break; + else + strcat( buf, "someone who left??" ); + break; + } } strcat( buf, "\n\r" ); @@ -527,7 +542,9 @@ buf[0] = '\0'; strcpy( buf, PERS(victim, ch) ); - if (percent >= 100) + if (!IS_NPC(victim) && (victim->spirit)) + strcat (buf, " {fis DEAD!{x\n\r"); + else if (percent >= 100) strcat( buf, " {fis in excellent condition.{x\n\r"); else if (percent >= 90) strcat( buf, " {fhas a few scratches.{x\n\r"); @@ -570,8 +587,22 @@ for ( oWear = 0; oWear < MAX_WEAR; oWear++ ) { iWear = where_order[oWear]; - if ( ( obj = get_eq_char( victim, iWear ) ) != NULL - && can_see_obj( ch, obj ) ) + + if ((iWear == 17) && IS_NPC(victim) && !IS_NPC(ch) && (ch->can_aquest == 2) + && (victim->pIndexData->vnum == ch->pcdata->quest_mob)) + { + if ( !found ) + { + sprintf( buf, "\n\r"); + add_buf(output,buf); + sprintf( buf, "{G%s is using:{x\n\r", victim->name ); + add_buf(output,buf); + found = TRUE; + } + sprintf( buf, "%s%s\n\r", where_name[iWear], str_dup(ch->pcdata->lquest_obj)); + add_buf(output,buf); + } else if ( ( obj = get_eq_char( victim, iWear ) ) != NULL + && can_see_obj( ch, obj ) ) { if ( !found ) { @@ -620,6 +651,13 @@ if ( get_trust(ch) < rch->ghost_level) continue; + if ( rch->shadow ) + { + if (!IS_IMMORTAL(ch)) + continue; + if (get_trust(ch) < get_trust(rch)) + continue; + } if ( can_see( ch, rch ) ) { show_char_to_char_0( rch, ch ); @@ -1076,6 +1114,25 @@ } } +void do_titlelock(CHAR_DATA *ch, char *argument) +{ + if ( IS_SET(ch->act, PLR_NOTITLE) ) + { + send_to_char("Your title permissions have been revoked.\n\r",ch); + return; + } + if (IS_SET(ch->comm,COMM_TITLE_LOCK)) + { + send_to_char("Your title will now change with levels.\n\r",ch); + REMOVE_BIT(ch->comm,COMM_TITLE_LOCK); + } + else + { + send_to_char("Your title will no longer change with levels.\n\r",ch); + SET_BIT(ch->comm,COMM_TITLE_LOCK); + } +} + void do_prompt(CHAR_DATA *ch, char *argument) { char buf[MAX_STRING_LENGTH]; @@ -1102,13 +1159,12 @@ if ( strlen(argument) > 50 ) argument[50] = '\0'; strcpy( buf, argument ); - smash_tilde( buf ); if (str_suffix("%c",buf)) strcat(buf,"{x "); } - free_string( ch->prompt ); + free_string( ch->prompt, "act_info.c/do_prompt" ); ch->prompt = str_dup( buf ); sprintf(buf,"Prompt set to %s\n\r",ch->prompt ); send_to_char(buf,ch); @@ -1148,7 +1204,7 @@ void do_nofollow(CHAR_DATA *ch, char *argument) { - if (IS_NPC(ch)) + if (IS_NPC(ch) || IS_AFFECTED(ch, AFF_CHARM) ) return; if (IS_SET(ch->act,PLR_NOFOLLOW)) @@ -1215,6 +1271,49 @@ } } +void do_nocancel(CHAR_DATA *ch, char *argument) +{ + if (IS_NPC(ch)) + { + return; + } + else + { + if (IS_SET(ch->act,PLR_NOCANCEL)) + { + send_to_char("You are no longer immune to cancellation.\n\r",ch); + REMOVE_BIT(ch->act,PLR_NOCANCEL); + } + else + { + send_to_char("You are now immune to cancellation.\n\r",ch); + SET_BIT(ch->act,PLR_NOCANCEL); + } + } +} + +void show_warning( CHAR_DATA *ch ) +{ + if (IS_NPC(ch)) + return; + if ( ch->desc == NULL ) + return; + if ( ch->in_room == NULL ) + return; + if (IS_IMMORTAL(ch)) + return; + + if ( ch->in_room->warn[0] != '\0' ) + { + char buf[MAX_STRING_LENGTH]; + + sprintf(buf, "\n\r%s\n\r", str_dup(ch->in_room->warn)); + send_to_char(buf, ch); + buf[0] = '\0'; + } + return; +} + void do_look( CHAR_DATA *ch, char *argument ) { char buf [MAX_STRING_LENGTH]; @@ -1235,17 +1334,22 @@ if ( ch->position < POS_SLEEPING ) { send_to_char( "You can't see anything but stars!\n\r", ch ); + show_warning( ch ); return; } if ( ch->position == POS_SLEEPING ) { send_to_char( "You can't see anything, you're sleeping!\n\r", ch ); + show_warning( ch ); return; } if ( !check_blind( ch ) ) + { + show_warning( ch ); return; + } if ( !IS_NPC(ch) && !IS_SET(ch->act, PLR_HOLYLIGHT) @@ -1253,6 +1357,7 @@ { send_to_char( "It is pitch black ... \n\r", ch ); show_char_to_char( ch->in_room->people, ch ); + show_warning( ch ); return; } @@ -1283,8 +1388,12 @@ send_to_char( ch->in_room->description, ch ); if (ch->in_room->vnum == chain) { - send_to_char("A huge black iron chain as thick as a tree trunk is drifting above the ground\n\r",ch); - send_to_char("here.\n\r",ch); + send_to_char("\n\r A huge black iron chain as thick as a ",ch); + send_to_char("tree trunk is drifting above the\n\rground here.\n\r",ch); + } + if (ch->in_room->vnum == ladder) + { + send_to_char("\n\r A floating rope ladder leads up into a cloud.\n\r",ch); } } @@ -1298,6 +1407,7 @@ page_to_char( buf_string(outlist), ch ); free_buf(outlist); show_char_to_char( ch->in_room->people, ch ); + show_warning( ch ); return; } @@ -1361,6 +1471,13 @@ if ( ( victim = get_char_room( ch, arg1 ) ) != NULL ) { + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } show_char_to_char_1( victim, ch ); return; } @@ -1371,29 +1488,40 @@ { /* player can see object */ pdesc = get_extra_descr( arg3, obj->extra_descr ); if ( pdesc != NULL ) + { if (++count == number) { + if (obj->quest) + send_to_char("{YThis is a quest item.{x\n\r",ch); send_to_char( pdesc, ch ); + check_lore(ch, obj); return; - } - else continue; - + } else {continue;} + } pdesc = get_extra_descr( arg3, obj->pIndexData->extra_descr ); if ( pdesc != NULL ) + { if (++count == number) { + if (obj->quest) + send_to_char("{YThis is a quest item.{x\n\r",ch); send_to_char( pdesc, ch ); + check_lore(ch, obj); return; - } - else continue; - + } else {continue;} + } if ( is_name( arg3, obj->name ) ) + { if (++count == number) { + if (obj->quest) + send_to_char("{YThis is a quest item.{x\n\r",ch); send_to_char( obj->description, ch ); send_to_char( "\n\r",ch); + check_lore(ch, obj); return; - } + } + } } } @@ -1405,6 +1533,8 @@ if ( pdesc != NULL ) if (++count == number) { + if (obj->quest) + send_to_char("{YThis is a quest item.{x\n\r",ch); send_to_char( pdesc, ch ); return; } @@ -1413,16 +1543,20 @@ if ( pdesc != NULL ) if (++count == number) { + if (obj->quest) + send_to_char("{YThis is a quest item.{x\n\r",ch); send_to_char( pdesc, ch ); return; } - if ( is_name( arg3, obj->name ) ) - if (++count == number) - { - send_to_char( obj->description, ch ); - send_to_char("\n\r",ch); - return; - } + if ( is_name( arg3, obj->name ) ) + if (++count == number) + { + if (obj->quest) + send_to_char("{YThis is a quest item.{x\n\r",ch); + send_to_char( obj->description, ch ); + send_to_char("\n\r",ch); + return; + } } } @@ -1487,10 +1621,212 @@ act( "The $d is open.", ch, NULL, pexit->keyword, TO_CHAR ); } } + return; +} + +void check_lore( CHAR_DATA *ch, OBJ_DATA *obj ) +{ + char buf[MAX_STRING_LENGTH]; + int chance; + int level; + bool found; + + if ( (chance = get_skill(ch,gsn_lore) ) == 0) + { + return; + } + + found = FALSE; + level = UMAX(1, obj->level); + if (number_percent() < (chance-(level/10))) + { + sprintf(buf,"{GYou must be level %d or above to use this.{x\n\r", + obj->level); + send_to_char(buf, ch); + found = TRUE; + } + if (number_percent() < (chance-(level/3))) + { + sprintf(buf,"{GThis is worth around %d silver.{x\n\r", + obj->cost); + send_to_char(buf, ch); + found = TRUE; + } + if (number_percent() < (chance-(level/5))) + { + sprintf(buf,"{GThis weighs %d pounds.{x\n\r", + obj->weight / 10); + send_to_char(buf, ch); + found = TRUE; + } + if (number_percent() < (chance-(level/4))) + { + if (is_clan_obj(obj)) + { + sprintf( buf, "{GThis object is owned by the {x[{%s%s{x]{G clan.{x\n\r", + clan_table[obj->clan].pkill ? "B" : "M", + clan_table[obj->clan].who_name + ); + send_to_char( buf, ch ); + found = TRUE; + } + + if (is_class_obj(obj)) + { + GUILD_DATA *guild; + send_to_char( "Guild Object: ", ch); + for (guild = obj->pIndexData->guild; guild != NULL; guild = guild->next) + { + sprintf(buf, "{%s%c{%s%c%c%c%c ", + guild->guild < MAX_CLASS/2 ? "R" : "B", + class_table[guild->guild].who_name[0], + guild->guild < MAX_CLASS/2 ? "r" : "b", + class_table[guild->guild].who_name[1], + class_table[guild->guild].who_name[2], + class_table[guild->guild].who_name[3], + class_table[guild->guild].who_name[4]); + send_to_char(buf, ch); + } + send_to_char("{x\n\r", ch); + found = TRUE; + } + } + if (number_percent() < (chance-(level/2))) + { + switch ( obj->item_type ) + { + case ITEM_SCROLL: + case ITEM_POTION: + case ITEM_PILL: + sprintf( buf, "{G This has level %d spells of:", obj->value[0] ); + send_to_char( buf, ch ); + + if ( obj->value[1] >= 0 && obj->value[1] < MAX_SKILL ) + { + send_to_char( " '", ch ); + send_to_char( skill_table[obj->value[1]].name, ch ); + send_to_char( "'", ch ); + } + + if ( obj->value[2] >= 0 && obj->value[2] < MAX_SKILL ) + { + send_to_char( " '", ch ); + send_to_char( skill_table[obj->value[2]].name, ch ); + send_to_char( "'", ch ); + } + + if ( obj->value[3] >= 0 && obj->value[3] < MAX_SKILL ) + { + send_to_char( " '", ch ); + send_to_char( skill_table[obj->value[3]].name, ch ); + send_to_char( "'", ch ); + } + + if (obj->value[4] >= 0 && obj->value[4] < MAX_SKILL) + { + send_to_char(" '",ch); + send_to_char(skill_table[obj->value[4]].name,ch); + send_to_char("'",ch); + } + + send_to_char( ".{x\n\r", ch ); + break; + + case ITEM_WAND: + case ITEM_STAFF: + sprintf( buf, "{GThis has %d charges of level %d", + obj->value[2], obj->value[0] ); + send_to_char( buf, ch ); + + if ( obj->value[3] >= 0 && obj->value[3] < MAX_SKILL ) + { + send_to_char( " '", ch ); + send_to_char( skill_table[obj->value[3]].name, ch ); + send_to_char( "'", ch ); + } + + send_to_char( ".{x\n\r", ch ); + break; + + case ITEM_DRINK_CON: + sprintf(buf,"{GIt holds %s-colored %s.{x\n\r", + liq_table[obj->value[2]].liq_color, + liq_table[obj->value[2]].liq_name); + send_to_char(buf,ch); + break; + case ITEM_CONTAINER: + case ITEM_PIT: + sprintf(buf,"{GCapacity: %d# Maximum weight: %d#{x\n\r", + obj->value[0], obj->value[3]); + send_to_char(buf,ch); + if (obj->value[4] != 100) + { + sprintf(buf,"{GWeight multiplier: %d%%{x\n\r", + obj->value[4]); + send_to_char(buf,ch); + } + break; + + case ITEM_WEAPON: + send_to_char("{GThis is a",ch); + switch (obj->value[0]) + { + case(WEAPON_EXOTIC) : send_to_char("n exotic",ch); break; + case(WEAPON_SWORD) : send_to_char(" sword",ch); break; + case(WEAPON_DAGGER) : send_to_char(" dagger",ch); break; + case(WEAPON_SPEAR) : send_to_char(" spear/staff",ch); break; + case(WEAPON_MACE) : send_to_char(" mace/club",ch); break; + case(WEAPON_AXE) : send_to_char("n axe",ch); break; + case(WEAPON_FLAIL) : send_to_char(" flail",ch); break; + case(WEAPON_WHIP) : send_to_char(" whip",ch); break; + case(WEAPON_POLEARM): send_to_char(" polearm",ch); break; + default : send_to_char("n unknown",ch); break; + } + send_to_char(" type weapon.{x\n\r", ch); + if (obj->clan) + { + sprintf( buf, "{GDamage is variable.{x\n\r"); + } else + { + if (obj->pIndexData->new_format) + sprintf(buf,"{GDamage is %dd%d (average %d).{x\n\r", + obj->value[1],obj->value[2], + (1 + obj->value[2]) * obj->value[1] / 2); + else + sprintf( buf, "{GDamage is %d to %d (average %d).{x\n\r", + obj->value[1], obj->value[2], + ( obj->value[1] + obj->value[2] ) / 2 ); + } + send_to_char( buf, ch ); + if (obj->value[4]) /* weapon flags */ + { + sprintf(buf,"{GWeapons flags: %s{x\n\r",weapon_bit_name(obj->value[4])); send_to_char(buf,ch); + } + break; + + case ITEM_ARMOR: + if (obj->clan) + { + sprintf( buf, "{GArmor class is variable.{x\n\r"); + } else + { + sprintf( buf, + "{GArmor class is %d pierce, %d bash, %d slash, and %d vs. magic.{x\n\r", + obj->value[0], obj->value[1], obj->value[2], obj->value[3] ); + } + send_to_char( buf, ch ); + break; + } + found = TRUE; + } + if (found) + check_improve(ch,gsn_lore,TRUE,1); + buf[0] = '\0'; return; } + /* RT added back for the hell of it */ void do_read (CHAR_DATA *ch, char *argument ) { @@ -1525,28 +1861,55 @@ break; case ITEM_MONEY: - if (obj->value[0] == 0) + if (obj->value[0] == 0 && obj->value[1] == 0 && obj->value[2] == 0) { - if (obj->value[1] == 0) - sprintf(buf,"Odd...there's no coins in the pile.\n\r"); - else if (obj->value[1] == 1) - sprintf(buf,"Wow. One gold coin.\n\r"); - else - sprintf(buf,"There are %d gold coins in the pile.\n\r", - obj->value[1]); - } - else if (obj->value[1] == 0) + sprintf(buf,"Odd...there's no coins in the pile.\n\r"); + } else if (obj->value[0] == 0) { - if (obj->value[0] == 1) - sprintf(buf,"Wow. One silver coin.\n\r"); - else - sprintf(buf,"There are %d silver coins in the pile.\n\r", - obj->value[0]); + if (obj->value[1] == 0) + { + if (obj->value[2] == 1) + { + sprintf(buf,"Wow. One {Wplatinum{x coin.\n\r"); + } else + { + sprintf(buf,"There are {W%d platinum{x coins in the pile.\n\r", + obj->value[2]); + } + } else + { + if (obj->value[2] == 0) + { + if (obj->value[1] == 1) + { + sprintf(buf,"Wow. One {Ygold{x coin.\n\r"); + } else + { + sprintf(buf,"There are {Y%d gold{x coins in the pile.\n\r", + obj->value[1]); + } + } else + { + sprintf(buf,"There are {W%d platinum{x and {Y%d gold{x coins in the pile.\n\r", + obj->value[2], obj->value[1]); + } + } + } else if (obj->value[1] == 0 && obj->value[2] == 0) + { + sprintf(buf,"Wow. One {wsilver{x coin.\n\r"); + } else if (obj->value[2] == 0) + { + sprintf(buf,"There are {Y%d gold{x and {w%d silver{x coins in the pile.\n\r", + obj->value[1], obj->value[0]); + } else if (obj->value[1] == 0) + { + sprintf(buf,"There are {W%d platinum{x and {w%d silver{x coins in the pile.\n\r", + obj->value[2], obj->value[0]); + } else + { + sprintf(buf,"There are {W%d platinum{x, {Y%d gold{x, and {w%d silver{x coins in the pile.\n\r", + obj->value[2], obj->value[1], obj->value[0]); } - else - sprintf(buf, - "There are %d gold and %d silver coins in the pile.\n\r", - obj->value[1],obj->value[0]); send_to_char(buf,ch); break; @@ -1602,6 +1965,7 @@ if ( ( pexit = ch->in_room->exit[outlet] ) != NULL && pexit->u1.to_room != NULL && can_see_room(ch,pexit->u1.to_room) + && can_see_door(ch,pexit->exit_info) && !IS_SET(pexit->exit_info, EX_CLOSED) ) { found = TRUE; @@ -1632,7 +1996,7 @@ ROOM_INDEX_DATA *to_room; portal = get_obj_exit( dir_name[door], ch->in_room->contents ); - if (portal != NULL) + if (portal != NULL && can_see_door(ch,(long)portal->value[1]) ) { found = TRUE; round = TRUE; @@ -1693,17 +2057,24 @@ } +/* + * do_score modifications by Vengeance and Artema + */ void do_score( CHAR_DATA *ch, char *argument ) { char buf[MAX_STRING_LENGTH]; BUFFER *output; int i; + if (IS_NPC(ch)) + { + do_mstat(ch,"self"); + return; + } + output = new_buf(); sprintf( buf, - "{xYou are {G%s{x%s{x\n\r", - ch->name, - IS_NPC(ch) ? ", the mobile." : ch->pcdata->title); + "{xYou are {G%s{x%s{x\n\r", ch->name, ch->pcdata->title); add_buf(output,buf); sprintf( buf, @@ -1718,12 +2089,24 @@ add_buf(output,buf); } - sprintf(buf, "{xRace: {M%s{x Sex: {M%s{x Class: {M%s{x\n\r", + if (ch->home) + { + sprintf( buf, "{xYour home town is {G%s{x.\n\r", + home_table[ch->home].who_name ); + add_buf(output,buf); + } else + { + sprintf( buf, "{xYou do not yet have a home town.\n\r"); + add_buf(output,buf); + } + + sprintf(buf, "{xRace: {M%s{x Sex: {M%s{x Class: {R%s {B%s{x Size: {M%s{x\n\r", race_table[ch->race].name, ch->sex == 0 ? "sexless" : ch->sex == 1 ? "male" : "female", - IS_NPC(ch) ? "mobile" : class_table[ch->class].name); + class_table[ch->class].name, + (ch->pcdata->tier != 2) ? "" : class_table[ch->clasb].name, + size_table[ch->size].name); add_buf(output,buf); - sprintf( buf, "{xYou have {G%d{x/{B%d{x hit, {G%d{x/{B%d{x mana, {G%d{x/{B%d{x movement.\n\r", @@ -1733,10 +2116,41 @@ add_buf(output,buf); sprintf( buf, - "{xYou have {B%d{x practices and {B%d{x training sessions.\n\r", - ch->practice, ch->train); + "{xYou have {M%d{x practice%s, {Y%d{x train%s, and {G%d{x quest point%s.\n\r", + ch->practice, ch->practice == 1 ? "" : "s", + ch->train, ch->train == 1 ? "" : "s", + ch->qps, ch->qps == 1 ? "" : "s" ); add_buf(output,buf); + if (is_clan(ch)) + { + sprintf( buf, + "{xYou are in the [{G%s{x] clan, which is a %s clan.\n\r", + clan_table[ch->clan].who_name, + is_pkill(ch) ? "{RPkill{x" : "{WNon-Pkill{x"); + add_buf(output,buf); + if (is_pkill(ch)) + { + sprintf( buf, + "{xPkill: {R%d {xPdeath: {R%d {xOff Flee: {B%d {xDef Flee: {B%d{x\n\r", + ch->pcdata->pkills, ch->pcdata->pdeath, + ch->pcdata->aflee, ch->pcdata->dflee); + add_buf(output,buf); + } + } + if (ch->clock) + { + if ((ch->clock <= ch->level) || IS_IMMORTAL(ch)) + { + ch->clock = 0; + } else + { + sprintf( buf, + "{xYou may not change your clan status till level {Y%d{x.\n\r", + ch->clock ); + add_buf(output,buf); + } + } sprintf( buf, "{xYou are carrying {G%d{x/{B%d{x items with weight {G%ld{x/{B%d{x pounds.\n\r", ch->carry_number, can_carry_n(ch), @@ -1758,20 +2172,54 @@ add_buf(output,buf); sprintf( buf, - "{xYou have {Y%ld{x platinum, {Y%ld{x gold and {Y%ld{x silver coins.\n\r", + "{xYou have {W%ld platinum{x, {Y%ld gold{x and {w%ld silver{x coins.\n\r", ch->platinum, ch->gold, ch->silver); add_buf(output,buf); - + for (i = 0; i < MAX_BANKS; i++) + { + if (ch->balance[i] > 0) + { + sprintf( buf, "{R%-35s{W%6ld platinum.{x", + bank_table[i].name, ch->balance[i]); + add_buf(output,buf); + if (is_compromised(ch, i) ) + { + sprintf(buf, " {R{zcompromised{x\n\r"); + } else { + sprintf(buf, "\n\r"); + } + add_buf(output,buf); + } + } if (!IS_NPC(ch) && ch->level == LEVEL_HERO) { sprintf( buf,"{xYou have scored {C%ld exp{x.\n\r",ch->exp); add_buf(output,buf); - } else if (!IS_NPC(ch) && ch->level < LEVEL_HERO) { + } else if (!IS_NPC(ch) && (ch->level < LEVEL_HERO) && !IS_SET(ch->act, PLR_LQUEST)) { sprintf( buf,"{xYou have scored {C%ld exp{x. You need {C%ld exp{x to level.\n\r", ch->exp, ((ch->level + 1) * exp_per_level(ch,ch->pcdata->points) - ch->exp)); add_buf(output,buf); } + if (IS_SET(ch->act, PLR_LQUEST)) + { + if (ch->can_aquest == 2) + { + sprintf( buf, "{RYou are currently level questing for the {Y%s{R.\n\r", + str_dup(ch->pcdata->lquest_obj) ); + add_buf(output,buf); + sprintf( buf, "{R Which you will find on {Y%s{R.\n\r", + str_dup(ch->pcdata->lquest_mob) ); + add_buf(output,buf); + sprintf( buf, "{R In the area of {Y%s{R.{x\n\r", + str_dup(ch->pcdata->lquest_are) ); + add_buf(output,buf); + } else { + sprintf( buf, "{RYou must complete a quest for next level!{x\n\r"); + add_buf(output,buf); + } + } + if (ch->wimpy) { sprintf( buf, "Wimpy set to %d hit points.\n\r", ch->wimpy ); @@ -1793,7 +2241,13 @@ sprintf(buf, "{yYou are hungry.{x\n\r"); add_buf(output,buf); } - + + if (ch->spirit) + { + sprintf(buf, "{RYou are DEAD!!{x\n\r"); + add_buf(output,buf); + } else + { switch ( ch->position ) { case POS_DEAD: @@ -1829,12 +2283,13 @@ add_buf(output,buf); break; } + } /* print AC values */ if (ch->level >= 25) { - sprintf( buf,"{xArmor: pierce: {G%d{x bash: {G%d{x slash: {G%d{x magic: {G%d{x\n\r", + sprintf( buf,"{xArmor: pierce: {G%d{x bash: {G%d{x slash: {G%d{x exotic: {G%d{x\n\r", GET_AC(ch,AC_PIERCE), GET_AC(ch,AC_BASH), GET_AC(ch,AC_SLASH), @@ -1851,7 +2306,7 @@ case(AC_PIERCE): temp = "piercing"; break; case(AC_BASH): temp = "bashing"; break; case(AC_SLASH): temp = "slashing"; break; - case(AC_EXOTIC): temp = "magic"; break; + case(AC_EXOTIC): temp = "exotic"; break; default: temp = "error"; break; } @@ -1876,10 +2331,12 @@ sprintf(buf,"{yvery well-armored{x against %s.\n\r",temp); else if (GET_AC(ch,i) >= -60) sprintf(buf,"{Bheavily armored{x against %s.\n\r",temp); - else if (GET_AC(ch,i) >= -80) - sprintf(buf,"{Bsuperbly armored{x against %s.\n\r",temp); else if (GET_AC(ch,i) >= -100) - sprintf(buf,"{Balmost invulnerable{x to %s.\n\r",temp); + sprintf(buf,"{Bsuperbly armored{x against %s.\n\r",temp); + else if (GET_AC(ch,i) >= -200) + sprintf(buf,"{Ynear invulnerable{x to %s.\n\r",temp); + else if (GET_AC(ch,i) >= -300) + sprintf(buf,"{Yalmost invulnerable{x to %s.\n\r",temp); else sprintf(buf,"{Wdivinely armored{x against %s.\n\r",temp); @@ -1893,31 +2350,38 @@ sprintf(buf,"Holy Light: "); add_buf(output,buf); if (IS_SET(ch->act,PLR_HOLYLIGHT)) - sprintf(buf,"on"); + sprintf(buf,"{Won{x"); else - sprintf(buf,"off"); + sprintf(buf,"{Roff{x"); add_buf(output,buf); if (ch->invis_level) { - sprintf( buf, " Invisible: level %d",ch->invis_level); + sprintf( buf, " Invisible: level {W%d{x",ch->invis_level); add_buf(output,buf); } if (ch->incog_level) { - sprintf(buf," Incognito: level %d",ch->incog_level); + sprintf(buf," Incognito: level {W%d{x",ch->incog_level); add_buf(output,buf); } + + if (ch->ghost_level) + { + sprintf(buf," Ghost: level {W%d{x",ch->ghost_level); + add_buf(output,buf); + } + sprintf(buf,"\n\r"); add_buf(output,buf); } if ( ch->level >= 15 ) { - sprintf( buf, "{xHitroll: {G%d{x Damroll: {G%d{x.\n\r", - GET_HITROLL(ch), GET_DAMROLL(ch) ); + sprintf( buf, "{xHitroll: {G%d{x Damroll: {G%d{x Saves: {G%d{x.\n\r", + GET_HITROLL(ch), GET_DAMROLL(ch), ch->saving_throw ); add_buf(output,buf); } @@ -1929,26 +2393,35 @@ sprintf(buf, "{xYou are "); add_buf(output,buf); - if ( ch->alignment > 900 ) sprintf(buf, "{Wangelic{x.\n\r"); - else if ( ch->alignment > 700 ) sprintf(buf, "{Wsaintly{x.\n\r"); + if ( ch->alignment > 900 ) sprintf(buf, "{WThoth's chosen{x.\n\r"); + else if ( ch->alignment > 700 ) sprintf(buf, "{WThoth's servant{x.\n\r"); + else if ( ch->alignment > 500 ) sprintf(buf, "{wsaintly{x.\n\r"); else if ( ch->alignment > 350 ) sprintf(buf, "{wgood{x.\n\r"); - else if ( ch->alignment > 100 ) sprintf(buf, "kind.\n\r"); - else if ( ch->alignment > -100 ) sprintf(buf, "neutral.\n\r"); - else if ( ch->alignment > -350 ) sprintf(buf, "mean.\n\r"); - else if ( ch->alignment > -700 ) sprintf(buf, "{revil{x.\n\r"); - else if ( ch->alignment > -900 ) sprintf(buf, "{Rdemonic{x.\n\r"); - else sprintf(buf, "{Rsatanic{x.\n\r"); + else if ( ch->alignment > 225 ) sprintf(buf, "{ykind{x.\n\r"); + else if ( ch->alignment > 100 ) sprintf(buf, "{ynice{x.\n\r"); + else if ( ch->alignment > -100 ) sprintf(buf, "{yneutral{x.\n\r"); + else if ( ch->alignment > -225 ) sprintf(buf, "{yunkind{x.\n\r"); + else if ( ch->alignment > -350 ) sprintf(buf, "{ymean{x.\n\r"); + else if ( ch->alignment > -500 ) sprintf(buf, "{revil{x.\n\r"); + else if ( ch->alignment > -700 ) sprintf(buf, "{rdemonic{x.\n\r"); + else if ( ch->alignment > -900 ) sprintf(buf, "{RBelan's servant{x.\n\r"); + else sprintf(buf, "{RBelan's chosen{x.\n\r"); add_buf(output,buf); - if (ch->qps) + if (ch->pcdata->is_aquest) { - if (ch->qps == 1) - sprintf( buf, "{xYou have {M%d{x quest point.\n\r", ch->qps ); - else - sprintf( buf, "{xYou have {M%d{x quest points.\n\r", ch->qps ); + sprintf( buf, "{xYou are currently auto questing for {Y%s{x.\n\r", + str_dup(ch->pcdata->lquest_obj) ); + add_buf(output,buf); + sprintf( buf, "{x Which you will find on {Y%s{x.\n\r", + str_dup(ch->pcdata->lquest_mob) ); + add_buf(output,buf); + sprintf( buf, "{x In the area of {Y%s{x.\n\r", + str_dup(ch->pcdata->lquest_are) ); add_buf(output,buf); } + if (ch->invited) { sprintf( buf, "{RYou have been invited to join clan {x[{%s%s{x]\n\r", @@ -1956,6 +2429,12 @@ clan_table[ch->invited].who_name); add_buf(output,buf); } + if ( ch->pcdata->deity ) + { + sprintf( buf, "{RYou are devoted to: {W%s{R and your favor is: {W%d{R.{x\n\r", + ch->pcdata->deity->name, ch->pcdata->favor ); + add_buf( output, buf ); + } page_to_char( buf_string(output), ch ); free_buf(output); @@ -1977,26 +2456,34 @@ for ( paf = ch->affected; paf != NULL; paf = paf->next ) { if (paf_last != NULL && paf->type == paf_last->type) + { if (ch->level >= 20) + { sprintf( buf, " "); - else + } else + { continue; - else - sprintf( buf, "Spell: %-15s", skill_table[paf->type].name ); - + } + } else + { + sprintf( buf, "Spell: {W%-15s{x", skill_table[paf->type].name ); + } add_buf(output,buf); if ( ch->level >= 20 ) { sprintf( buf, - ": modifies %s by %d ", + ": modifies {R%s{x by {G%d{x ", affect_loc_name( paf->location ), paf->modifier); add_buf(output,buf); if ( paf->duration == -1 ) - sprintf( buf, "permanently" ); - else - sprintf( buf, "for %d hours", paf->duration ); + { + sprintf( buf, "{Bpermanently{x" ); + } else + { + sprintf( buf, "for {B%d hours{x", paf->duration ); + } add_buf(output,buf); } @@ -2004,8 +2491,7 @@ add_buf(output,buf); paf_last = paf; } - } - else + } else { sprintf(buf,"You are not affected by any spells.\n\r"); add_buf(output,buf); @@ -2129,9 +2615,12 @@ * Strip leading '.' to allow initial blanks. */ if ( pHelp->text[0] == '.' ) + { page_to_char( pHelp->text+1, ch ); - else + } else + { page_to_char( pHelp->text , ch ); + } return; } } @@ -2175,6 +2664,12 @@ if (!can_see(ch,wch)) continue; + if (IS_NPC(wch)) + continue; + + if (wch->level > MAX_LEVEL) + continue; + if (!str_prefix(arg,wch->name)) { found = TRUE; @@ -2217,15 +2712,25 @@ if (wch->class < MAX_CLASS/2) { - sprintf(class, "{R%c{r%c%c{x", + sprintf(class, "{R%c{r%c%c%c%c{x", class_table[wch->class].who_name[0], class_table[wch->class].who_name[1], - class_table[wch->class].who_name[2]); - } else { - sprintf(class, "{B%c{b%c%c{x", + class_table[wch->class].who_name[2], + class_table[wch->class].who_name[3], + class_table[wch->class].who_name[4]); + } else if (wch->pcdata->tier != 2) { + sprintf(class, "{B%c{b%c%c%c%c{x", class_table[wch->class].who_name[0], class_table[wch->class].who_name[1], - class_table[wch->class].who_name[2]); + class_table[wch->class].who_name[2], + class_table[wch->class].who_name[3], + class_table[wch->class].who_name[4]); + } else { + sprintf(class, "{R%c{r%c{x/{B%c{b%c{x", + class_table[wch->class].swho_name[0], + class_table[wch->class].swho_name[1], + class_table[wch->clasb].swho_name[0], + class_table[wch->clasb].swho_name[1]); } /* a little formatting */ @@ -2256,19 +2761,30 @@ sprintf(clandat, "[{m%s{x] ", clan_table[wch->clan].who_name); } } - sprintf(buf, "[%s %-6s %s] %s%s%s%s%s%s%s%s\n\r", + sprintf(buf, "[%s {%s%-6s{x %s] %s%s%s%s%s%s{%s%s{x%s\n\r", buf2, + wch->sex == 1 ? "C" : wch->sex == 2 ? "M" : "w", wch->race < MAX_PC_RACE ? pc_race_table[wch->race].who_name - : " ", + : " ", class, - ((wch->ghost_level >= LEVEL_HERO)&&(ch->level >= wch->level)) ? "(Ghost) ": "", - wch->incog_level >= LEVEL_HERO ? "(Incog) ": "", - wch->invis_level >= LEVEL_HERO ? "(Wizi) " : "", - clandat, - IS_SET(wch->comm, COMM_AFK) ? "[{yAFK{x] " : "", - IS_SET(wch->act,PLR_TWIT) ? "({RTWIT{x) " : "", - wch->name, IS_NPC(wch) ? "" : wch->pcdata->title); + ((wch->ghost_level >= LEVEL_HERO)&&(ch->level >= wch->level)) + ? "(Ghost) ": "", + wch->incog_level >= LEVEL_HERO ? "(Incog) ": "", + wch->invis_level >= LEVEL_HERO ? "(Wizi) " : "", + clandat, + IS_SET(wch->comm, COMM_AFK) ? "[{yAFK{x] " : "", + IS_SET(wch->act,PLR_TWIT) ? "({RTWIT{x) " : "", + wch->newbie != 0 ? "M" : "x", + wch->name, + IS_NPC(wch) ? "" : wch->pcdata->title); add_buf(output,buf); + if ( is_clan(wch) && is_pkill(wch) ) + { + sprintf(buf, "{GPkill: {R%d {GPdeath: {R%d {YOff Flee: {B%d {YDef Flee: {B%d{x\n\r", + wch->pcdata->pkills, wch->pcdata->pdeath, + wch->pcdata->aflee, wch->pcdata->dflee); + add_buf(output,buf); + } } } @@ -2310,15 +2826,19 @@ bool fClan = FALSE; bool fRaceRestrict = FALSE; bool fImmortalOnly = FALSE; + bool fPkillOnly = FALSE; int count; int countimm; int hour; + int pkval; + int clevel; /* * Set default arguments. */ iLevelLower = 0; iLevelUpper = MAX_LEVEL; + pkval = 0; for ( iClass = 0; iClass < MAX_CLASS; iClass++ ) rgfClass[iClass] = FALSE; for ( iRace = 0; iRace < MAX_PC_RACE; iRace++ ) @@ -2361,6 +2881,10 @@ { fImmortalOnly = TRUE; } + else if (!str_prefix(arg,"pkill")) + { + fPkillOnly = TRUE; + } else { iClass = class_lookup(arg); @@ -2413,8 +2937,10 @@ outputimm = new_buf(); add_buf(outputimm,"{xVisible {GImmortals{x:\n\r"); add_buf(output,"{xVisible {GMortals{x:\n\r"); - for ( d = descriptor_list; d != NULL; d = d->next ) + for (clevel = MAX_LEVEL; clevel > LEVEL_HERO; clevel--) { + for ( d = descriptor_list; d != NULL; d = d->next ) + { CHAR_DATA *wch; char class[MAX_STRING_LENGTH]; @@ -2427,9 +2953,15 @@ wch = ( d->original != NULL ) ? d->original : d->character; + if (wch->level != clevel) + continue; + if (!can_see(ch,wch) && IS_SHIELDED(wch,SHD_INVISIBLE)) continue; + if (fPkillOnly) + continue; + if (!can_see(ch,wch) && wch->level >= SQUIRE && ch->level < wch->level ) continue; @@ -2437,6 +2969,9 @@ if (!IS_IMMORTAL(wch)) continue; + if (wch->level > MAX_LEVEL) + continue; + if ( wch->level < iLevelLower || wch->level > iLevelUpper || ( fImmortalOnly && wch->level < LEVEL_IMMORTAL ) @@ -2488,19 +3023,28 @@ } } - if (wch->class < MAX_CLASS/2) - { - sprintf(class, "{R%c{r%c%c{x", - class_table[wch->class].who_name[0], - class_table[wch->class].who_name[1], - class_table[wch->class].who_name[2]); - - } else { - sprintf(class, "{B%c{b%c%c{x", - class_table[wch->class].who_name[0], - class_table[wch->class].who_name[1], - class_table[wch->class].who_name[2]); - } + if (wch->class < MAX_CLASS/2) + { + sprintf(class, "{R%c{r%c%c%c%c{x", + class_table[wch->class].who_name[0], + class_table[wch->class].who_name[1], + class_table[wch->class].who_name[2], + class_table[wch->class].who_name[3], + class_table[wch->class].who_name[4]); + } else if (wch->pcdata->tier != 2) { + sprintf(class, "{B%c{b%c%c%c%c{x", + class_table[wch->class].who_name[0], + class_table[wch->class].who_name[1], + class_table[wch->class].who_name[2], + class_table[wch->class].who_name[3], + class_table[wch->class].who_name[4]); + } else { + sprintf(class, "{R%c{r%c{x/{B%c{b%c{x", + class_table[wch->class].swho_name[0], + class_table[wch->class].swho_name[1], + class_table[wch->clasb].swho_name[0], + class_table[wch->clasb].swho_name[1]); + } /* * Format it up. @@ -2554,8 +3098,9 @@ IS_NPC(wch) ? "" : wch->pcdata->title ); } else { - sprintf( buf, "[%s %-6s %s] %s%s%s%s%s%s%s%s%s\n\r", + sprintf( buf, "[%s {%s%-6s{x %s] %s%s%s%s%s%s%s%s%s\n\r", buf2, + wch->sex == 1 ? "C" : wch->sex == 2 ? "M" : "w", wch->race < MAX_PC_RACE ? pc_race_table[wch->race].who_name : " ", class, @@ -2570,11 +3115,14 @@ IS_NPC(wch) ? "" : wch->pcdata->title ); } add_buf(outputimm,buf); + } } add_buf(outputimm,"\n\r"); buf[0] = '\0'; - for ( d = descriptor_list; d != NULL; d = d->next ) + for (clevel = LEVEL_HERO; clevel > 0; clevel--) { + for ( d = descriptor_list; d != NULL; d = d->next ) + { CHAR_DATA *wch; char class[MAX_STRING_LENGTH]; @@ -2587,6 +3135,9 @@ wch = ( d->original != NULL ) ? d->original : d->character; + if (wch->level != clevel) + continue; + if (!can_see(ch,wch) && IS_SHIELDED(wch,SHD_INVISIBLE)) continue; @@ -2597,6 +3148,12 @@ if (IS_IMMORTAL(wch)) continue; + if (fPkillOnly) + { + if ((pkval = pk_range(ch,wch)) == 0) + continue; + } + count++; if ((wch->in_room->vnum == ROOM_VNUM_CORNER) @@ -2628,30 +3185,54 @@ } } - if (wch->class < MAX_CLASS/2) - { - sprintf(class, "{R%c{r%c%c{x", - class_table[wch->class].who_name[0], - class_table[wch->class].who_name[1], - class_table[wch->class].who_name[2]); - } else { - sprintf(class, "{B%c{b%c%c{x", - class_table[wch->class].who_name[0], - class_table[wch->class].who_name[1], - class_table[wch->class].who_name[2]); - } + if (wch->class < MAX_CLASS/2) + { + sprintf(class, "{R%c{r%c%c%c%c{x", + class_table[wch->class].who_name[0], + class_table[wch->class].who_name[1], + class_table[wch->class].who_name[2], + class_table[wch->class].who_name[3], + class_table[wch->class].who_name[4]); + } else if (wch->pcdata->tier != 2) { + sprintf(class, "{B%c{b%c%c%c%c{x", + class_table[wch->class].who_name[0], + class_table[wch->class].who_name[1], + class_table[wch->class].who_name[2], + class_table[wch->class].who_name[3], + class_table[wch->class].who_name[4]); + } else { + sprintf(class, "{R%c{r%c{x/{B%c{b%c{x", + class_table[wch->class].swho_name[0], + class_table[wch->class].swho_name[1], + class_table[wch->clasb].swho_name[0], + class_table[wch->clasb].swho_name[1]); + } /* * Format it up. */ if (!wch->on_quest) { - questdat[0]='\0'; + if (fPkillOnly) + { + sprintf(questdat, "[{%s%s{x] ", + pkval == 1 ? "Y" : pkval == 2 ? "g" : "r", + pkval == 1 ? "O" : pkval == 2 ? "C" : "D"); + } else { + questdat[0]='\0'; + } } else { - sprintf(questdat, "[{GQ{x] "); + if (fPkillOnly) + { + sprintf(questdat, "[{%s%s{x] [{GQ{x] ", + pkval == 1 ? "Y" : pkval == 2 ? "g" : "r", + pkval == 1 ? "O" : pkval == 2 ? "C" : "D"); + } else { + sprintf(questdat, "[{GQ{x] "); + } } if (!is_clan(wch)) - { + { sprintf(clandat, "%s", clan_table[wch->clan].who_name); } else @@ -2677,38 +3258,46 @@ sprintf(clandat, "[{m%s{x] ", clan_table[wch->clan].who_name); } } - if (wch->pcdata->who_descr[0] != '\0') + if ((wch->pcdata->who_descr[0] != '\0') + || (wch->in_room->vnum == ROOM_VNUM_CORNER)) { - sprintf( buf, "[%s %s] %s%s%s%s%s%s%s%s%s\n\r", + sprintf( buf, "[%s %s] %s%s%s%s%s%s%s{%s%s{x%s\n\r", buf2, - wch->pcdata->who_descr, + wch->in_room->vnum == ROOM_VNUM_CORNER + ? "{R!CORNERED!{x" : wch->pcdata->who_descr, questdat, clandat, - ((wch->ghost_level >= LEVEL_HERO)&&(ch->level >= wch->level)) ? "(Ghost) ": "", + ((wch->ghost_level >= LEVEL_HERO)&&(ch->level >= wch->level)) + ? "(Ghost) ": "", wch->incog_level >= LEVEL_HERO ? "(Incog) " : "", wch->invis_level >= LEVEL_HERO ? "(Wizi) " : "", IS_SET(wch->comm, COMM_AFK) ? "[{yAFK{x] " : "", IS_SET(wch->act, PLR_TWIT) ? "({RTWIT{x) " : "", + wch->newbie != 0 ? "M" : "x", wch->name, IS_NPC(wch) ? "" : wch->pcdata->title ); } else { - sprintf( buf, "[%s %-6s %s] %s%s%s%s%s%s%s%s%s\n\r", + sprintf( buf, "[%s {%s%-6s{x %s] %s%s%s%s%s%s%s{%s%s{x%s\n\r", buf2, + wch->sex == 1 ? "C" : wch->sex == 2 ? "M" : "w", wch->race < MAX_PC_RACE ? pc_race_table[wch->race].who_name - : " ", + : " ", class, questdat, clandat, - ((wch->ghost_level >= LEVEL_HERO)&&(ch->level >= wch->level)) ? "(Ghost) ": "", + ((wch->ghost_level >= LEVEL_HERO)&&(ch->level >= wch->level)) + ? "(Ghost) ": "", wch->incog_level >= LEVEL_HERO ? "(Incog) " : "", wch->invis_level >= LEVEL_HERO ? "(Wizi) " : "", IS_SET(wch->comm, COMM_AFK) ? "[{yAFK{x] " : "", IS_SET(wch->act, PLR_TWIT) ? "({RTWIT{x) " : "", + wch->newbie != 0 ? "M" : "x", wch->name, IS_NPC(wch) ? "" : wch->pcdata->title ); } add_buf(output,buf); + } } count += countimm; @@ -2720,6 +3309,7 @@ is_pm = FALSE; max_on = 0; expire_notes(); + expire_banks(); randomize_entrances( ROOM_VNUM_CLANS ); } } else @@ -2769,6 +3359,7 @@ is_pm = FALSE; max_on = 0; expire_notes(); + expire_banks(); randomize_entrances( ROOM_VNUM_CLANS ); } } else @@ -2985,12 +3576,22 @@ CHAR_DATA *victim; DESCRIPTOR_DATA *d; bool found; + bool is_arena; one_argument( argument, arg ); if ( arg[0] == '\0' ) { - send_to_char( "Players near you:\n\r", ch ); + if (IS_SET(ch->in_room->room_flags,ROOM_ARENA)) + { + send_to_char( "Players in the arena:\n\r", ch ); + is_arena = TRUE; + } + else + { + send_to_char( "Players near you:\n\r", ch ); + is_arena = FALSE; + } found = FALSE; for ( d = descriptor_list; d; d = d->next ) { @@ -3005,10 +3606,22 @@ && get_trust(ch) >= victim->ghost_level && can_see( ch, victim ) ) { - found = TRUE; - sprintf( buf, "%-28s %s\n\r", - victim->name, victim->in_room->name ); - send_to_char( buf, ch ); + if (is_arena) + { + if (IS_SET(victim->in_room->room_flags,ROOM_ARENA)) + { + sprintf( buf, "%-28s\n\r", + victim->name ); + send_to_char( buf, ch ); + found = TRUE; + } + } else + { + sprintf( buf, "%-28s %s\n\r", + victim->name, victim->in_room->name ); + send_to_char( buf, ch ); + found = TRUE; + } } } if ( !found ) @@ -3016,6 +3629,10 @@ } else { + if (IS_SET(ch->in_room->room_flags,ROOM_ARENA)) + is_arena = TRUE; + else + is_arena = FALSE; found = FALSE; for ( victim = char_list; victim != NULL; victim = victim->next ) { @@ -3027,15 +3644,33 @@ && can_see( ch, victim ) && is_name( arg, victim->name ) ) { - found = TRUE; - sprintf( buf, "%-28s %s\n\r", - PERS(victim, ch), victim->in_room->name ); - send_to_char( buf, ch ); - break; + if (is_arena) + { + if (IS_SET(victim->in_room->room_flags,ROOM_ARENA)) + { + sprintf( buf, "%-28s\n\r", + PERS(victim, ch )); + send_to_char( buf, ch ); + found = TRUE; + break; + } + } else + { + sprintf( buf, "%-28s %s\n\r", + PERS(victim, ch), victim->in_room->name ); + send_to_char( buf, ch ); + found = TRUE; + break; + } } } if ( !found ) - act( "You didn't find any $T.", ch, NULL, arg, TO_CHAR ); + { + if (is_arena) + send_to_char("No-one by that name is in the arena.\n\r",ch); + else + act( "You didn't find any $T.", ch, NULL, arg, TO_CHAR ); + } } return; @@ -3065,6 +3700,13 @@ return; } + if (ch->spirit) + { + send_to_char( "Spirits cannot track.\n\r", ch); + return; + } + + in_room = ch->in_room; track_vnum = in_room->vnum; move = movement_loss[UMIN(SECT_MAX-1, in_room->sector_type)]; @@ -3247,7 +3889,7 @@ strcpy( buf, title ); } - free_string( ch->pcdata->title ); + free_string( ch->pcdata->title, "act_info.c/set_title" ); ch->pcdata->title = str_dup( buf ); return; } @@ -3262,7 +3904,10 @@ return; if ( IS_SET(ch->act, PLR_NOTITLE) ) + { + send_to_char("Your title permissions have been revoked.\n\r",ch); return; + } if ((ch->in_room->vnum == ROOM_VNUM_CORNER) && (!IS_IMMORTAL(ch))) @@ -3290,7 +3935,6 @@ argument[value+1] = 'x'; argument[value+2] = '\0'; } - smash_tilde( argument ); set_title( ch, argument ); send_to_char( "Ok.\n\r", ch ); } @@ -3304,7 +3948,6 @@ if ( argument[0] != '\0' ) { buf[0] = '\0'; - smash_tilde( argument ); if (argument[0] == '-') { @@ -3332,7 +3975,7 @@ else /* found the second one */ { buf[len + 1] = '\0'; - free_string(ch->description); + free_string(ch->description, "act_info.c/do_description #1"); ch->description = str_dup(buf); send_to_char( "Your description is:\n\r", ch ); send_to_char( ch->description ? ch->description : @@ -3342,7 +3985,7 @@ } } buf[0] = '\0'; - free_string(ch->description); + free_string(ch->description, "act_info.c/do_description #2"); ch->description = str_dup(buf); send_to_char("Description cleared.\n\r",ch); return; @@ -3356,6 +3999,12 @@ argument++; } + if (strlen(argument) > 80) + { + send_to_char( "Maximum of 80 characters per line.\n\r", ch); + return; + } + if ( strlen(buf) + strlen(argument) >= MAX_STRING_LENGTH - 2 ) { send_to_char( "Description too long.\n\r", ch ); @@ -3364,7 +4013,7 @@ strcat( buf, argument ); strcat( buf, "\n\r" ); - free_string( ch->description ); + free_string( ch->description, "act_info.c/do_description #3" ); ch->description = str_dup( buf ); } @@ -3409,6 +4058,12 @@ if ( IS_NPC(ch) ) return; + if (ch->spirit) + { + send_to_char( "Spirits can't practice.\n\r", ch); + return; + } + if ( argument[0] == '\0' ) { int col; @@ -3416,17 +4071,45 @@ col = 0; for ( sn = 0; sn < MAX_SKILL; sn++ ) { + bool found = FALSE; + if ( skill_table[sn].name == NULL ) break; - if ( ch->level < skill_table[sn].skill_level[ch->class] - || ch->pcdata->learned[sn] < 1 /* skill is not known */) - continue; - sprintf( buf, "%-18s %3d%% ", - skill_table[sn].name, ch->pcdata->learned[sn] ); - send_to_char( buf, ch ); - if ( ++col % 3 == 0 ) - send_to_char( "\n\r", ch ); + if (ch->pcdata->learned[sn] == 0) + continue; + if ( ch->level >= skill_table[sn].skill_level[ch->class]) + { + found = TRUE; + sprintf( buf, "{R%-18s %3d%% {x", + skill_table[sn].name, ch->pcdata->learned[sn] ); + } + if (ch->pcdata->tier == 2) + { + if ( ch->level >= skill_table[sn].skill_level[ch->clasb]) + { + sprintf( buf, "{B%-18s %3d%% {x", + skill_table[sn].name, ch->pcdata->learned[sn] ); + if (found) + { + sprintf( buf, "{G%-18s %3d%% {x", + skill_table[sn].name, ch->pcdata->learned[sn] ); + } + found = TRUE; + } + } + if (!found && (ch->pcdata->learned[sn] > 1)) + { + found = TRUE; + sprintf( buf, "%-18s %3d%% ", + skill_table[sn].name, ch->pcdata->learned[sn] ); + } + if (found) + { + send_to_char( buf, ch ); + if ( ++col % 3 == 0 ) + send_to_char( "\n\r", ch ); + } } if ( col % 3 != 0 ) @@ -3471,12 +4154,43 @@ || ch->pcdata->learned[sn] < 1 /* skill is not known */ || skill_table[sn].rating[ch->class] == 0))) { - send_to_char( "You can't practice that.\n\r", ch ); - return; + if (IS_NPC(ch)) + { + send_to_char( "You can't practice that.\n\r", ch ); + return; + } + if (ch->pcdata->tier != 2) + { + send_to_char( "You can't practice that.\n\r", ch ); + return; + } + if ( ( sn = find_spell( ch,argument ) ) < 0 + || ( !IS_NPC(ch) + && (ch->level < skill_table[sn].skill_level[ch->clasb] + || ch->pcdata->learned[sn] < 1 /* skill is not known */ + || skill_table[sn].rating[ch->clasb] == 0))) + { + send_to_char( "You can't practice that.\n\r", ch ); + return; + } } adept = IS_NPC(ch) ? 100 : class_table[ch->class].skill_adept; - + if (!IS_NPC(ch)) + { + if (ch->pcdata->tier == 2) + { + if (skill_table[sn].rating[ch->clasb] == 0) + adept = class_table[ch->class].skill_adept; + else if (skill_table[sn].rating[ch->class] == 0) + adept = UMAX(class_table[ch->clasb].skill_adept-15,10); + else { + adept = UMAX(class_table[ch->class].skill_adept, + class_table[ch->clasb].skill_adept); + adept = UMIN(adept+15, 100); + } + } + } if ( ch->pcdata->learned[sn] >= adept ) { sprintf( buf, "You are already learned at %s.\n\r", @@ -3486,9 +4200,23 @@ else { ch->practice--; - ch->pcdata->learned[sn] += - int_app[get_curr_stat(ch,STAT_INT)].learn / - skill_table[sn].rating[ch->class]; + if (IS_NPC(ch)) + { + ch->pcdata->learned[sn] += + int_app[get_curr_stat(ch,STAT_INT)].learn / + skill_table[sn].rating[ch->class]; + } else if (ch->pcdata->tier != 2) + { + ch->pcdata->learned[sn] += + int_app[get_curr_stat(ch,STAT_INT)].learn / + skill_table[sn].rating[ch->class]; + } else + { + ch->pcdata->learned[sn] += + int_app[get_curr_stat(ch,STAT_INT)].learn / + UMAX(skill_table[sn].rating[ch->class], + skill_table[sn].rating[ch->clasb]); + } if ( ch->pcdata->learned[sn] < adept ) { act( "You practice $T.", @@ -3635,7 +4363,7 @@ } } - free_string( ch->pcdata->pwd ); + free_string( ch->pcdata->pwd, "act_info.c/do_password" ); ch->pcdata->pwd = str_dup( pwdnew ); save_char_obj( ch ); send_to_char( "Ok.\n\r", ch ); --- act_move.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/act_move.c Sat Aug 14 20:31:11 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -66,10 +64,13 @@ ROOM_INDEX_DATA *to_room; EXIT_DATA *pexit; int track; + bool wasquiet; + wasquiet = quiet; if ( door < 0 || door > 11 ) { bug( "Do_move: bad door %d.", door ); + ch->running = FALSE; return; } @@ -88,6 +89,7 @@ portal = get_obj_list( ch, dir_name[door], ch->in_room->contents ); if (portal != NULL) { + ch->running = FALSE; enter_exit( ch, dir_name[door] ); return; } @@ -96,10 +98,12 @@ if ( ( pexit = in_room->exit[door] ) == NULL || ( to_room = pexit->u1.to_room ) == NULL - || !can_see_room(ch,pexit->u1.to_room)) + || !can_see_room(ch,pexit->u1.to_room) + || !can_see_door(ch,pexit->exit_info)) { if (!quiet) send_to_char( "Alas, you cannot go that way.\n\r", ch ); + ch->running = FALSE; return; } @@ -109,6 +113,7 @@ { if (!quiet) act( "The $d is closed.", ch, NULL, pexit->keyword, TO_CHAR ); + ch->running = FALSE; return; } @@ -118,67 +123,87 @@ { if (!quiet) send_to_char( "What? And leave your beloved master?\n\r", ch ); + ch->running = FALSE; return; } - if ( !is_room_owner(ch,to_room) && room_is_private( ch,to_room ) ) + if ( !is_room_owner(ch,to_room) && room_is_private( ch,to_room )) { if (!quiet) send_to_char( "That room is private right now.\n\r", ch ); + ch->running = FALSE; return; } if ( !IS_NPC(ch) ) { - int iClass, iGuild; int move; - bool ts1; - bool ts2; + bool ts; + GUILD_DATA *guild; + RACE_DATA *race; - ts1 = FALSE; - ts2 = FALSE; - for ( iClass = 0; iClass < MAX_CLASS; iClass++ ) - { - for ( iGuild = 0; iGuild < MAX_GUILD; iGuild ++) - { - if ( iClass != ch->class - && to_room->vnum == class_table[iClass].guild[iGuild] ) - { - ts1 = TRUE; - } - if ( iClass == ch->class - && to_room->vnum == class_table[iClass].guild[iGuild] ) - { - ts2 = TRUE; + ts = TRUE; + + for (guild = to_room->guild; guild != NULL; guild = guild->next) + { + ts = FALSE; + if (guild->guild == ch->class) + ts = TRUE; + if ((ch->pcdata->tier == 2) && (guild->guild == ch->clasb)) + ts = TRUE; + if (ts) + break; + } + if (ts) + { + for (race = to_room->race; race != NULL; race = race->next) + { + ts = FALSE; + if (race->race == ch->race) + { + ts = TRUE; + break; } } } + if (IS_IMMORTAL(ch)) + ts = TRUE; - if (ts2) - { - ts1 = FALSE; - } - if (ts1) + if (!ts) { if (!quiet) send_to_char( "You aren't allowed in there.\n\r", ch ); + ch->running = FALSE; return; } if ( in_room->sector_type == SECT_AIR || to_room->sector_type == SECT_AIR ) { - if ( !IS_AFFECTED(ch, AFF_FLYING) && !IS_IMMORTAL(ch)) + if ( !IS_AFFECTED(ch, AFF_FLYING) && !IS_IMMORTAL(ch) + && !(ch->spirit)) { - if (!quiet) - send_to_char( "You can't fly.\n\r", ch ); - return; + if (to_room->fall == NULL) + { + if (!quiet) + send_to_char( "You can't fly.\n\r", ch ); + ch->running = FALSE; + return; + } else if ( ( pexit = to_room->fall ) == NULL + || ( to_room = pexit->u1.to_room ) == NULL + || !can_see_room(ch,pexit->u1.to_room)) + { + if (!quiet) + send_to_char( "You can't fly.\n\r", ch ); + ch->running = FALSE; + return; + } } } if (( in_room->sector_type == SECT_WATER_NOSWIM || to_room->sector_type == SECT_WATER_NOSWIM ) - && !IS_AFFECTED(ch,AFF_FLYING)) + && !IS_AFFECTED(ch,AFF_FLYING) && !(ch->spirit)) { OBJ_DATA *obj; bool found; @@ -201,12 +226,27 @@ } if ( !found ) { - if (!quiet) - send_to_char( "You need a boat to go there.\n\r", ch ); - return; + if (to_room->fall == NULL) + { + if (!quiet) + send_to_char( "You need a boat to go there.\n\r", ch ); + ch->running = FALSE; + return; + } else if ( ( pexit = to_room->fall ) == NULL + || ( to_room = pexit->u1.to_room ) == NULL + || !can_see_room(ch,pexit->u1.to_room)) + { + if (!quiet) + send_to_char( "You need a boat to go there.\n\r", ch ); + ch->running = FALSE; + return; + } } } + if (to_room->transfer != NULL) + quiet = TRUE; + move = movement_loss[UMIN(SECT_MAX-1, in_room->sector_type)] + movement_loss[UMIN(SECT_MAX-1, to_room->sector_type)] ; @@ -221,22 +261,123 @@ if (IS_AFFECTED(ch,AFF_SLOW)) move *= 2; - if ( ch->move < move ) + if (ch->running) + { + move *= 3; + move /= 2; + } + + if ( ch->move < move && !(ch->spirit)) { if (!quiet) send_to_char( "You are too exhausted.\n\r", ch ); + ch->running = FALSE; return; } WAIT_STATE( ch, 1 ); - ch->move -= move; + if (!(ch->spirit)) + ch->move -= move; + } + + if (IS_SET(in_room->room_flags, ROOM_CLAN_ENT)) + { + CHAR_DATA *nch; + CHAR_DATA *bch; + bool found = FALSE; + bool foundfree = FALSE; + + ch->running = FALSE; + bch = in_room->people; + for ( nch = in_room->people; nch != NULL; nch = nch->next_in_room ) + { + if (IS_IMMORTAL(ch)) + break; + if (!is_clan(ch)) + break; + if (!IS_NPC(nch)) + continue; + if (!IS_SET(nch->off_flags, OFF_CLAN_GUARD)) + continue; + if (ch->clan == nch->pIndexData->clan) + continue; + else + { + found = TRUE; + bch = nch; + if (bch->fighting == NULL) + { + foundfree = TRUE; + break; + } + } + } + if (found) + { + DESCRIPTOR_DATA *d; + CHAR_DATA *gch; + CHAR_DATA *leader; + MOB_INDEX_DATA *pMobIndex; + + found = FALSE; + leader = (ch->leader != NULL) ? ch->leader : ch; + + for ( d = descriptor_list; d != NULL; d = d->next ) + { + if ( d->connected != CON_PLAYING ) + continue; + gch = d->character; + if (IS_NPC(gch)) + continue; + if (gch == ch) + continue; + if ( is_same_group( gch, ch ) ) + { + found = TRUE; + gch->leader = NULL; + gch->master = NULL; + if (gch->desc != NULL) + send_to_char("{RYour group has been dissolved!{x\n\r",gch); + } + } + ch->leader = NULL; + ch->master = NULL; + if (found) + send_to_char("{RYour group has been dissolved!{x\n\r",ch); + act("You attempt to move $T.", ch, NULL, dir_name[door], TO_CHAR ); + act("$n attempts to move $T.", ch, NULL, dir_name[door], TO_ROOM ); + ch->running = FALSE; + if (foundfree) + { + act("$N blocks your way!",ch,NULL,bch,TO_CHAR); + act("$N blocks $s way!",ch,NULL,bch,TO_ROOM); + multi_hit( bch, ch, TYPE_UNDEFINED ); + return; + } else { + if ((pMobIndex = get_mob_index(bch->pIndexData->vnum))==NULL) + { + return; + } + nch = create_mobile( pMobIndex ); + char_to_room( nch, ch->in_room ); + act("$N suddenly materializes in front of you!",ch,NULL,nch,TO_CHAR); + act("$N suddenly materializes in front of $m!",ch,NULL,nch,TO_ROOM); + multi_hit( nch, ch, TYPE_UNDEFINED ); + return; + } + return; + } } if ( !IS_AFFECTED(ch, AFF_SNEAK) && ch->invis_level <= LEVEL_HERO && ch->ghost_level <= LEVEL_HERO) + { if (!quiet) act( "$n leaves $T.", ch, NULL, dir_name[door], TO_ROOM ); + if (ch->running) + act( "$n runs $T.", ch, NULL, dir_name[door], TO_ROOM ); + } char_from_room( ch ); char_to_room( ch, to_room ); @@ -247,7 +388,7 @@ ch->track_to[track] = ch->track_to[track-1]; ch->track_from[track] = ch->track_from[track-1]; } - if (IS_AFFECTED(ch,AFF_FLYING)) + if (IS_AFFECTED(ch,AFF_FLYING) || ch->spirit) { ch->track_from[0] = 0; ch->track_to[0] = 0; @@ -262,6 +403,8 @@ { if (!quiet) act( "$n has arrived.", ch, NULL, NULL, TO_ROOM ); + if (ch->running) + act( "$n has arrived.", ch, NULL, NULL, TO_ROOM ); if (IS_NPC(ch)) { if( ch->say_descr[0] != '\0') @@ -274,9 +417,72 @@ if (!quiet) do_look( ch, "auto" ); + if (to_room->transfer != NULL) + { + move_char_transfer(ch, wasquiet); + ch->running = FALSE; + to_room = ch->in_room; + } + + quiet = wasquiet; + + if (ch->running && !IS_IMMORTAL(ch) && !IS_NPC(ch)) + { + for ( fch = ch->in_room->people; fch != NULL; fch = fch_next ) + { + fch_next = fch->next_in_room; + + if (IS_NPC(fch) && IS_SET(fch->act,ACT_AGGRESSIVE) + && can_see( fch, ch ) && !IS_SET(fch->in_room->room_flags,ROOM_SAFE) + && !IS_AFFECTED(fch,AFF_CALM) && !IS_AFFECTED(fch, AFF_CHARM) + && (fch->level >= ch->level - 5) ) + { + ch->running = FALSE; + break; + } + } + } + if (in_room == to_room) /* no circular follows */ + { + ch->running = FALSE; return; + } + if (ch->shadowed) + { + for ( fch = ch->shadower->in_room->people; fch != NULL; fch = fch->next_in_room ) + { + if (IS_NPC(fch)) + continue; + if (fch == ch->shadower) + continue; + if (!IS_IMMORTAL(fch)) + continue; + if (fch->level < get_trust(ch->shadower)) + continue; + act( "$n slips out of the room.", ch->shadower, NULL, fch, TO_VICT ); + } + char_from_room( ch->shadower ); + char_to_room( ch->shadower, to_room ); + for ( fch = ch->shadower->in_room->people; fch != NULL; fch = fch->next_in_room ) + { + if (IS_NPC(fch)) + continue; + if (fch == ch->shadower) + continue; + if (!IS_IMMORTAL(fch)) + continue; + if (fch->level < get_trust(ch->shadower)) + continue; + act( "$n silently slips into the room.", ch->shadower, NULL, fch, TO_VICT ); + } + if (!quiet) + { + act( "You follow $N.", ch->shadower, NULL, ch, TO_CHAR ); + do_look( ch->shadower, "auto" ); + } + } for ( fch = in_room->people; fch != NULL; fch = fch_next ) { fch_next = fch->next_in_room; @@ -307,14 +513,175 @@ return; } +void move_char_transfer( CHAR_DATA *ch, bool quiet) +{ + ROOM_INDEX_DATA *in_room; + ROOM_INDEX_DATA *to_room; + EXIT_DATA *pexit; + int track; + + in_room = ch->in_room; + + if ( !IS_NPC(ch) ) + { + send_to_char( "{x\n\r", ch); + send_to_char( ch->in_room->description, ch ); + send_to_char("\n\r",ch); + } + + if ( ( pexit = in_room->transfer ) == NULL + || ( to_room = pexit->u1.to_room ) == NULL + || ( to_room->transfer ) != NULL + || ( to_room->fall ) != NULL + || !can_see_room(ch,pexit->u1.to_room)) + { + to_room = get_room_index(ROOM_VNUM_LIMBO); + } + + if ( !is_room_owner(ch,to_room) && room_is_private( ch,to_room )) + { + to_room = get_room_index(ROOM_VNUM_LIMBO); + } + + if ( !IS_NPC(ch) ) + { + bool ts; + GUILD_DATA *guild; + RACE_DATA *race; + + ts = TRUE; + + for (guild = to_room->guild; guild != NULL; guild = guild->next) + { + ts = FALSE; + if (guild->guild == ch->class) + ts = TRUE; + if ((ch->pcdata->tier == 2) && (guild->guild == ch->clasb)) + ts = TRUE; + if (ts) + break; + } + if (ts) + { + for (race = to_room->race; race != NULL; race = race->next) + { + ts = FALSE; + if (race->race == ch->race) + { + ts = TRUE; + break; + } + } + } + if (IS_IMMORTAL(ch)) + ts = TRUE; + + if (!ts) + { + to_room = get_room_index(ROOM_VNUM_LIMBO); + } + + if ( in_room->sector_type == SECT_AIR + || to_room->sector_type == SECT_AIR ) + { + if ( !IS_AFFECTED(ch, AFF_FLYING) && !IS_IMMORTAL(ch) + && !(ch->spirit)) + { + if (to_room->fall == NULL) + { + to_room = get_room_index(ROOM_VNUM_LIMBO); + } else if ( ( pexit = to_room->fall ) == NULL + || ( to_room = pexit->u1.to_room ) == NULL + || !can_see_room(ch,pexit->u1.to_room)) + { + to_room = get_room_index(ROOM_VNUM_LIMBO); + } + } + } + + if (( in_room->sector_type == SECT_WATER_NOSWIM + || to_room->sector_type == SECT_WATER_NOSWIM ) + && !IS_AFFECTED(ch,AFF_FLYING) && !(ch->spirit)) + { + OBJ_DATA *obj; + bool found; + + /* + * Look for a boat. + */ + found = FALSE; + + if (IS_IMMORTAL(ch)) + found = TRUE; + + for ( obj = ch->carrying; obj != NULL; obj = obj->next_content ) + { + if ( obj->item_type == ITEM_BOAT ) + { + found = TRUE; + break; + } + } + if ( !found ) + { + if (to_room->fall == NULL) + { + to_room = get_room_index(ROOM_VNUM_LIMBO); + } else if ( ( pexit = to_room->fall ) == NULL + || ( to_room = pexit->u1.to_room ) == NULL + || !can_see_room(ch,pexit->u1.to_room)) + { + to_room = get_room_index(ROOM_VNUM_LIMBO); + } + } + } + } + + char_from_room( ch ); + char_to_room( ch, to_room ); + if (IS_NPC(ch) || !IS_IMMORTAL(ch)) + { + for (track = MAX_TRACK-1; track > 0; track--) + { + ch->track_to[track] = ch->track_to[track-1]; + ch->track_from[track] = ch->track_from[track-1]; + } + if (IS_AFFECTED(ch,AFF_FLYING) || ch->spirit) + { + ch->track_from[0] = 0; + ch->track_to[0] = 0; + } else { + ch->track_from[0] = in_room->vnum; + ch->track_to[0] = to_room->vnum; + } + } + if ( !IS_AFFECTED(ch, AFF_SNEAK) + && ch->invis_level <= LEVEL_HERO + && ch->ghost_level <= LEVEL_HERO) + { + if (!quiet) + act( "$n has arrived.", ch, NULL, NULL, TO_ROOM ); + if (IS_NPC(ch)) + { + if( ch->say_descr[0] != '\0') + { + if (!quiet) + act( "$n says '{a$T{x'", ch, NULL, ch->say_descr, TO_ROOM ); + } + } + } + if (!quiet) + do_look( ch, "auto" ); + + return; +} + /* RW Enter movable exits */ void enter_exit( CHAR_DATA *ch, char *arg) { ROOM_INDEX_DATA *location; int track; - - if ( ch->fighting != NULL ) - return; + EXIT_DATA *pexit; /* nifty portal stuff */ if (arg[0] != '\0') @@ -343,7 +710,8 @@ if (location == NULL || location == old_room - || !can_see_room(ch,location) + || !can_see_room(ch,location) + || !can_see_door(ch,(long)portal->value[1]) || (room_is_private(ch,location) && !IS_TRUSTED(ch,IMPLEMENTOR))) { send_to_char("Alas, you cannot go that way.\n\r",ch); @@ -372,16 +740,26 @@ if ( old_room->sector_type == SECT_AIR || location->sector_type == SECT_AIR ) { - if ( !IS_AFFECTED(ch, AFF_FLYING) && !IS_IMMORTAL(ch)) + if ( !IS_AFFECTED(ch, AFF_FLYING) && !IS_IMMORTAL(ch) + && !(ch->spirit)) { - send_to_char( "You can't fly.\n\r", ch ); - return; + if (location->fall == NULL) + { + send_to_char( "You can't fly.\n\r", ch ); + return; + } else if ( ( pexit = location->fall ) == NULL + || ( location = pexit->u1.to_room ) == NULL + || !can_see_room(ch,pexit->u1.to_room)) + { + send_to_char( "You can't fly.\n\r", ch ); + return; + } } } if (( old_room->sector_type == SECT_WATER_NOSWIM || location->sector_type == SECT_WATER_NOSWIM ) - && !IS_AFFECTED(ch,AFF_FLYING)) + && !IS_AFFECTED(ch,AFF_FLYING) && !(ch->spirit)) { OBJ_DATA *obj; bool found; @@ -404,8 +782,17 @@ } if ( !found ) { - send_to_char( "You need a boat to go there.\n\r", ch ); - return; + if (location->fall == NULL) + { + send_to_char( "You need a boat to go there.\n\r", ch ); + return; + } else if ( ( pexit = location->fall ) == NULL + || ( location = pexit->u1.to_room ) == NULL + || !can_see_room(ch,pexit->u1.to_room)) + { + send_to_char( "You need a boat to go there.\n\r", ch ); + return; + } } } @@ -423,14 +810,15 @@ if (IS_AFFECTED(ch,AFF_SLOW)) move *= 2; - if ( ch->move < move ) + if ( ch->move < move && !(ch->spirit)) { send_to_char( "You are too exhausted.\n\r", ch ); return; } WAIT_STATE( ch, 1 ); - ch->move -= move; + if (!(ch->spirit)) + ch->move -= move; } @@ -438,7 +826,7 @@ && ch->invis_level <= LEVEL_HERO && ch->ghost_level <= LEVEL_HERO) { - act( "$n leaves $p.", ch,portal,NULL,TO_ROOM); + act( "$n leaves $v.", ch,portal,NULL,TO_ROOM); } char_from_room(ch); @@ -450,7 +838,7 @@ ch->track_to[track] = ch->track_to[track-1]; ch->track_from[track] = ch->track_from[track-1]; } - if (IS_AFFECTED(ch,AFF_FLYING)) + if (IS_AFFECTED(ch,AFF_FLYING) || ch->spirit) { ch->track_from[0] = 0; ch->track_to[0] = 0; @@ -480,6 +868,37 @@ if (old_room == location) return; + if (ch->shadowed) + { + for ( fch = ch->shadower->in_room->people; fch != NULL; fch = fch->next_in_room ) + { + if (IS_NPC(fch)) + continue; + if (fch == ch->shadower) + continue; + if (!IS_IMMORTAL(fch)) + continue; + if (fch->level < get_trust(ch->shadower)) + continue; + act( "$n slips out of the room.", ch->shadower, NULL, fch, TO_VICT ); + } + char_from_room( ch->shadower ); + char_to_room( ch->shadower, location ); + for ( fch = ch->shadower->in_room->people; fch != NULL; fch = fch->next_in_room ) + { + if (IS_NPC(fch)) + continue; + if (fch == ch->shadower) + continue; + if (!IS_IMMORTAL(fch)) + continue; + if (fch->level < get_trust(ch->shadower)) + continue; + act( "$n silently slips into the room.", ch->shadower, NULL, fch, TO_VICT ); + } + act( "You follow $N.", ch->shadower, NULL, ch, TO_CHAR ); + do_look( ch->shadower, "auto" ); + } for ( fch = old_room->people; fch != NULL; fch = fch_next ) { fch_next = fch->next_in_room; @@ -516,6 +935,48 @@ return; } +void do_run( CHAR_DATA *ch, char *argument ) +{ + char arg[MAX_INPUT_LENGTH]; + int door; + int numrooms; + + one_argument( argument, arg ); + + if ( arg[0] == '\0' ) + { + send_to_char( "Run where?\n\r", ch ); + return; + } + ch->running = TRUE; + if ( IS_AFFECTED( ch, AFF_SNEAK ) ) + { + REMOVE_BIT( ch->affected_by, AFF_SNEAK ); + } + + if ( !str_prefix( arg, "north" ) ) door = 0; + else if ( !str_prefix( arg, "east" ) ) door = 1; + else if ( !str_prefix( arg, "south" ) ) door = 2; + else if ( !str_prefix( arg, "west" ) ) door = 3; + else if ( !str_prefix( arg, "up" ) ) door = 4; + else if ( !str_prefix( arg, "down" ) ) door = 5; + else + { + send_to_char( "Run where?\n\r", ch ); + ch->running = FALSE; + return; + } + numrooms = number_range(1, UMAX(1, (ch->level/2))); + for ( ; numrooms > 0; numrooms--) + { + move_char( ch, door, FALSE, TRUE ); + if (!ch->running) + numrooms = 0; + } + ch->running = FALSE; + do_look( ch, "auto" ); + return; +} void do_north( CHAR_DATA *ch, char *argument ) { @@ -606,7 +1067,9 @@ door += 6; } - if ( ( pexit = ch->in_room->exit[door] ) == NULL ) + if ( ( pexit = ch->in_room->exit[door] ) == NULL + || !can_see_room(ch, ch->in_room->exit[door]->u1.to_room) + || !can_see_door(ch, ch->in_room->exit[door]->exit_info) ) { act( "I see no door $T here.", ch, NULL, arg, TO_CHAR ); return -1; @@ -783,6 +1246,9 @@ if ( IS_SET(pexit->exit_info, EX_CLOSED) ) { send_to_char( "It's already closed.\n\r", ch ); return; } + if (IS_SET(pexit->exit_info, EX_NOCLOSE) ) + { send_to_char("You can't do that.\n\r", ch); return; } + SET_BIT(pexit->exit_info, EX_CLOSED); act( "$n closes the $d.", ch, NULL, pexit->keyword, TO_ROOM ); send_to_char( "Ok.\n\r", ch ); @@ -904,7 +1370,7 @@ pexit = ch->in_room->exit[door]; if ( !IS_SET(pexit->exit_info, EX_CLOSED) ) { send_to_char( "It's not closed.\n\r", ch ); return; } - if ( pexit->key < 0 ) + if ( pexit->key < 0 || IS_SET(pexit->exit_info, EX_NOLOCK) ) { send_to_char( "It can't be locked.\n\r", ch ); return; } if ( !has_key( ch, pexit->key) ) { send_to_char( "You lack the key.\n\r", ch ); return; } @@ -1055,6 +1521,12 @@ WAIT_STATE( ch, skill_table[gsn_pick_lock].beats ); + if (ch->spirit) + { + send_to_char( "That's tough to do without flesh.\n\r", ch); + return; + } + /* look for guards */ for ( gch = ch->in_room->people; gch; gch = gch->next_in_room ) { @@ -1066,13 +1538,6 @@ } } - if ( !IS_NPC(ch) && number_percent( ) > get_skill(ch,gsn_pick_lock)) - { - send_to_char( "You failed.\n\r", ch); - check_improve(ch,gsn_pick_lock,FALSE,2); - return; - } - if ( ( obj = get_obj_here( ch, arg ) ) != NULL ) { /* portal stuff */ @@ -1102,6 +1567,45 @@ return; } + if ( !IS_NPC(ch) ) + { + int numper = 0; + int numout = 0; + int numgsn = 0; + + numper = number_percent( ); + numgsn = get_skill(ch,gsn_pick_lock); + numout = numper; + + if (IS_SET(obj->value[1],EX_EASY)) + { + if (numout > numgsn) + { + if (numgsn == 0) + { + if (number_percent( ) < 25) + numout = -1; + } else { + if (number_percent( ) < 66) + numout = -1; + } + } + } + if (IS_SET(obj->value[1],EX_HARD)) + { + numout = (numper + ((101-numper)/4)); + } + if (IS_SET(obj->value[1],EX_INFURIATING)) + { + numout = (numper + ((101-numper)/2)); + } + if (numout > numgsn) + { + send_to_char( "You failed.\n\r", ch); + check_improve(ch,gsn_pick_lock,FALSE,2); + return; + } + } REMOVE_BIT(obj->value[1],EX_LOCKED); act("You pick the lock on $p.",ch,obj,NULL,TO_CHAR); act("$n picks the lock on $p.",ch,obj,NULL,TO_ROOM); @@ -1109,10 +1613,6 @@ return; } - - - - /* 'pick object' */ if ( ( obj->item_type != ITEM_CONTAINER ) && ( obj->item_type != ITEM_PIT ) ) @@ -1149,6 +1649,45 @@ { send_to_char( "It's already unlocked.\n\r", ch ); return; } if ( IS_SET(pexit->exit_info, EX_PICKPROOF) && !IS_IMMORTAL(ch)) { send_to_char( "You failed.\n\r", ch ); return; } + if ( !IS_NPC(ch) ) + { + int numper = 0; + int numout = 0; + int numgsn = 0; + + numper = number_percent( ); + numgsn = get_skill(ch,gsn_pick_lock); + numout = numper; + + if (IS_SET(pexit->exit_info, EX_EASY)) + { + if (numout > numgsn) + { + if (numgsn == 0) + { + if (number_percent( ) < 25) + numout = -1; + } else { + if (number_percent( ) < 66) + numout = -1; + } + } + } + if (IS_SET(pexit->exit_info, EX_HARD)) + { + numout = (numper + ((101-numper)/4)); + } + if (IS_SET(pexit->exit_info, EX_INFURIATING)) + { + numout = (numper + ((101-numper)/2)); + } + if (numout > numgsn) + { + send_to_char( "You failed.\n\r", ch); + check_improve(ch,gsn_pick_lock,FALSE,2); + return; + } + } REMOVE_BIT(pexit->exit_info, EX_LOCKED); send_to_char( "*Click*\n\r", ch ); @@ -1167,9 +1706,6 @@ return; } - - - void do_stand( CHAR_DATA *ch, char *argument ) { OBJ_DATA *obj = NULL; @@ -1272,8 +1808,6 @@ return; } - - void do_rest( CHAR_DATA *ch, char *argument ) { OBJ_DATA *obj = NULL; @@ -1402,7 +1936,6 @@ return; } - void do_sit (CHAR_DATA *ch, char *argument ) { OBJ_DATA *obj = NULL; @@ -1516,7 +2049,6 @@ return; } - void do_sleep( CHAR_DATA *ch, char *argument ) { OBJ_DATA *obj = NULL; @@ -1592,8 +2124,6 @@ return; } - - void do_wake( CHAR_DATA *ch, char *argument ) { char arg[MAX_INPUT_LENGTH]; @@ -1620,8 +2150,6 @@ return; } - - void do_sneak( CHAR_DATA *ch, char *argument ) { AFFECT_DATA af; @@ -1650,8 +2178,6 @@ return; } - - void do_hide( CHAR_DATA *ch, char *argument ) { send_to_char( "You attempt to hide.\n\r", ch ); @@ -1670,8 +2196,6 @@ return; } - - /* * Contributed by Alander. */ @@ -1687,8 +2211,6 @@ return; } - - void do_recall( CHAR_DATA *ch, char *argument ) { char buf[MAX_STRING_LENGTH]; @@ -1721,12 +2243,39 @@ } } + if ( ch->alignment < 0 && !IS_SET( ch->act, PLR_TWIT ) ) + { + location = get_room_index( home_table[ch->home].evil_recall ); + } else { + location = get_room_index( home_table[ch->home].good_recall ); + } + + if (IS_NPC(ch) && IS_SET(ch->act,ACT_PET) + && !IS_SET(ch->master->act, PLR_TWIT)) + { + if (ch->alignment < 0) + location = get_room_index( home_table[ch->master->home].evil_recall ); + else + location = get_room_index( home_table[ch->master->home].good_recall ); + } + + if ( ch->level < 20 && !IS_SET( ch->act, PLR_TWIT ) ) + { + location = get_room_index( ROOM_VNUM_SCHOOL ); + } + + if (IS_NPC(ch) && IS_SET(ch->act,ACT_PET) + && ch->master->level < 20 && !IS_SET(ch->master->act, PLR_TWIT)) + { + location = get_room_index( ROOM_VNUM_SCHOOL ); + } + if ( ch->in_room == location ) return; - if ( ( IS_SET(ch->in_room->room_flags, ROOM_NO_RECALL) - || IS_AFFECTED(ch, AFF_CURSE)) - && (ch->level <= HERO) ) + if ( ( IS_SET( ch->in_room->room_flags, ROOM_NO_RECALL ) + || IS_AFFECTED( ch, AFF_CURSE ) || ( ch->move <= 5 ) ) + && ( ch->level <= HERO ) && !( ch->spirit ) ) { act( "$G has forsaken you.", ch, NULL, NULL, TO_CHAR ); return; @@ -1754,6 +2303,13 @@ send_to_char( buf, ch ); if ( !IS_NPC(ch) ) { + if (!IS_NPC(victim)) + { + if (ch->attacker == FALSE) + ch->pcdata->dflee++; + else + ch->pcdata->aflee++; + } if ( !IS_NPC(victim) && ch->attacker == TRUE) { send_to_char( "The {RWrath of Thoth {YZAPS{x your butt on the way out!\n\r", ch); @@ -1762,20 +2318,31 @@ } } stop_fighting( ch, TRUE ); + do_mod_favor(ch, 2); } if (is_clan(ch) && (clan_table[ch->clan].hall != ROOM_VNUM_ALTAR) - && !IS_SET(ch->act, PLR_TWIT)) + && !IS_SET(ch->act, PLR_TWIT) && !(ch->spirit)) location = get_room_index( clan_table[ch->clan].hall ); if (IS_NPC(ch) && IS_SET(ch->act,ACT_PET) && is_clan(ch->master) && (clan_table[ch->master->clan].hall != ROOM_VNUM_ALTAR) - && !IS_SET(ch->master->act, PLR_TWIT)) + && !IS_SET(ch->master->act, PLR_TWIT) && !(ch->master->spirit)) location = get_room_index( clan_table[ch->master->clan].hall ); - ch->move *= .75; + if (global_quest && ch->on_quest && !IS_SET(ch->act, PLR_TWIT) + && !(ch->spirit)) + location = get_room_index( ROOM_VNUM_QUEST_RECALL ); + + if (global_quest && IS_NPC(ch) && IS_SET(ch->act,ACT_PET) + && ch->master->on_quest && !IS_SET(ch->master->act, PLR_TWIT) + && !(ch->master->spirit)) + location = get_room_index( ROOM_VNUM_QUEST_RECALL ); + + if (!(ch->spirit)) + ch->move *= .75; act( "$n disappears.", ch, NULL, NULL, TO_ROOM ); if (IS_NPC(ch) || !IS_IMMORTAL(ch)) { @@ -1798,8 +2365,6 @@ return; } - - void do_train( CHAR_DATA *ch, char *argument ) { char buf[MAX_STRING_LENGTH]; @@ -1826,6 +2391,13 @@ return; } + if (ch->spirit) + { + send_to_char( "Spirits cannot train.\n\r", ch); + return; + } + + if ( argument[0] == '\0' ) { sprintf( buf, "You have %d training sessions.\n\r", ch->train ); @@ -1833,11 +2405,13 @@ argument = "foo"; } - cost = 1; + cost = 2; if ( !str_cmp( argument, "str" ) ) { - if ( class_table[ch->class].attr_prime == STAT_STR ) + if ( ( class_table[ch->class].attr_prime == STAT_STR ) + || ( ( ch->pcdata->tier == 2 ) + && ( class_table[ch->clasb].attr_prime == STAT_STR ) ) ) cost = 1; stat = STAT_STR; pOutput = "strength"; @@ -1845,7 +2419,9 @@ else if ( !str_cmp( argument, "int" ) ) { - if ( class_table[ch->class].attr_prime == STAT_INT ) + if ( ( class_table[ch->class].attr_prime == STAT_INT ) + || ( ( ch->pcdata->tier == 2 ) + && ( class_table[ch->clasb].attr_prime == STAT_INT ) ) ) cost = 1; stat = STAT_INT; pOutput = "intelligence"; @@ -1853,7 +2429,9 @@ else if ( !str_cmp( argument, "wis" ) ) { - if ( class_table[ch->class].attr_prime == STAT_WIS ) + if ( ( class_table[ch->class].attr_prime == STAT_WIS ) + || ( ( ch->pcdata->tier == 2 ) + && ( class_table[ch->clasb].attr_prime == STAT_WIS ) ) ) cost = 1; stat = STAT_WIS; pOutput = "wisdom"; @@ -1861,7 +2439,9 @@ else if ( !str_cmp( argument, "dex" ) ) { - if ( class_table[ch->class].attr_prime == STAT_DEX ) + if ( ( class_table[ch->class].attr_prime == STAT_DEX ) + || ( ( ch->pcdata->tier == 2 ) + && ( class_table[ch->clasb].attr_prime == STAT_DEX ) ) ) cost = 1; stat = STAT_DEX; pOutput = "dexterity"; @@ -1869,7 +2449,9 @@ else if ( !str_cmp( argument, "con" ) ) { - if ( class_table[ch->class].attr_prime == STAT_CON ) + if ( ( class_table[ch->class].attr_prime == STAT_CON ) + || ( ( ch->pcdata->tier == 2 ) + && ( class_table[ch->clasb].attr_prime == STAT_CON ) ) ) cost = 1; stat = STAT_CON; pOutput = "constitution"; @@ -1899,24 +2481,8 @@ strcat( buf, " con" ); strcat( buf, " hp mana move"); - if ( buf[strlen(buf)-1] != ':' ) - { - strcat( buf, ".\n\r" ); - send_to_char( buf, ch ); - } - else - { - /* - * This message dedicated to Jordan ... you big stud! - */ - act( "You have nothing left to train, you $T!", - ch, NULL, - ch->sex == SEX_MALE ? "big stud" : - ch->sex == SEX_FEMALE ? "hot babe" : - "wild thing", - TO_CHAR ); - } - + strcat( buf, ".\n\r" ); + send_to_char( buf, ch ); return; } --- act_obj.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/act_obj.c Sun Aug 15 17:26:13 1999 @@ -1,33 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -59,6 +58,7 @@ #define CD CHAR_DATA #define OD OBJ_DATA bool remove_obj args( (CHAR_DATA *ch, int iWear, bool fReplace ) ); +bool can_levitate args( (CHAR_DATA *ch ) ); void wear_obj args( (CHAR_DATA *ch, OBJ_DATA *obj, bool fReplace ) ); CD * find_keeper args( (CHAR_DATA *ch ) ); int get_cost args( (CHAR_DATA *keeper, OBJ_DATA *obj, bool fBuy ) ); @@ -279,6 +279,12 @@ return; } + if (ch->spirit) + { + send_to_char( "That's tough to do without flesh.\n\r", ch); + return; + } + output = new_buf(); if ( arg2[0] == '\0' ) { @@ -291,6 +297,13 @@ act( "I see no $T here.", ch, NULL, arg1, TO_CHAR ); } else { + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } outlist = get_obj( ch, obj, NULL ); send_to_char(buf_string(outlist), ch); free_buf(outlist); @@ -307,6 +320,13 @@ && can_see_obj( ch, obj ) ) { found = TRUE; + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } outlist = get_obj( ch, obj, NULL ); add_buf(output,buf_string(outlist)); free_buf(outlist); @@ -366,6 +386,13 @@ } } + if (container->pIndexData->vnum == OBJ_VNUM_QPOUCH) + { + send_to_char("You can't remove anything from that.\n\r",ch); + free_buf(output); + return; + } + if ( IS_SET(container->value[1], CONT_CLOSED) ) { act( "The $d is closed.", ch, NULL, container->name, TO_CHAR ); @@ -384,6 +411,13 @@ free_buf(output); return; } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } outlist = get_obj( ch, obj, container ); send_to_char(buf_string(outlist), ch); free_buf(outlist); @@ -406,6 +440,13 @@ free_buf(output); return; } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } outlist = get_obj( ch, obj, container ); add_buf(output,buf_string(outlist)); free_buf(outlist); @@ -451,21 +492,6 @@ return; } - for ( container = object_list; container != NULL; container = container->next ) - { - if ( container->pIndexData->item_type != ITEM_PIT - || container->pIndexData->vnum != OBJ_VNUM_PIT ) - continue; - - found = TRUE; - break; - } - if (!found) - { - send_to_char( "I can't seem to find the donation pit!\n\r", ch); - return; - } - if ( ( obj = get_obj_carry( ch, arg1 ) ) == NULL ) { send_to_char( "You do not have that item.\n\r", ch ); @@ -484,6 +510,12 @@ return; } + if ( obj->item_type == ITEM_PASSBOOK ) + { + send_to_char( "You can't donate passbooks.\n\r", ch); + return; + } + if (IS_OBJ_STAT(obj,ITEM_MELT_DROP)) { send_to_char("You have a feeling noone's going to want that.\n\r",ch); @@ -502,6 +534,49 @@ return; } + if ( ( obj->level < 20 ) + && ( ( obj->item_type == ITEM_WEAPON ) + || ( obj->item_type == ITEM_ARMOR ) ) ) + { + for ( container = object_list; container != NULL; container = container->next ) + { + if ( container->pIndexData->item_type != ITEM_PIT + || container->pIndexData->vnum != OBJ_VNUM_PIT_SCHOOL ) + continue; + + found = TRUE; + break; + } + } else if ( ch->level < 20 && !is_clan( ch ) ) + { + for ( container = object_list; container != NULL; container = container->next ) + { + if ( container->pIndexData->item_type != ITEM_PIT + || container->pIndexData->vnum != OBJ_VNUM_PIT_SCHOOL ) + continue; + + found = TRUE; + break; + } + } else + { + for ( container = object_list; container != NULL; container = container->next ) + { + if ( container->pIndexData->item_type != ITEM_PIT + || container->pIndexData->vnum != home_table[ch->home].pit ) + continue; + + found = TRUE; + break; + } + } + if (!found) + { + send_to_char( "I can't seem to find a donation pit!\n\r", ch); + return; + } + + if (get_obj_weight( obj ) + get_true_weight( container ) > (container->value[0] * 10) || get_obj_weight(obj) > (container->value[3] * 10)) @@ -518,8 +593,16 @@ obj->timer = number_range(100,200); } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } obj_from_char( obj ); obj_to_obj( obj, container ); + obj->got_from = 0; act( "$p glows {Mpurple{x, then disappears from $n's inventory.", ch, obj, container, TO_ROOM ); act( "$p glows {Mpurple{x, then disappears..", ch, obj, container, TO_CHAR ); @@ -592,6 +675,12 @@ return; } + if ( obj->item_type == ITEM_PASSBOOK ) + { + send_to_char( "You can't donate passbooks.\n\r", ch); + return; + } + if (IS_OBJ_STAT(obj,ITEM_MELT_DROP)) { send_to_char("You have a feeling noone's going to want that.\n\r",ch); @@ -626,8 +715,16 @@ obj->timer = number_range(100,200); } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } obj_from_char( obj ); obj_to_obj( obj, container ); + obj->got_from = 0; act( "$p glows {Mpurple{x, then disappears from $n's inventory.", ch, obj, container, TO_ROOM ); act( "$p glows {Mpurple{x, then disappears..", ch, obj, container, TO_CHAR ); @@ -703,6 +800,20 @@ return; } + if ( ( IS_OBJ_STAT(obj,ITEM_LQUEST) ) + && ( container->pIndexData->vnum != OBJ_VNUM_QPOUCH ) ) + { + send_to_char( "Level quest items may only be placed in your quest pouch.\n\r", ch); + return; + } + + if ( ( !IS_OBJ_STAT(obj,ITEM_LQUEST) ) + && ( container->pIndexData->vnum == OBJ_VNUM_QPOUCH ) ) + { + send_to_char( "Only level quest items may be placed in your quest pouch.\n\r", ch); + return; + } + if ( ( obj->pIndexData->vnum == OBJ_VNUM_CUBIC ) && ( container->pIndexData->vnum != OBJ_VNUM_CPOUCH ) ) { @@ -738,6 +849,12 @@ return; } + if ( obj->item_type == ITEM_PASSBOOK ) + { + send_to_char( "You can't put a passbook in something.\n\r", ch); + return; + } + if (WEIGHT_MULT(obj) != 100) { send_to_char("You have a feeling that would be a bad idea.\n\r",ch); @@ -754,13 +871,22 @@ if (container->pIndexData->item_type == ITEM_PIT && !CAN_WEAR(container,ITEM_TAKE)) + { if (obj->timer) SET_BIT(obj->extra_flags,ITEM_HAD_TIMER); else obj->timer = number_range(100,200); - + } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } obj_from_char( obj ); obj_to_obj( obj, container ); + obj->got_from = 0; if (IS_SET(container->value[1],CONT_PUT_ON)) { @@ -787,7 +913,9 @@ if ( ( arg1[3] == '\0' || is_name( &arg1[4], obj->name ) ) && obj->item_type == ITEM_GEM && obj->pIndexData->vnum != OBJ_VNUM_CUBIC + && container->pIndexData->vnum != OBJ_VNUM_QPOUCH && !IS_OBJ_STAT(obj,ITEM_QUEST) + && obj->item_type != ITEM_PASSBOOK && can_see_obj( ch, obj ) && WEIGHT_MULT(obj) == 100 && obj->wear_loc == WEAR_NONE @@ -799,17 +927,27 @@ { if (container->pIndexData->item_type == ITEM_PIT && !CAN_WEAR(obj, ITEM_TAKE) ) + { if (obj->timer) SET_BIT(obj->extra_flags,ITEM_HAD_TIMER); else obj->timer = number_range(100,200); + } obj_from_char( obj ); obj_to_obj( obj, container ); + obj->got_from = 0; count++; } } if (count != 0) { + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } sprintf( buf, "You put %d gems in %s.\n\r", count, container->short_descr ); send_to_char( buf, ch); sprintf( buf, "$n puts %d gems in %s.\n\r", count, container->short_descr ); @@ -831,6 +969,7 @@ if ( ( arg1[3] == '\0' || is_name( &arg1[4], obj->name ) ) && obj->pIndexData->vnum == OBJ_VNUM_CUBIC && !IS_OBJ_STAT(obj,ITEM_QUEST) + && obj->item_type != ITEM_PASSBOOK && can_see_obj( ch, obj ) && WEIGHT_MULT(obj) == 100 && obj->wear_loc == WEAR_NONE @@ -842,17 +981,27 @@ { if (container->pIndexData->item_type == ITEM_PIT && !CAN_WEAR(obj, ITEM_TAKE) ) + { if (obj->timer) SET_BIT(obj->extra_flags,ITEM_HAD_TIMER); else obj->timer = number_range(100,200); + } obj_from_char( obj ); obj_to_obj( obj, container ); + obj->got_from = 0; count++; } } if (count != 0) { + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } sprintf( buf, "You put %d cubic zirconiums in %s.\n\r", count, container->short_descr ); send_to_char( buf, ch); sprintf( buf, "$n puts %d cubic zirconiums in %s.\n\r", count, container->short_descr ); @@ -871,6 +1020,9 @@ if ( ( arg1[3] == '\0' || is_name( &arg1[4], obj->name ) ) && !IS_OBJ_STAT(obj,ITEM_QUEST) + && !IS_OBJ_STAT(obj,ITEM_LQUEST) + && container->pIndexData->vnum != OBJ_VNUM_QPOUCH + && obj->item_type != ITEM_PASSBOOK && can_see_obj( ch, obj ) && WEIGHT_MULT(obj) == 100 && obj->wear_loc == WEAR_NONE @@ -884,12 +1036,15 @@ { if (container->pIndexData->item_type == ITEM_PIT && !CAN_WEAR(obj, ITEM_TAKE) ) + { if (obj->timer) SET_BIT(obj->extra_flags,ITEM_HAD_TIMER); else obj->timer = number_range(100,200); + } obj_from_char( obj ); obj_to_obj( obj, container ); + obj->got_from = 0; count++; if (IS_SET(container->value[1],CONT_PUT_ON)) { @@ -905,6 +1060,13 @@ } if (count != 0) { + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } if (IS_SET(container->value[1],CONT_PUT_ON)) { act("$n puts some things on $P.",ch,NULL,container, TO_ROOM); @@ -1057,6 +1219,13 @@ { platinum = 50000; } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } obj_to_room( create_money( platinum, gold, silver ), ch->in_room ); act( "$n drops some money.", ch, NULL, NULL, TO_ROOM ); send_to_char( "OK.\n\r", ch ); @@ -1077,12 +1246,32 @@ send_to_char( "You can't let go of it.\n\r", ch ); return; } + if (IS_OBJ_STAT(obj,ITEM_LQUEST) + || obj->pIndexData->vnum == OBJ_VNUM_QPOUCH ) + { + send_to_char( "You can't let go of it.\n\r", ch ); + return; + } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } obj_from_char( obj ); obj_to_room( obj, ch->in_room ); + obj->got_from = 0; act( "$n drops $p.", ch, obj, NULL, TO_ROOM ); act( "You drop $p.", ch, obj, NULL, TO_CHAR ); - if (IS_OBJ_STAT(obj,ITEM_MELT_DROP)) + if (obj->item_type == ITEM_PASSBOOK) + { + act("$p dissolves into smoke.",ch,obj,NULL,TO_ROOM); + act("$p dissolves into smoke.",ch,obj,NULL,TO_CHAR); + change_banklist(ch, FALSE, obj->value[0], obj->value[1], 0, obj->name); + extract_obj(obj); + } else if (IS_OBJ_STAT(obj,ITEM_MELT_DROP)) { act("$p dissolves into smoke.",ch,obj,NULL,TO_ROOM); act("$p dissolves into smoke.",ch,obj,NULL,TO_CHAR); @@ -1101,14 +1290,23 @@ if ( ( arg[3] == '\0' || is_name( &arg[4], obj->name ) ) && can_see_obj( ch, obj ) && obj->wear_loc == WEAR_NONE - && can_drop_obj( ch, obj ) ) + && can_drop_obj( ch, obj ) + && !IS_OBJ_STAT(obj,ITEM_LQUEST) + && obj->pIndexData->vnum != OBJ_VNUM_QPOUCH ) { found = TRUE; obj_from_char( obj ); obj_to_room( obj, ch->in_room ); + obj->got_from = 0; sprintf( buf, "You drop %s\n\r", obj->short_descr ); add_buf(output,buf); - if (IS_OBJ_STAT(obj,ITEM_MELT_DROP)) + if (obj->item_type == ITEM_PASSBOOK) + { + sprintf( buf, "%s dissolves into smoke.\n\r", obj->short_descr ); + add_buf(output,buf); + change_banklist(ch, FALSE, obj->value[0], obj->value[1], 0, obj->name); + extract_obj(obj); + } else if (IS_OBJ_STAT(obj,ITEM_MELT_DROP)) { sprintf( buf, "%s dissolves into smoke.\n\r", obj->short_descr ); add_buf(output,buf); @@ -1127,6 +1325,13 @@ ch, NULL, &arg[4], TO_CHAR ); } else { + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } act( "$n drops some things.", ch, NULL, NULL, TO_ROOM ); page_to_char( buf_string(output), ch ); } @@ -1136,8 +1341,6 @@ return; } - - void do_give( CHAR_DATA *ch, char *argument ) { char arg1 [MAX_INPUT_LENGTH]; @@ -1222,6 +1425,11 @@ act("You can't seem to give $N anything.\n\r",ch,NULL,victim,TO_CHAR); return; } + if (victim->spirit) + { + act("You can't seem to give $N anything.\n\r",ch,NULL,victim,TO_CHAR); + return; + } cost = 0; if (silver != 0) { @@ -1241,6 +1449,13 @@ deduct_cost(ch,cost,VALUE_PLATINUM); add_cost(victim,cost,VALUE_PLATINUM); } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } act( "$n gives $N some money.", ch, NULL, victim, TO_NOTVICT ); if (platinum != 0) { @@ -1263,7 +1478,7 @@ sprintf(buf,"You give $N %d silver.",silver); act( buf, ch, NULL, victim, TO_CHAR ); } - if (IS_NPC(victim) && IS_SET(victim->act,ACT_IS_CHANGER) + if (IS_NPC(victim) && IS_SET(victim->act,ACT_IS_BANKER) && !IS_NPC(ch)) { int change; @@ -1371,6 +1586,12 @@ return; } + if ( ( obj->item_type == ITEM_PASSBOOK ) && ch->level <= HERO) + { + send_to_char( "You can't give passbooks.\n\r", ch); + return; + } + if ((obj->pIndexData->vnum == OBJ_VNUM_VOODOO) && (ch->level <= HERO)) { @@ -1378,6 +1599,13 @@ return; } + if (IS_NPC(victim) && IS_SET(victim->act, ACT_QUESTMASTER)) + { + act( "$N tells you '{aDo not give me objects, just type AQUEST{x'." + ,ch,NULL,victim,TO_CHAR); + return; + } + if ( victim->carry_number + get_obj_number( obj ) > can_carry_n( victim ) ) { act( "$N has $S hands full.", ch, NULL, victim, TO_CHAR ); @@ -1406,8 +1634,16 @@ return; } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } obj_from_char( obj ); obj_to_char( obj, victim ); + obj->got_from = 0; act( "$n gives $p to $N.", ch, obj, victim, TO_NOTVICT ); act( "$n gives you $p.", ch, obj, victim, TO_VICT ); act( "You give $p to $N.", ch, obj, victim, TO_CHAR ); @@ -1427,7 +1663,7 @@ int percent,skill; /* find out what */ - if (argument == '\0') + if (argument[0] == '\0') { send_to_char("Envenom what item?\n\r",ch); return; @@ -1457,6 +1693,13 @@ if (number_percent() < skill) /* success! */ { + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } act("$n treats $p with deadly poison.",ch,obj,NULL,TO_ROOM); act("You treat $p with deadly poison.",ch,obj,NULL,TO_CHAR); if (!obj->value[3]) @@ -1515,6 +1758,13 @@ af.bitvector = WEAPON_POISON; affect_to_obj(obj,&af); + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } act("$n coats $p with deadly venom.",ch,obj,NULL,TO_ROOM); act("You coat $p with venom.",ch,obj,NULL,TO_CHAR); check_improve(ch,gsn_envenom,TRUE,3); @@ -1591,6 +1841,13 @@ return; } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } if ( !strcmp(liq_table[fountain->value[2]].liq_name, "blood")) { sprintf(buf,"You get some %s from $P.", @@ -1652,6 +1909,13 @@ return; } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } out->value[1] = 0; out->value[3] = 0; sprintf(buf,"You invert $p, spilling %s all over the ground.", @@ -1715,6 +1979,13 @@ amount = UMIN(out->value[1],in->value[0] - in->value[1]); + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } in->value[1] += amount; out->value[1] -= amount; in->value[2] = out->value[2]; @@ -1781,6 +2052,12 @@ return; } + if (ch->spirit) + { + send_to_char( "That's tough to do without flesh.\n\r", ch); + return; + } + switch ( obj->item_type ) { default: @@ -1790,7 +2067,7 @@ case ITEM_FOUNTAIN: if ( ( liquid = obj->value[2] ) < 0 ) { - bug( "Do_drink: bad liquid number %d.", liquid ); + bug( "Do_drink: bad liquid number %d.",obj->pIndexData->vnum ); liquid = obj->value[2] = 0; } amount = liq_table[liquid].liq_affect[4] * 3; @@ -1805,7 +2082,7 @@ if ( ( liquid = obj->value[2] ) < 0 ) { - bug( "Do_drink: bad liquid number %d.", liquid ); + bug( "Do_drink: bad liquid number %d.", obj->pIndexData->vnum ); liquid = obj->value[2] = 0; } @@ -1820,6 +2097,13 @@ return; } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } act( "$n drinks $T from $p.", ch, obj, liq_table[liquid].liq_name, TO_ROOM ); act( "You drink $T from $p.", @@ -1852,6 +2136,18 @@ ch->move += ch->max_move/15; ch->move = UMIN(ch->move, ch->max_move); } + if (!IS_NPC(ch) && ch->pcdata->tier == 2) + { + if (!strcmp(class_table[ch->clasb].name, "vampire")) + { + ch->hit += ch->max_hit/30; + ch->hit = UMIN(ch->hit, ch->max_hit); + ch->mana += ch->max_mana/22; + ch->mana = UMIN(ch->mana, ch->max_mana); + ch->move += ch->max_move/22; + ch->move = UMIN(ch->move, ch->max_move); + } + } if ( obj->value[3] != 0 ) { @@ -1936,11 +2232,15 @@ send_to_char( "Restrings cost 6 quest points, you do not have enough.\n\r", ch); return; } - smash_tilde( argument ); + if (ch->spirit) + { + send_to_char( "That's tough to do without flesh.\n\r", ch); + return; + } sprintf(buf, "%s{x", argument ); act( "You give $p to $N.", ch, obj, trainer, TO_CHAR ); act( "$n gives $p to $N.", ch, obj, trainer, TO_NOTVICT ); - free_string( obj->short_descr ); + free_string( obj->short_descr, "act_obj.c/do_restring" ); obj->short_descr = str_dup( buf ); ch->qps-=6; act( "$N gives $p to you.", ch, obj, trainer, TO_CHAR ); @@ -1987,6 +2287,19 @@ } } + if (ch->spirit) + { + send_to_char( "That's tough to do without flesh.\n\r", ch); + return; + } + + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } act( "$n eats $p.", ch, obj, NULL, TO_ROOM ); act( "You eat $p.", ch, obj, NULL, TO_CHAR ); @@ -2060,6 +2373,13 @@ return FALSE; } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } unequip_char( ch, obj ); act( "$n stops using $p.", ch, obj, NULL, TO_ROOM ); act( "You stop using $p.", ch, obj, NULL, TO_CHAR ); @@ -2074,7 +2394,37 @@ return TRUE; } +bool can_levitate( CHAR_DATA *ch ) +{ + if (IS_NPC(ch)) + return FALSE; + + if (!strcmp(class_table[ch->class].name, "mage") ) + return TRUE; + + if (!strcmp(class_table[ch->class].name, "wizard") ) + return TRUE; + + if (!strcmp(class_table[ch->class].name, "cleric") && (ch->level > 49) ) + return TRUE; + + if (!strcmp(class_table[ch->class].name, "priest") && (ch->level > 24) ) + return TRUE; + + if (!strcmp(class_table[ch->class].name, "strider") && (ch->level > 49) ) + return TRUE; + + if (ch->pcdata->tier != 2) + return FALSE; + + if (!strcmp(class_table[ch->clasb].name, "mage") ) + return TRUE; + + if (!strcmp(class_table[ch->clasb].name, "cleric") && (ch->level > 49) ) + return TRUE; + return FALSE; +} /* * Wear one object. @@ -2086,6 +2436,13 @@ OBJ_DATA *shieldobj; char buf[MAX_STRING_LENGTH]; + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } if ( ( ( ch->level < obj->level ) && ( ch->class < MAX_CLASS/2 ) && ( obj->level > 19 ) ) @@ -2302,60 +2659,22 @@ weapon = get_eq_char(ch,WEAR_WIELD); if (weapon != NULL && ch->size < SIZE_LARGE && IS_WEAPON_STAT(weapon,WEAPON_TWO_HANDS) - && ((strcmp(class_table[ch->class].name, "mage") - && strcmp(class_table[ch->class].name, "wizard") - && strcmp(class_table[ch->class].name, "cleric") - && strcmp(class_table[ch->class].name, "priest") - && strcmp(class_table[ch->class].name, "strider")) - || (!strcmp(class_table[ch->class].name, "cleric") - && ch->level < 50) - || (!strcmp(class_table[ch->class].name, "priest") - && ch->level < 25) - || (!strcmp(class_table[ch->class].name, "strider") - && ch->level < 50))) + && !can_levitate(ch) ) { send_to_char("Your hands are tied up with your weapon!\n\r",ch); return; } if ((get_eq_char (ch, WEAR_SECONDARY) != NULL) - && ((strcmp(class_table[ch->class].name, "mage") - && strcmp(class_table[ch->class].name, "wizard") - && strcmp(class_table[ch->class].name, "cleric") - && strcmp(class_table[ch->class].name, "priest") - && strcmp(class_table[ch->class].name, "strider")) - || (!strcmp(class_table[ch->class].name, "cleric") - && ch->level < 50) - || (!strcmp(class_table[ch->class].name, "priest") - && ch->level < 25) - || (!strcmp(class_table[ch->class].name, "strider") - && ch->level < 50))) + && !can_levitate(ch) ) { send_to_char ("You cannot use a shield while using 2 weapons.\n\r",ch); return; } - if (((strcmp(class_table[ch->class].name, "mage")) - && strcmp(class_table[ch->class].name, "wizard") - && strcmp(class_table[ch->class].name, "cleric") - && strcmp(class_table[ch->class].name, "priest") - && strcmp(class_table[ch->class].name, "strider")) - || (!strcmp(class_table[ch->class].name, "cleric") - && ch->level < 50) - || (!strcmp(class_table[ch->class].name, "priest") - && ch->level < 25) - || (!strcmp(class_table[ch->class].name, "strider") - && ch->level < 50)) + if ( !can_levitate(ch) ) { act( "$n wears $p as a shield.", ch, obj, NULL, TO_ROOM ); act( "You wear $p as a shield.", ch, obj, NULL, TO_CHAR ); - } - if (!strcmp(class_table[ch->class].name, "mage") - || !strcmp(class_table[ch->class].name, "wizard") - || (!strcmp(class_table[ch->class].name, "cleric") - && ch->level > 49) - || (!strcmp(class_table[ch->class].name, "priest") - && ch->level > 24) - || (!strcmp(class_table[ch->class].name, "strider") - && ch->level > 49)) + } else { if ((weapon != NULL && ch->size < SIZE_LARGE && IS_WEAPON_STAT(weapon,WEAPON_TWO_HANDS)) @@ -2394,17 +2713,7 @@ && (get_eq_char(ch,WEAR_SHIELD) != NULL || get_eq_char(ch,WEAR_SECONDARY) != NULL)) { - if ((strcmp(class_table[ch->class].name, "mage") - && strcmp(class_table[ch->class].name, "wizard") - && strcmp(class_table[ch->class].name, "cleric") - && strcmp(class_table[ch->class].name, "priest") - && strcmp(class_table[ch->class].name, "strider")) - || (!strcmp(class_table[ch->class].name, "cleric") - && ch->level < 50) - || (!strcmp(class_table[ch->class].name, "priest") - && ch->level < 25) - || (!strcmp(class_table[ch->class].name, "strider") - && ch->level < 50)) + if ( !can_levitate(ch) ) { send_to_char("You need two hands free for that weapon.\n\r",ch); return; @@ -2626,6 +2935,11 @@ } } + if (ch->spirit) + { + send_to_char( "That's tough to do without flesh.\n\r", ch); + return; + } if ( !CAN_WEAR(obj, ITEM_TAKE) || CAN_WEAR(obj, ITEM_NO_SAC)) { @@ -2668,10 +2982,18 @@ } } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } act( "$n sacrifices $p to $G.", ch, obj, NULL, TO_ROOM ); wiznet("$N sends up $p as a burnt offering.", ch,obj,WIZ_SACCING,0,0); extract_obj( obj ); + do_mod_favor(ch, 3); return; } @@ -2681,6 +3003,7 @@ { char arg[MAX_INPUT_LENGTH]; OBJ_DATA *obj; + int amount; one_argument( argument, arg ); @@ -2713,15 +3036,47 @@ send_to_char("This liquid is too powerful for you to drink.\n\r",ch); return; } + if (!IS_NPC(ch) && !IS_IMMORTAL(ch) + && ch->pcdata->condition[COND_FULL] > 45) + { + send_to_char("You're too full to drink more.\n\r",ch); + return; + } + + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } + if (ch->position == POS_FIGHTING) + WAIT_STATE( ch, 6 * PULSE_PER_SECOND ); + else + WAIT_STATE( ch, 3 * PULSE_PER_SECOND ); act( "$n quaffs $p.", ch, obj, NULL, TO_ROOM ); act( "You quaff $p.", ch, obj, NULL ,TO_CHAR ); + if (obj->value[0] < 1) + obj->value[0] = 1; + obj->value[0] = UMAX((obj->value[0]/4)*3, 0); obj_cast_spell( obj->value[1], obj->value[0], ch, ch, NULL ); obj_cast_spell( obj->value[2], obj->value[0], ch, ch, NULL ); obj_cast_spell( obj->value[3], obj->value[0], ch, ch, NULL ); obj_cast_spell( obj->value[4], obj->value[0], ch, ch, NULL ); + amount = 14; + + gain_condition( ch, COND_FULL, amount * 3 / 4 ); + gain_condition( ch, COND_THIRST, amount * 9 / 10 ); + gain_condition(ch, COND_HUNGER, amount * 3 / 2 ); + + if ( !IS_NPC(ch) && ch->pcdata->condition[COND_FULL] > 40 ) + send_to_char( "You are full.\n\r", ch ); + if ( !IS_NPC(ch) && ch->pcdata->condition[COND_THIRST] > 40 ) + send_to_char( "Your thirst is quenched.\n\r", ch ); + extract_obj( obj ); return; } @@ -2781,6 +3136,13 @@ } } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } act( "$n recites $p.", ch, scroll, NULL, TO_ROOM ); act( "You recite $p.", ch, scroll, NULL, TO_CHAR ); @@ -2840,6 +3202,13 @@ WAIT_STATE( ch, 2 * PULSE_VIOLENCE ); + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } if ( staff->value[2] > 0 ) { act( "$n brandishes $p.", ch, staff, NULL, TO_ROOM ); @@ -2957,6 +3326,13 @@ WAIT_STATE( ch, 2 * PULSE_VIOLENCE ); + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } if ( wand->value[2] > 0 ) { if ( victim != NULL ) @@ -3038,6 +3414,11 @@ "You'd better not -- you might get hit.\n\r",ch); return; } + if (ch->spirit) + { + send_to_char( "That's tough to do without flesh.\n\r", ch); + return; + } WAIT_STATE( ch, skill_table[gsn_steal].beats ); percent = number_percent(); @@ -3052,6 +3433,13 @@ /* * Failure. */ + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } send_to_char( "Oops.\n\r", ch ); act( "$n tried to steal from you.\n\r", ch, NULL, victim, TO_VICT ); act( "$n tried to steal from $N.\n\r", ch, NULL, victim, TO_NOTVICT ); @@ -3092,32 +3480,48 @@ if ( !str_cmp( arg1, "coin" ) || !str_cmp( arg1, "coins" ) || !str_cmp( arg1, "gold" ) + || !str_cmp( arg1, "platinum" ) || !str_cmp( arg1, "silver")) { - int gold, silver; + int platinum, gold, silver; - gold = victim->gold * number_range(1, ch->level) / 60; - silver = victim->silver * number_range(1,ch->level) / 60; - if ( gold <= 0 && silver <= 0 ) + platinum = victim->platinum * number_range(1, ch->level) / MAX_LEVEL; + gold = victim->gold * number_range(1, ch->level) / MAX_LEVEL; + silver = victim->silver * number_range(1,ch->level) / MAX_LEVEL; + if ( platinum <= 0 && gold <= 0 && silver <= 0 ) { send_to_char( "You couldn't get any coins.\n\r", ch ); return; } + ch->platinum += platinum; ch->gold += gold; ch->silver += silver; victim->silver -= silver; victim->gold -= gold; - if (silver <= 0) + victim->platinum -= platinum; + if (silver <= 0 && gold <= 0) + sprintf( buf, "Bingo! You got {g%d{x platinum coins.\n\r", platinum ); + if (silver <= 0 && platinum <= 0) sprintf( buf, "Bingo! You got {g%d{x gold coins.\n\r", gold ); - else if (gold <= 0) + else if (gold <= 0 && platinum <= 0) sprintf( buf, "Bingo! You got {g%d{x silver coins.\n\r",silver); - else + else if (platinum <= 0) sprintf(buf, "Bingo! You got {g%d{x silver and {g%d{x gold coins.\n\r", silver,gold); + else if (gold <= 0) + sprintf(buf, "Bingo! You got {g%d{x silver and {g%d{x platinum coins.\n\r", + silver,platinum); + else if (silver <= 0) + sprintf(buf, "Bingo! You got {g%d{x gold and {g%d{x platinum coins.\n\r", + gold,platinum); + else + sprintf(buf, "Bingo! You got {g%d{x silver, {g%d{x gold, and {g%d{x platinum coins.\n\r", + silver,gold,platinum); send_to_char( buf, ch ); check_improve(ch,gsn_steal,TRUE,2); + do_mod_favor(ch, 0); return; } @@ -3149,7 +3553,9 @@ obj_from_char( obj ); obj_to_char( obj, ch ); + obj->got_from = 0; check_improve(ch,gsn_steal,TRUE,2); + do_mod_favor(ch, 0); send_to_char( "Got it!\n\r", ch ); return; } @@ -3320,10 +3726,12 @@ { if ( obj->pIndexData == obj2->pIndexData && !str_cmp(obj->short_descr,obj2->short_descr) ) + { if (IS_OBJ_STAT(obj2,ITEM_INVENTORY)) cost /= 2; else cost = cost * 3 / 4; + } } } @@ -3352,8 +3760,6 @@ return; } - smash_tilde( argument ); - if ( IS_SET(ch->in_room->room_flags, ROOM_PET_SHOP) ) { char arg[MAX_INPUT_LENGTH]; @@ -3410,6 +3816,11 @@ "You're not powerful enough to master this pet.\n\r", ch ); return; } + if (ch->spirit) + { + send_to_char( "That's tough to do without flesh.\n\r", ch); + return; + } /* haggle */ roll = number_percent(); @@ -3432,13 +3843,13 @@ if ( arg[0] != '\0' ) { sprintf( buf, "%s %s", pet->name, arg ); - free_string( pet->name ); + free_string( pet->name, "act_obj.c/do_buy #1" ); pet->name = str_dup( buf ); } sprintf( buf, "%sA neck tag says '{cI belong to %s{x'.\n\r", pet->description, ch->name ); - free_string( pet->description ); + free_string( pet->description, "act_obj.c/do_buy #2" ); pet->description = str_dup( buf ); char_to_room( pet, ch->in_room ); @@ -3447,6 +3858,13 @@ ch->pet = pet; pet->alignment = ch->alignment; send_to_char( "Enjoy your pet.\n\r", ch ); + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } act( "$n bought $N as a pet.", ch, NULL, pet, TO_ROOM ); return; } @@ -3472,14 +3890,34 @@ return; } + if (ch->spirit) + { + send_to_char( "That's tough to do without flesh.\n\r", ch); + return; + } + if (number < 0) { act("$n tells you '{aNice try, jackass!{x'.", keeper,NULL,ch,TO_VICT); ch->reply = keeper; + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } multi_hit( keeper, ch, TYPE_UNDEFINED ); return; } + if (number > 1000) + { + act("$n tells you '{aI don't keep that many in stock{x'.", + keeper,NULL,ch,TO_VICT); + ch->reply = keeper; + return; + } if (number == 0) number = 1; @@ -3552,6 +3990,13 @@ check_improve(ch,gsn_haggle,TRUE,4); } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } if (number > 1) { sprintf(buf,"$n buys $p[%d].",number); @@ -3771,6 +4216,11 @@ keeper,obj,ch,TO_VICT); return; } + if (ch->spirit) + { + send_to_char( "That's tough to do without flesh.\n\r", ch); + return; + } act( "$n sells $p.", ch, obj, NULL, TO_ROOM ); /* haggle */ @@ -3783,6 +4233,13 @@ cost = UMIN(cost,(keeper->silver + (100 * keeper->gold) + (10000 * keeper->platinum))); check_improve(ch,gsn_haggle,TRUE,4); } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } sprintf( buf, "You sell $p for {g%d{x silver piece%s.", cost, cost == 1 ? "" : "s" ); act( buf, ch, obj, NULL, TO_CHAR ); @@ -3914,17 +4371,7 @@ /* check if the char is using a shield or a held weapon */ if (get_eq_char(ch, WEAR_SHIELD) - && ((strcmp(class_table[ch->class].name, "mage") - && strcmp(class_table[ch->class].name, "wizard") - && strcmp(class_table[ch->class].name, "cleric") - && strcmp(class_table[ch->class].name, "priest") - && strcmp(class_table[ch->class].name, "strider")) - || (!strcmp(class_table[ch->class].name, "cleric") - && ch->level < 50) - || (!strcmp(class_table[ch->class].name, "priest") - && ch->level < 25) - || (!strcmp(class_table[ch->class].name, "strider") - && ch->level < 50))) + && !can_levitate(ch) ) { send_to_char ("You cannot use a secondary weapon while using a shield.\n\r",ch); return; @@ -3942,6 +4389,13 @@ && ( ch->class >= MAX_CLASS/2 ) && ( obj->level > 27 ) ) ) { + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } sprintf( buf, "You must be level %d to use this object.\n\r", obj->level ); send_to_char( buf, ch ); @@ -3990,16 +4444,15 @@ /* char CAN use the item! that didn't take long at aaall */ - if ( - ((shieldobj = get_eq_char(ch, WEAR_SHIELD)) != NULL) - && (!strcmp(class_table[ch->class].name, "mage") - || !strcmp(class_table[ch->class].name, "wizard") - || (!strcmp(class_table[ch->class].name, "cleric") - && ch->level > 49) - || (!strcmp(class_table[ch->class].name, "priest") - && ch->level > 24) - || (!strcmp(class_table[ch->class].name, "strider") - && ch->level > 49))) + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } + if (((shieldobj = get_eq_char(ch, WEAR_SHIELD)) != NULL) + && can_levitate(ch) ) { act ("$n levitates $p in front of $m.",ch,shieldobj,NULL,TO_ROOM); act ("You levitate $p in front of you.",ch,shieldobj,NULL,TO_CHAR); @@ -4034,6 +4487,11 @@ return; } +void do_inscribe( CHAR_DATA *ch, char *argument ) +{ + return; +} + bool can_quest(CHAR_DATA *ch) { OBJ_DATA *object; --- act_wiz.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/act_wiz.c Sat Aug 14 20:31:11 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -72,6 +70,7 @@ DECLARE_DO_FUN(do_restore ); DECLARE_DO_FUN(do_allpeace ); +void delete_me args( ( CHAR_DATA *ch ) ); /* * Local functions. @@ -181,6 +180,118 @@ } +void do_levnet( CHAR_DATA *ch, char *argument ) +{ + int flag; + char buf[MAX_STRING_LENGTH]; + + if (IS_NPC(ch)) + return; + if (IS_IMMORTAL(ch)) + { + do_wiznet(ch, argument); + return; + } + if ( argument[0] == '\0' ) + { + if (IS_SET(ch->wiznet,WIZ_ON)) + { + send_to_char("Signing off of Levnet.\n\r",ch); + REMOVE_BIT(ch->wiznet,WIZ_ON); + } + else + { + send_to_char("Welcome to Levnet!\n\r",ch); + SET_BIT(ch->wiznet,WIZ_ON); + } + return; + } + + if (!str_prefix(argument,"on")) + { + send_to_char("Welcome to Levnet!\n\r",ch); + SET_BIT(ch->wiznet,WIZ_ON); + return; + } + + if (!str_prefix(argument,"off")) + { + send_to_char("Signing off of Levnet.\n\r",ch); + REMOVE_BIT(ch->wiznet,WIZ_ON); + return; + } + + /* show levnet status */ + if (!str_prefix(argument,"status")) + { + buf[0] = '\0'; + + if (!IS_SET(ch->wiznet,WIZ_ON)) + strcat(buf,"off "); + + for (flag = 0; levnet_table[flag].name != NULL; flag++) + if (IS_SET(ch->wiznet,levnet_table[flag].flag)) + { + strcat(buf,levnet_table[flag].name); + strcat(buf," "); + } + + strcat(buf,"\n\r"); + + send_to_char("Levnet status:\n\r",ch); + send_to_char(buf,ch); + return; + } + + if (!str_prefix(argument,"show")) + /* list of all levnet options */ + { + buf[0] = '\0'; + + for (flag = 0; levnet_table[flag].name != NULL; flag++) + { + if (levnet_table[flag].level <= get_trust(ch)) + { + strcat(buf,levnet_table[flag].name); + strcat(buf," "); + } + } + + strcat(buf,"\n\r"); + + send_to_char("Levnet options available to you are:\n\r",ch); + send_to_char(buf,ch); + return; + } + + flag = levnet_lookup(argument); + + if (flag == -1 || get_trust(ch) < levnet_table[flag].level) + { + send_to_char("No such option.\n\r",ch); + return; + } + + if (IS_SET(ch->wiznet,levnet_table[flag].flag)) + { + sprintf(buf,"You will no longer see %s on levnet.\n\r", + levnet_table[flag].name); + send_to_char(buf,ch); + REMOVE_BIT(ch->wiznet,levnet_table[flag].flag); + return; + } + else + { + sprintf(buf,"You will now see %s on levnet.\n\r", + levnet_table[flag].name); + send_to_char(buf,ch); + SET_BIT(ch->wiznet,levnet_table[flag].flag); + return; + } + +} + + void wiznet(char *string, CHAR_DATA *ch, OBJ_DATA *obj, long flag, long flag_skip, int min_level) { @@ -212,6 +323,7 @@ { char arg1[MAX_INPUT_LENGTH]; DESCRIPTOR_DATA *d; + CHAR_DATA *victim; argument = one_argument( argument, arg1 ); @@ -231,6 +343,35 @@ send_to_char("Your quest flag is now on.\n\r",ch); return; } + if (!str_cmp(arg1, "mob")) + { + argument = one_argument( argument, arg1 ); + if ( arg1[0] == '\0' ) + { + send_to_char("Quest which mobile?\n\r",ch); + return; + } + if ( ( victim = get_char_room( ch, arg1 ) ) == NULL ) + { + send_to_char( "They aren't here.\n\r", ch ); + return; + } + if (!IS_NPC(victim)) + { + send_to_char( "Not on PC's.\n\r", ch ); + return; + } + if (victim->on_quest) + { + send_to_char( "Quest flag removed.\n\r", ch ); + victim->on_quest = FALSE; + } else + { + send_to_char( "Quest flag set.\n\r", ch ); + victim->on_quest = TRUE; + } + return; + } if (!str_cmp(arg1, "on")) { if (global_quest) @@ -257,6 +398,14 @@ d->character->on_quest = FALSE; } } + for ( victim = char_list; victim != NULL; victim = victim->next ) + { + if (!IS_NPC(victim)) + continue; + if (!victim->on_quest) + continue; + victim->on_quest = FALSE; + } send_to_char("The global quest flag is now off.\n\r",ch); return; } @@ -276,6 +425,12 @@ return; } + if (ch->spirit) + { + send_to_char( "You have no flesh to carry anything!\n\r", ch); + return; + } + if ( ( obj = get_eq_char( ch, WEAR_LIGHT ) ) == NULL ) { if (ch->carry_number + 1 > can_carry_n(ch)) @@ -379,7 +534,7 @@ if ( IS_SET(victim->comm, COMM_NOCHANNELS) ) { REMOVE_BIT(victim->comm, COMM_NOCHANNELS); - send_to_char( "The gods have restored your channel priviliges.\n\r", + send_to_char( "The gods have restored your channel privileges.\n\r", victim ); send_to_char( "NOCHANNELS removed.\n\r", ch ); sprintf(buf,"$N restores channels to %s",victim->name); @@ -388,7 +543,7 @@ else { SET_BIT(victim->comm, COMM_NOCHANNELS); - send_to_char( "The gods have revoked your channel priviliges.\n\r", + send_to_char( "The gods have revoked your channel privileges.\n\r", victim ); send_to_char( "NOCHANNELS set.\n\r", ch ); sprintf(buf,"$N revokes %s's channels.",victim->name); @@ -398,6 +553,40 @@ return; } +void do_authorize( CHAR_DATA *ch, char *argument ) +{ + char arg[MAX_INPUT_LENGTH], buf[MAX_STRING_LENGTH]; + CHAR_DATA *victim; + + one_argument( argument, arg ); + + if ( arg[0] == '\0' ) + { + send_to_char( "Authorize whom?", ch ); + return; + } + + if ( ( victim = get_char_world( ch, arg ) ) == NULL ) + { + send_to_char( "They aren't here.\n\r", ch ); + return; + } + + if ( victim->newbie != 0 ) + { + victim->newbie = 0; + send_to_char( "The gods have given you full channel privileges.\n\r", + victim ); + send_to_char( "Newbie status removed.\n\r", ch ); + sprintf(buf,"$N gives channel access to %s",victim->name); + wiznet(buf,ch,NULL,WIZ_PENALTIES,WIZ_SECURE,0); + } else { + send_to_char( "That player is not a newbie.\n\r", ch ); + } + + return; +} + void do_smote(CHAR_DATA *ch, char *argument ) { @@ -498,8 +687,6 @@ if ( !IS_NPC(ch) ) { - smash_tilde( argument ); - if (argument[0] == '\0') { sprintf(buf,"Your poofin is %s\n\r",ch->pcdata->bamfin); @@ -513,7 +700,7 @@ return; } - free_string( ch->pcdata->bamfin ); + free_string( ch->pcdata->bamfin, "act_wiz.c/do_bamfin" ); ch->pcdata->bamfin = str_dup( argument ); sprintf(buf,"Your poofin is now %s\n\r",ch->pcdata->bamfin); @@ -529,9 +716,7 @@ char buf[MAX_STRING_LENGTH]; if ( !IS_NPC(ch) ) - { - smash_tilde( argument ); - + { if (argument[0] == '\0') { sprintf(buf,"Your poofout is %s\n\r",ch->pcdata->bamfout); @@ -545,7 +730,7 @@ return; } - free_string( ch->pcdata->bamfout ); + free_string( ch->pcdata->bamfout, "act_wiz.c/do_bamfout" ); ch->pcdata->bamfout = str_dup( argument ); sprintf(buf,"Your poofout is now %s\n\r",ch->pcdata->bamfout); @@ -952,6 +1137,35 @@ return; } +void do_arena( CHAR_DATA *ch, char *argument ) +{ + char arg[MAX_INPUT_LENGTH]; + char buf[MAX_STRING_LENGTH]; + int vnum; + + one_argument( argument, arg ); + + if ( arg[0] == '\0' ) + { + send_to_char( "Arena whom?\n\r", ch); + return; + } + + vnum = number_range(9,35); + if (vnum < 10) + vnum = 10; + if (vnum > 34) + vnum = 34; + + sprintf(buf, "Transfering %s to vnum #%d\n\r", arg, vnum); + send_to_char(buf,ch); + buf[0] = '\0'; + sprintf(buf, "%s %d", arg, vnum); + do_transfer( ch, buf ); + + return; +} + void do_transfer( CHAR_DATA *ch, char *argument ) { char arg1[MAX_INPUT_LENGTH]; @@ -1399,6 +1613,12 @@ return; } +void do_ftick ( CHAR_DATA *ch, char *argument ) +{ + update_handler( TRUE ); + return; +} + /* RT to replace the 3 stat commands */ void do_stat ( CHAR_DATA *ch, char *argument ) @@ -1488,22 +1708,70 @@ return; } - sprintf( buf, "Name: '%s'\n\rArea: '%s'\n\r", + sprintf( buf, "Name: {G'%s'{x\n\rArea: {B'%s'{x\n\r", location->name, location->area->name ); send_to_char( buf, ch ); sprintf( buf, - "Vnum: %d Sector: %d Light: %d Healing: %d Mana: %d\n\r", + "Vnum: {Y%d{x Sector: {Y%d{x Light: {Y%d{x Healing: {Y%s%d{x Mana: {Y%d{x\n\r", location->vnum, location->sector_type, location->light, + (location->heal_neg) ? "-": "", location->heal_rate, location->mana_rate ); send_to_char( buf, ch ); + if (location->clan) + { + sprintf( buf, "This room is owned by the [{%s%s{x] clan.\n\r", + clan_table[location->clan].pkill ? "B" : "M", + clan_table[location->clan].who_name); + send_to_char( buf, ch ); + } + + if (location->guild != NULL) + { + GUILD_DATA *guild; + + send_to_char( "Guild Hall: ", ch); + for (guild = location->guild; guild != NULL; guild = guild->next) + { + sprintf(buf, "{%s%c{%s%c%c%c%c ", + guild->guild < MAX_CLASS/2 ? "R" : "B", + class_table[guild->guild].who_name[0], + guild->guild < MAX_CLASS/2 ? "r" : "b", + class_table[guild->guild].who_name[1], + class_table[guild->guild].who_name[2], + class_table[guild->guild].who_name[3], + class_table[guild->guild].who_name[4]); + send_to_char(buf, ch); + } + send_to_char("{x\n\r", ch); + } + if (location->race != NULL) + { + RACE_DATA *race; + + send_to_char( "Racial Hall: ", ch); + for (race = location->race; race != NULL; race = race->next) + { + sprintf(buf, "{G%s ", + race_table[race->race].name); + send_to_char(buf, ch); + } + send_to_char("{x\n\r", ch); + } + if (location->warn[0] != '\0') + { + send_to_char( "Warning: ", ch); + send_to_char( location->warn, ch); + send_to_char( "\n\r", ch); + } + sprintf( buf, - "Room flags: %s.\n\rDescription:\n\r%s", + "Room flags: {C%s{x.\n\rDescription:\n\r%s", room_bit_name(location->room_flags), location->description ); send_to_char( buf, ch ); @@ -1512,17 +1780,17 @@ { EXTRA_DESCR_DATA *ed; - send_to_char( "Extra description keywords: '", ch ); + send_to_char( "Extra description keywords: {B'", ch ); for ( ed = location->extra_descr; ed; ed = ed->next ) { send_to_char( ed->keyword, ch ); if ( ed->next != NULL ) send_to_char( " ", ch ); } - send_to_char( "'.\n\r", ch ); + send_to_char( "'{x.\n\r", ch ); } - send_to_char( "Characters:", ch ); + send_to_char( "Characters:{R", ch ); for ( rch = location->people; rch; rch = rch->next_in_room ) { if (( get_trust(ch) >= rch->ghost_level) @@ -1534,14 +1802,14 @@ } } - send_to_char( ".\n\rObjects: ", ch ); + send_to_char( ".{x\n\rObjects:{G ", ch ); for ( obj = location->contents; obj; obj = obj->next_content ) { send_to_char( " ", ch ); one_argument( obj->name, buf ); send_to_char( buf, ch ); } - send_to_char( ".\n\r", ch ); + send_to_char( ".{x\n\r", ch ); for ( door = 0; door <= 5; door++ ) { @@ -1550,7 +1818,7 @@ if ( ( pexit = location->exit[door] ) != NULL ) { sprintf( buf, - "Door: %d. To: %d. Key: %d. Exit flags: %d.\n\rKeyword: '%s'. Description: %s", + "Door: {Y%d.{x To: {Y%d.{x Key: {Y%d.{x Exit flags: {Y%d.{x\n\rKeyword: '%s'. Description: %s", door, (pexit->u1.to_room == NULL ? -1 : pexit->u1.to_room->vnum), @@ -1595,9 +1863,12 @@ sprintf( buf, "Vnum: %d Format: %s Type: %s Resets: %d\n\r", obj->pIndexData->vnum, obj->pIndexData->new_format ? "new" : "old", - item_type_name(obj), obj->pIndexData->reset_num ); + item_type_name(obj->pIndexData), obj->pIndexData->reset_num ); send_to_char( buf, ch ); + if (obj->quest) + send_to_char("This is a quest item.\n\r",ch); + sprintf( buf, "Short description: %s\n\rLong description: %s\n\r", obj->short_descr, obj->description ); send_to_char( buf, ch ); @@ -1796,10 +2067,22 @@ if (is_class_obj(obj)) { - sprintf( buf, "This object may only be used by a %s.\n\r", - class_table[obj->class].name - ); - send_to_char( buf, ch ); + GUILD_DATA *guild; + + send_to_char( "Guild Object: ", ch); + for (guild = obj->pIndexData->guild; guild != NULL; guild = guild->next) + { + sprintf(buf, "{%s%c{%s%c%c%c%c ", + guild->guild < MAX_CLASS/2 ? "R" : "B", + class_table[guild->guild].who_name[0], + guild->guild < MAX_CLASS/2 ? "r" : "b", + class_table[guild->guild].who_name[1], + class_table[guild->guild].who_name[2], + class_table[guild->guild].who_name[3], + class_table[guild->guild].who_name[4]); + send_to_char(buf, ch); + } + send_to_char("{x\n\r", ch); } if ( obj->extra_descr != NULL || obj->pIndexData->extra_descr != NULL ) @@ -1975,6 +2258,14 @@ sprintf(buf,"Count: %d Killed: %d\n\r", victim->pIndexData->count,victim->pIndexData->killed); add_buf(output,buf); + } else + { + if ( victim->pcdata->deity ) + { + sprintf( buf, "Deity: %s Favor: %d ", victim->pcdata->deity_name, + victim->pcdata->favor ); + add_buf( output, buf ); + } } sprintf( buf, @@ -1997,13 +2288,33 @@ victim->move, victim->max_move, IS_NPC(ch) ? 0 : victim->practice ); add_buf(output,buf); - - sprintf( buf, - "Lv: %d Class: %s Align: %d Exp: %ld\n\r", - victim->level, - IS_NPC(victim) ? "mobile" : class_table[victim->class].name, - victim->alignment, - victim->exp ); + + if (IS_NPC(victim) ) + { + sprintf( buf, + "Lv: %d Class: %s Align: %d Exp: %ld\n\r", + victim->level, + "mobile", + victim->alignment, + victim->exp ); + } else if (victim->pcdata->tier != 2) + { + sprintf( buf, + "Lv: %d Class: %s Align: %d Exp: %ld\n\r", + victim->level, + class_table[victim->class].name, + victim->alignment, + victim->exp ); + } else + { + sprintf( buf, + "Lv: %d Class: %s/%s Align: %d Exp: %ld\n\r", + victim->level, + class_table[victim->class].name, + class_table[victim->clasb].name, + victim->alignment, + victim->exp ); + } add_buf(output,buf); sprintf( buf, @@ -2011,6 +2322,17 @@ victim->platinum, victim->gold, victim->silver ); add_buf(output,buf); + if (!IS_NPC(victim)) + { + sprintf( buf, + "Bank-0: %ld Bank-1: %ld Bank-2: %ld Bank-3: %ld\n\r", + victim->balance[0] > 0 ? victim->balance[0] : 0, + victim->balance[1] > 0 ? victim->balance[1] : 0, + victim->balance[2] > 0 ? victim->balance[2] : 0, + victim->balance[3] > 0 ? victim->balance[3] : 0 ); + add_buf(output,buf); + } + sprintf(buf,"Armor: pierce: %d bash: %d slash: %d magic: %d\n\r", GET_AC(victim,AC_PIERCE), GET_AC(victim,AC_BASH), GET_AC(victim,AC_SLASH), GET_AC(victim,AC_EXOTIC)); @@ -2234,6 +2556,7 @@ MOB_INDEX_DATA *pMobIndex; int vnum; int nMatch; + int count; bool fAll; bool found; @@ -2247,6 +2570,7 @@ fAll = FALSE; /* !str_cmp( arg, "all" ); */ found = FALSE; nMatch = 0; + count = 0; output = new_buf(); /* @@ -2263,11 +2587,14 @@ if ( fAll || is_name( argument, pMobIndex->player_name ) ) { found = TRUE; + count++; sprintf( buf, "[%5d] %s\n\r", pMobIndex->vnum, pMobIndex->short_descr ); add_buf(output,buf); } } + if ( count >= 200 ) + break; } if ( !found ) @@ -2293,6 +2620,7 @@ OBJ_INDEX_DATA *pObjIndex; int vnum; int nMatch; + int count; bool fAll; bool found; @@ -2306,6 +2634,7 @@ fAll = FALSE; /* !str_cmp( arg, "all" ); */ found = FALSE; nMatch = 0; + count = 0; output = new_buf(); /* @@ -2322,11 +2651,14 @@ if ( fAll || is_name( argument, pObjIndex->name ) ) { found = TRUE; + count++; sprintf( buf, "[%5d] %s\n\r", pObjIndex->vnum, pObjIndex->short_descr ); add_buf(output,buf); } } + if ( count >= 200 ) + break; } if ( !found ) @@ -2468,6 +2800,8 @@ add_buf(buffer,buf); } } + if ( count >= 200 ) + break; } if ( !found ) @@ -2761,7 +3095,7 @@ ch ); if (ch->prompt != NULL) { - free_string(ch->prompt); + free_string(ch->prompt, "act_wiz.c/do_return"); ch->prompt = NULL; } @@ -3100,13 +3434,13 @@ obj = create_object( pObjIndex, 0 ); name = wch->name; sprintf( buf, obj->short_descr, name ); - free_string( obj->short_descr ); + free_string( obj->short_descr, "act_wiz.c/do_vload #1" ); obj->short_descr = str_dup( buf ); sprintf( buf, obj->description, name ); - free_string( obj->description ); + free_string( obj->description, "act_wiz.c/do_vload #2" ); obj->description = str_dup( buf ); sprintf( buf, obj->name, name ); - free_string( obj->name ); + free_string( obj->name, "act_wiz.c/do_vload #3" ); obj->name = str_dup( buf ); if ( CAN_WEAR(obj, ITEM_TAKE) ) obj_to_char( obj, ch ); @@ -3213,7 +3547,7 @@ -void do_advance( CHAR_DATA *ch, char *argument ) +void do_chlevel( CHAR_DATA *ch, char *argument ) { char arg1[MAX_INPUT_LENGTH]; char arg2[MAX_INPUT_LENGTH]; @@ -3227,7 +3561,7 @@ if ( arg1[0] == '\0' || arg2[0] == '\0' || !is_number( arg2 ) ) { - send_to_char( "Syntax: advance .\n\r", ch ); + send_to_char( "Syntax: chlevel .\n\r", ch ); return; } @@ -3284,7 +3618,7 @@ victim->hit = victim->max_hit; victim->mana = victim->max_mana; victim->move = victim->max_move; - advance_level_quiet( victim ); + change_level_quiet( victim ); victim->practice = temp_prac; } else @@ -3302,7 +3636,7 @@ for ( iLevel = victim->level ; iLevel < level; iLevel++ ) { victim->level += 1; - advance_level_quiet( victim ); + change_level_quiet( victim ); } victim->exp = exp_per_level(victim,victim->pcdata->points) * UMAX( 1, victim->level ); @@ -3363,7 +3697,7 @@ { send_to_char( "You raise a level!! ", victim ); victim->level += 1; - advance_level( victim ); + change_level_quiet( victim ); } victim->exp = exp_per_level(victim,victim->pcdata->points) * UMAX( 1, victim->level ); @@ -3423,7 +3757,7 @@ { send_to_char( "You raise a level!! ", victim ); victim->level += 1; - advance_level( victim ); + change_level_quiet( victim ); } victim->exp = exp_per_level(victim,victim->pcdata->points) * UMAX( 1, victim->level ); @@ -3761,6 +4095,10 @@ } else { + if ( IS_SET(victim->comm, COMM_TITLE_LOCK) ) + { + REMOVE_BIT(victim->comm, COMM_TITLE_LOCK); + } SET_BIT(victim->act, PLR_NOTITLE); send_to_char( "NOTITLE set.\n\r", ch ); sprintf(buf,"$N denys %s title.",victim->name); @@ -4211,7 +4549,6 @@ CHAR_DATA *victim; int value; - smash_tilde( argument ); argument = one_argument( argument, arg1 ); argument = one_argument( argument, arg2 ); strcpy( arg3, argument ); @@ -4295,7 +4632,7 @@ if ( value < 3 || value > get_max_train(victim,STAT_DEX) ) { sprintf(buf, - "Dexterity ranges is 3 to %d.\n\r", + "Dexterity range is 3 to %d.\n\r", get_max_train(victim,STAT_DEX)); send_to_char( buf, ch ); return; @@ -4600,6 +4937,82 @@ return; } +void do_rename( CHAR_DATA *ch, char *argument ) +{ + char arg1 [MAX_INPUT_LENGTH]; + char arg2 [MAX_INPUT_LENGTH]; + char buf [MAX_STRING_LENGTH]; + char name [MAX_INPUT_LENGTH]; + char oldname [MAX_INPUT_LENGTH]; + char strsave [MAX_STRING_LENGTH]; + CHAR_DATA *victim; + int clan; + int clead; + + argument = one_argument( argument, arg1 ); + strcpy( arg2, argument ); + + if ( arg1[0] == '\0' || arg2[0] == '\0') + { + send_to_char("Syntax:\n\r",ch); + send_to_char(" rename \n\r",ch); + return; + } + + if ( ( victim = get_char_world( ch, arg1 ) ) == NULL ) + { + send_to_char( "They aren't here.\n\r", ch ); + return; + } + + if ( IS_NPC( victim ) ) + { + send_to_char( "Not on NPC's.\n\r", ch ); + return; + } + + if (victim->level >= ch->level) + { + send_to_char( "Nope, ain't gonna do it.\n\r", ch ); + return; + } + + if ( check_char_exist( arg2 ) ) + { + send_to_char( "That name is already in use, or is illegal.\n\r", ch ); + return; + } + sprintf(name, "%s", str_dup(capitalize(arg2))); + sprintf(oldname, "%s", str_dup(victim->name)); + sprintf( strsave, "%s%s", PLAYER_DIR, capitalize( victim->name ) ); + clan = 0; + clead = 0; + if (is_clead(victim)) + { + clead = victim->clead; + update_clanlist(victim, victim->clead, FALSE, TRUE); + } + if (is_clan(victim)) + { + clan = victim->clan; + update_clanlist(victim, victim->clan, FALSE, FALSE); + } + victim->name = str_dup(name); + victim->clead = clead; + victim->clan = clan; + if (clan != 0) + update_clanlist(victim, victim->clan, TRUE, FALSE); + if (clead != 0) + update_clanlist(victim, victim->clan, TRUE, TRUE); + do_save(victim, ""); + sprintf(buf, "Your name has been changed to '%s'.\n\r", name ); + send_to_char( buf, victim ); + send_to_char( "Ok.\n\r", ch); + unlink(strsave); + return; +} + + void do_string( CHAR_DATA *ch, char *argument ) { char type [MAX_INPUT_LENGTH]; @@ -4612,7 +5025,6 @@ OBJ_DATA *obj; int cnt, plc; - smash_tilde( argument ); argument = one_argument( argument, type ); argument = one_argument( argument, arg1 ); argument = one_argument( argument, arg2 ); @@ -4738,21 +5150,21 @@ send_to_char( "Not on PC's.\n\r", ch ); return; } - free_string( victim->name ); + free_string( victim->name, "act_wiz.c/do_string #1" ); victim->name = str_dup( arg3 ); return; } if ( !str_prefix( arg2, "short" ) ) { - free_string( victim->short_descr ); + free_string( victim->short_descr, "act_wiz.c/do_string #2" ); victim->short_descr = str_dup( arg3 ); return; } if ( !str_prefix( arg2, "long" ) ) { - free_string( victim->long_descr ); + free_string( victim->long_descr, "act_wiz.c/do_string #3" ); strcat(arg3,"\n\r"); victim->long_descr = str_dup( arg3 ); return; @@ -4809,21 +5221,21 @@ } if ( !str_prefix( arg2, "name" ) ) { - free_string( obj->name ); + free_string( obj->name, "act_wiz.c/do_string #4" ); obj->name = str_dup( arg3 ); return; } if ( !str_prefix( arg2, "short" ) ) { - free_string( obj->short_descr ); + free_string( obj->short_descr, "act_wiz.c/do_string #5" ); obj->short_descr = str_dup( arg3 ); return; } if ( !str_prefix( arg2, "long" ) ) { - free_string( obj->description ); + free_string( obj->description, "act_wiz.c/do_string #6" ); obj->description = str_dup( arg3 ); return; } @@ -4867,9 +5279,7 @@ OBJ_DATA *obj; int value; int clan; - int class; - smash_tilde( argument ); argument = one_argument( argument, arg1 ); argument = one_argument( argument, arg2 ); strcpy( arg3, argument ); @@ -4880,7 +5290,7 @@ send_to_char(" set obj \n\r",ch); send_to_char(" Field being one of:\n\r", ch ); send_to_char(" value0 value1 value2 value3 value4 (v1-v4)\n\r", ch ); - send_to_char(" level weight cost timer clan guild\n\r", ch ); + send_to_char(" level weight cost timer clan\n\r", ch ); return; } @@ -4910,21 +5320,6 @@ obj->clan = clan; return; } - if ( !str_prefix( arg2, "guild" ) ) - { - if (!str_prefix(arg3,"none")) - { - obj->class = 0; - return; - } - if ((class = class_lookup(arg3)) == 0) - { - send_to_char("No such guild exists.\n\r",ch); - return; - } - obj->class = class; - return; - } /* * Snarf the value (which need not be numeric). @@ -5059,7 +5454,6 @@ ROOM_INDEX_DATA *location; int value; - smash_tilde( argument ); argument = one_argument( argument, arg1 ); argument = one_argument( argument, arg2 ); strcpy( arg3, argument ); @@ -5202,7 +5596,7 @@ CHAR_DATA *vch; CHAR_DATA *vch_next; - if (get_trust(ch) < MAX_LEVEL - 3) + if (get_trust(ch) < MAX_LEVEL - 2) { send_to_char("Not at your level!\n\r",ch); return; @@ -5520,7 +5914,7 @@ } send_to_char("Prefix removed.\r\n",ch); - free_string(ch->prefix); + free_string(ch->prefix, "act_wiz.c/do_prefix #1"); ch->prefix = str_dup(""); return; } @@ -5528,7 +5922,7 @@ if (ch->prefix[0] != '\0') { sprintf(buf,"Prefix changed to %s.\r\n",argument); - free_string(ch->prefix); + free_string(ch->prefix, "act_wiz.c/do_prefix #2"); } else { @@ -5684,10 +6078,15 @@ return; } - if ( ( victim = get_char_world( ch, arg ) ) == NULL ) + if (strcmp(ch->name, argument)) { - send_to_char( "They aren't here.\n\r", ch ); - return; + if ( ( victim = get_char_world( ch, arg ) ) == NULL ) + { + send_to_char( "They aren't here.\n\r", ch ); + return; + } + } else { + victim = ch; } if ( (victim->level >= 10) && (ch->level < DEMI) ) @@ -5702,6 +6101,12 @@ return; } + if (victim->spirit) + { + send_to_char( "Spirits can't carry anything.\n\r", ch); + return; + } + pack = create_object( get_obj_index(OBJ_VNUM_SURVIVAL_PACK), 0 ); pack->level = 5; @@ -5841,8 +6246,6 @@ if (IS_NPC(ch)) return; - smash_tilde( argument ); - argument = one_argument(argument,arg); one_argument(argument,arg2); @@ -5919,7 +6322,7 @@ if(!strcmp(arg2,victim->pcdata->dupes[pos])) { send_to_char("Dupe removed.\n\r",ch); - free_string(victim->pcdata->dupes[pos]); + free_string(victim->pcdata->dupes[pos], "act_wiz.c/do_dupe"); victim->pcdata->dupes[pos] = NULL; found = TRUE; } @@ -5944,3 +6347,70 @@ sprintf(buf,"%s now has the dupe %s set.\n\r",victim->name,arg2); send_to_char(buf,ch); } + +void do_forcedelet( CHAR_DATA *ch, char *argument ) +{ + send_to_char( "If you want to forcedelete, you have to spell it out.\n\r",ch); + return; +} + +void do_forcedelete( CHAR_DATA *ch, char *argument ) +{ + char arg[MAX_INPUT_LENGTH]; + CHAR_DATA *victim; + + one_argument( argument, arg ); + + if ( arg[0] == '\0' ) + { + send_to_char( "Force who to delete?", ch ); + return; + } + + if ( ( victim = get_exact_world( ch, arg ) ) == NULL ) + { + send_to_char( "They aren't here.\n\r", ch ); + return; + } + + if (IS_NPC(ch)) + { + send_to_char( "NPC's can't delete.\n\r", ch); + return; + } + + if ( victim->level >= ch->level ) + { + send_to_char( "You failed.\n\r", ch ); + return; + } + + delete_me( victim ); +} + +void delete_me( CHAR_DATA *ch ) +{ + char strsave[MAX_INPUT_LENGTH]; + + if (IS_NPC(ch)) + return; + + send_to_char("{GYou get an overwhelming urge to kill yourself.{x\n\r",ch); + send_to_char("{RUnable to resist the temptation, you grab the nearest sharp{x\n\r",ch); + send_to_char("{Robject and spill your guts out all over the floor.{x\n\r",ch); + if (is_clead(ch)) + update_clanlist(ch, ch->clead, FALSE, TRUE); + if (is_clan(ch)) + update_clanlist(ch, ch->clead, FALSE, FALSE); + sprintf( strsave, "%s%s", PLAYER_DIR, capitalize( ch->name ) ); + wiznet("$N commits religious suicide.",ch,NULL,0,0,0); + stop_fighting(ch,TRUE); + if (ch->level > HERO) + { + update_wizlist(ch, 1); + } + do_quit(ch,""); + unlink(strsave); + return; +} + --- alias.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/alias.c Sat Aug 14 20:31:11 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -51,8 +49,6 @@ ch = d->original ? d->original : d->character; - smash_tilde( argument ); - /* check for prefix */ if (ch->prefix[0] != '\0' && str_prefix("prefix",argument)) { @@ -91,7 +87,7 @@ strcat(buf,point); break; } - if (strlen(buf) > MAX_INPUT_LENGTH) + if (strlen(buf) > MAX_INPUT_LENGTH - 1) { send_to_char("Alias substitution too long. Truncated.\r\n",ch); buf[MAX_INPUT_LENGTH -1] = '\0'; @@ -121,8 +117,6 @@ if (IS_NPC(rch)) return; - smash_tilde( argument ); - argument = one_argument(argument,arg); @@ -189,7 +183,7 @@ if (!str_cmp(arg,rch->pcdata->alias[pos])) /* redefine an alias */ { - free_string(rch->pcdata->alias_sub[pos]); + free_string(rch->pcdata->alias_sub[pos], "alias.c/do_alias"); rch->pcdata->alias_sub[pos] = str_dup(argument); sprintf(buf,"%s is now realiased to '%s'.\n\r",arg,argument); send_to_char(buf,ch); @@ -228,7 +222,7 @@ argument = one_argument(argument,arg); - if (arg == '\0') + if (arg[0] == '\0') { send_to_char("Unalias what?\n\r",ch); return; @@ -251,8 +245,8 @@ if(!strcmp(arg,rch->pcdata->alias[pos])) { send_to_char("Alias removed.\n\r",ch); - free_string(rch->pcdata->alias[pos]); - free_string(rch->pcdata->alias_sub[pos]); + free_string(rch->pcdata->alias[pos], "alias.c/do_unalias #1"); + free_string(rch->pcdata->alias_sub[pos], "alias.c/do_unalias #2"); rch->pcdata->alias[pos] = NULL; rch->pcdata->alias_sub[pos] = NULL; found = TRUE; --- ban.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/ban.c Fri Aug 6 23:06:04 1999 @@ -1,34 +1,32 @@ -/*************************************************************************** - * 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* 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. * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * +***************************************************************************/ +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) --- clans.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/clans.c Fri Aug 6 23:06:04 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -75,62 +73,62 @@ OBJ_VNUM_PIT, TRUE, TRUE, "Unused" }, - {"example", "Example ", - ROOM_VNUM_EXAMPLE, ENT_VNUM_EXAMPLE, - OBJ_PIT_EXAMPLE, - FALSE, TRUE, "Example clan"}, - - {"empty_1", " Unused ", - ROOM_VNUM_ALTAR, ROOM_VNUM_ALTAR, - OBJ_VNUM_PIT, - TRUE, TRUE, "Unused" }, - - {"empty_2", " Unused ", - ROOM_VNUM_ALTAR, ROOM_VNUM_ALTAR, - OBJ_VNUM_PIT, - TRUE, TRUE, "Unused" }, - - {"empty_3", " Unused ", - ROOM_VNUM_ALTAR, ROOM_VNUM_ALTAR, - OBJ_VNUM_PIT, - TRUE, TRUE, "Unused" }, - - {"empty_4", " Unused ", - ROOM_VNUM_ALTAR, ROOM_VNUM_ALTAR, - OBJ_VNUM_PIT, - TRUE, TRUE, "Unused" }, - - {"empty_5", " Unused ", - ROOM_VNUM_ALTAR, ROOM_VNUM_ALTAR, - OBJ_VNUM_PIT, - TRUE, TRUE, "Unused" }, - - {"empty_6", " Unused ", - ROOM_VNUM_ALTAR, ROOM_VNUM_ALTAR, - OBJ_VNUM_PIT, - TRUE, TRUE, "Unused" }, - - {"empty_7", " Unused ", - ROOM_VNUM_ALTAR, ROOM_VNUM_ALTAR, - OBJ_VNUM_PIT, - TRUE, TRUE, "Unused" }, - - {"empty_8", " Unused ", - ROOM_VNUM_ALTAR, ROOM_VNUM_ALTAR, - OBJ_VNUM_PIT, - TRUE, TRUE, "Unused" }, - - {"empty_9", " Unused ", - ROOM_VNUM_ALTAR, ROOM_VNUM_ALTAR, - OBJ_VNUM_PIT, - TRUE, TRUE, "Unused" }, - - {"empty_10", " Unused ", - ROOM_VNUM_ALTAR, ROOM_VNUM_ALTAR, - OBJ_VNUM_PIT, - TRUE, TRUE, "Unused" }, + {"guardians", "Guardian", + ROOM_VNUM_GUARDIANS, ENT_VNUM_GUARDIANS, + OBJ_PIT_GUARDIANS, + FALSE, FALSE, "Guardians of the Realm" }, + + {"empty1", " Unused ", + ROOM_VNUM_ALTAR, ROOM_VNUM_ALTAR, + OBJ_VNUM_PIT, + TRUE, TRUE, "Unused" }, + + {"dark_mist", "DarkMist", + ROOM_VNUM_DARKMIST, ENT_VNUM_DARKMIST, + OBJ_PIT_DARKMIST, + FALSE, TRUE, "Dark Mist" }, + + {"empty2", " Unused ", + ROOM_VNUM_ALTAR, ROOM_VNUM_ALTAR, + OBJ_VNUM_PIT, + TRUE, TRUE, "Unused" }, + + {"empty3", " Unused ", + ROOM_VNUM_ALTAR, ROOM_VNUM_ALTAR, + OBJ_VNUM_PIT, + TRUE, TRUE, "Unused" }, + + {"midnight", "Midnight", + ROOM_VNUM_MIDNIGHT, ENT_VNUM_MIDNIGHT, + OBJ_PIT_MIDNIGHT, + FALSE, TRUE, "The Clan of Midnight Wolves" }, + + {"judges", " Judges ", + ROOM_VNUM_JUDGES, ENT_VNUM_JUDGES, + OBJ_PIT_JUDGES, + FALSE, FALSE, "Judges of Justice" }, + + {"empty4", " Unused ", + ROOM_VNUM_ALTAR, ROOM_VNUM_ALTAR, + OBJ_VNUM_PIT, + TRUE, TRUE, "Unused" }, + + {"angels", " Angels ", + ROOM_VNUM_ANGELS, ENT_VNUM_ANGELS, + OBJ_PIT_ANGELS, + FALSE, TRUE, "Hell's Angels" }, + + {"empty5", " Unused ", + ROOM_VNUM_ALTAR, ROOM_VNUM_ALTAR, + OBJ_VNUM_PIT, + TRUE, TRUE, "Unused" }, + + {"empty6", " Unused ", + ROOM_VNUM_ALTAR, ROOM_VNUM_ALTAR, + OBJ_VNUM_PIT, + TRUE, TRUE, "Unused" }, - {"empty_11", " Unused ", + {"empty7", " Unused ", ROOM_VNUM_ALTAR, ROOM_VNUM_ALTAR, OBJ_VNUM_PIT, TRUE, TRUE, "Unused" }, @@ -152,8 +150,28 @@ if ( arg1[0] == '\0' ) { send_to_char( "Syntax: clead \n\r",ch); + send_to_char( " clead delete \n\r",ch); return; } + if ( !str_cmp( arg1, "delete" ) ) + { + char cnum[MAX_INPUT_LENGTH]; + char cnam[MAX_INPUT_LENGTH]; + int clan; + + argument = one_argument( argument, cnum ); + one_argument( argument, cnam ); + + if ( !is_number( cnum ) + || ( cnam[0] == '\0' ) ) + { + send_to_char( "Syntax: clead delete \n\r",ch); + return; + } + clan = atoi( cnum ); + modify_clanlist( ch, clan, cnam ); + return; + } if ( ( victim = get_char_world( ch, arg1 ) ) == NULL ) { send_to_char( "They aren't playing.\n\r", ch ); @@ -173,6 +191,12 @@ return; } + if ((victim->class < MAX_CLASS/2) && (victim->level < 70)) + { + send_to_char("Only second or third tier players may be clan leaders before level 70.\n\r",ch); + return; + } + if (is_clead(victim)) { sprintf(buf,"They are no longer leader of clan %s.\n\r", @@ -230,6 +254,7 @@ update_clanlist(victim, victim->clan, FALSE, FALSE); victim->clan = 0; victim->clead = 0; + victim->clock = 0; return; } @@ -274,8 +299,115 @@ } update_clanlist(victim, clan, TRUE, FALSE); victim->clan = clan; + victim->clock = 0; +} + +void do_lone( CHAR_DATA *ch, char *argument ) +{ + send_to_char( "The 'loner' command cannot be shortened.\n\r",ch); + return; } +void do_loner( CHAR_DATA *ch, char *argument ) +{ + char buf[MAX_STRING_LENGTH]; + + if (IS_NPC(ch)) + return; + + if ((ch->clock && ch->clock <= ch->level) + || IS_IMMORTAL(ch)) + { + ch->clock = 0; + } + + if (IS_SET(ch->act, PLR_NOCLAN)) + { + send_to_char( "You have been banned from pkill clans.\n\r", ch); + return; + } + + if (ch->class < MAX_CLASS/2) + { + if (ch->level < 25) + { + send_to_char( "You must be at least level 25 to use this command.\n\r",ch); + return; + } + } + else + { + if (ch->level < 15) + { + send_to_char( "You must be at least level 15 to use this command.\n\r",ch); + return; + } + } + + if (ch->pcdata->confirm_loner) + { + if (argument[0] != '\0') + { + send_to_char("Loner selection removed.\n\r",ch); + } + else + { + if (ch->clock) + { + sprintf(buf, "You may not change your clan status again till level %d.\n\r", ch->clock); + send_to_char(buf, ch); + } + else if (ch->clan) + { + if (ch->clan == clan_lookup("loner")) + { + ch->clan = 0; + ch->clead = 0; + ch->clock = ch->level + 3; + send_to_char("You are no longer a {RLoner{x.\n\r",ch); + } + } else + { + ch->clan = clan_lookup("loner"); + ch->clead = 0; + ch->clock = ch->level + 6; + send_to_char("You are now a {RLoner{x.\n\r",ch); + } + } + ch->pcdata->confirm_loner = FALSE; + return; + } + if (argument[0] != '\0') + { + send_to_char("Just type loner. No argument.\n\r",ch); + return; + } + if (ch->clan && ch->clan != clan_lookup("loner")) + { + send_to_char("You are already in another clan.\n\r",ch); + return; + } + if (ch->clock) + { + sprintf(buf, "You may not change your clan status again till level %d.\n\r", ch->clock); + send_to_char(buf, ch); + return; + } + if (ch->clan) + { + send_to_char("Type loner again to confirm removing loner status.\n\r",ch); + send_to_char("WARNING: once you remove loner status, you must wait 3 levels to join a clan.\n\r",ch); + } else + { + send_to_char("Type loner again to confirm becoming a loner.\n\r",ch); + send_to_char("WARNING: once you become a loner, you must remain one for at least 6 levels.\n\r",ch); + } + send_to_char("Typing loner with an argument will undo loner selection.\n\r",ch); + ch->pcdata->confirm_loner = TRUE; + return; +} + + void do_member( CHAR_DATA *ch, char *argument ) { char arg1[MAX_INPUT_LENGTH]; @@ -285,9 +417,7 @@ argument = one_argument( argument, arg1 ); if (IS_NPC(ch)) - { return; - } if (!is_clead(ch)) { @@ -310,6 +440,7 @@ ch->clan = ch->invited; update_clanlist(ch, ch->invited, TRUE, FALSE); ch->invited = 0; + ch->clock = 0; return; } if (!str_cmp(arg1, "deny")) @@ -337,7 +468,8 @@ send_to_char( "NPC's cannot join clans.\n\r", ch); return; } - + if (victim->clock && victim->clock <= victim->level) + victim->clock = 0; if (IS_SET(victim->act, PLR_NOCLAN) && clan_table[ch->clan].pkill) { send_to_char( "This player is banned from pkill clans.\n\r", ch); @@ -363,6 +495,7 @@ send_to_char("Your clan leader has kicked you out!\n\r",victim); update_clanlist(victim, victim->clan, FALSE, FALSE); victim->clan = 0; + victim->clock = victim->level + 3; return; } if (victim->invited) @@ -370,6 +503,12 @@ send_to_char( "They have already been invited to join a clan.\n\r",ch); return; } + if (victim->clock) + { + sprintf(buf, "%s may not join a clan again till level %d.\n\r", victim->name, victim->clock); + send_to_char(buf,ch); + return; + } if ( (victim->class < MAX_CLASS/2) && ( victim->level < 25 || victim->level > 70 ) ) { send_to_char( "They must be between levels 25 -> 70.\n\r",ch); @@ -528,6 +667,12 @@ send_to_char("The gods have revoked your channel priviliges.\n\r",ch); return; } + if ((ch->in_room->vnum == ROOM_VNUM_CORNER) + && (!IS_IMMORTAL(ch))) + { + send_to_char("Just keep your nose in the corner like a good little player.\n\r",ch); + return; + } REMOVE_BIT(ch->comm,COMM_NOCLAN); @@ -591,15 +736,8 @@ } if (IS_IMMORTAL(ch)) { - sprintf( buf, "{xName: {Y%s{x", - clan_table[e].name ); - for ( ; ; ) - { - if (strlen(buf) > 29) - break; - - strcat(buf, " "); - } + sprintf( buf, "{x#{G%-2d {xName: {Y%-17s{x", + e, clan_table[e].name ); add_buf(output,buf); sprintf( buf, "{xVnum: {Y%d{x\n\r", clan_table[e].hall ); @@ -846,3 +984,48 @@ } return; } + +void modify_clanlist(CHAR_DATA *ch, int clannum, char *argument ) +{ + char arg[MAX_INPUT_LENGTH]; + MBR_DATA *prev; + MBR_DATA *curr; + CLN_DATA *pcln; + bool clead = TRUE; + bool add = FALSE; + + if (IS_NPC(ch)) + { + return; + } + one_argument(argument, arg); + for (pcln = cln_list; pcln != NULL; pcln = pcln->next) + { + if (pcln->clan == clannum) + { + if (clead) + { + if (!add) + { + prev = NULL; + for ( curr = pcln->list; curr != NULL; prev = curr, curr = curr->next ) + { + if ( !str_cmp( capitalize(arg), curr->name ) ) + { + if ( prev == NULL ) + pcln->list = pcln->list->next; + else + prev->next = curr->next; + + free_mbr(curr); + save_clanlist(clannum); + } + } + return; + } + } + } + } + return; +} + --- comm.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/comm.c Mon Jul 31 22:43:07 2000 @@ -1,37 +1,32 @@ /*************************************************************************** - * Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer, * - * Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe. * - * * - * Merc Diku vMud 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. * - * * - * Thanks to abaddon for proof-reading our comm.c and pointing out bugs. * - * Any remaining bugs are, of course, our work, not his. :) * - * * - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ /* @@ -73,6 +68,7 @@ DECLARE_DO_FUN(do_skills ); DECLARE_DO_FUN(do_outfit ); DECLARE_DO_FUN(do_unread ); +DECLARE_DO_FUN(do_pack ); /* @@ -134,6 +130,7 @@ /* * OS-dependent declarations. */ + #if defined(_AIX) #include int accept args( ( int s, struct sockaddr *addr, int *addrlen ) ); @@ -172,13 +169,18 @@ #endif #if defined(linux) +/* int accept args( ( int s, struct sockaddr *addr, int *addrlen ) ); int bind args( ( int s, struct sockaddr *name, int namelen ) ); -int close args( ( int fd ) ); +*/ +/* You may need to uncomment these next three lines, depending on your Linux */ +/* int getpeername args( ( int s, struct sockaddr *name, int *namelen ) ); int getsockname args( ( int s, struct sockaddr *name, int *namelen ) ); -int gettimeofday args( ( struct timeval *tp, struct timezone *tzp ) ); int listen args( ( int s, int backlog ) ); +*/ +int close args( ( int fd ) ); +int gettimeofday args( ( struct timeval *tp, struct timezone *tzp ) ); int read args( ( int fd, char *buf, int nbyte ) ); int select args( ( int width, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout ) ); @@ -252,6 +254,23 @@ #endif /* This includes Solaris Sys V as well */ +#if defined(solaris) +// int accept args( ( int s, struct sockaddr *addr, int *addrlen ) ); +//int bind args( ( int s, struct sockaddr *name, int namelen ) ); +// void bzero args( ( char *b, int length ) ); +int close args( ( int fd ) ); +// int getpeername args( ( int s, struct sockaddr *name, int *namelen ) ); +// int getsockname args( ( int s, struct sockaddr *name, int *namelen ) ); +//int gettimeofday args( ( struct timeval *tp, struct timezone *tzp ) ); +// int listen args( ( int s, int backlog ) ); +int read args( ( int fd, char *buf, int nbyte ) ); +int select args( ( int width, fd_set *readfds, fd_set *writefds, + fd_set *exceptfds, struct timeval *timeout ) ); +// int setsockopt args( ( int s, int level, int optname, + // const char *optval, int optlen ) ); +int socket args( ( int domain, int type, int protocol ) ); +int write args( ( int fd, char *buf, int nbyte ) ); +#else #if defined(sun) int accept args( ( int s, struct sockaddr *addr, int *addrlen ) ); int bind args( ( int s, struct sockaddr *name, int namelen ) ); @@ -274,6 +293,7 @@ int socket args( ( int domain, int type, int protocol ) ); int write args( ( int fd, char *buf, int nbyte ) ); #endif +#endif #if defined(ultrix) int accept args( ( int s, struct sockaddr *addr, int *addrlen ) ); @@ -475,7 +495,7 @@ exit( 1 ); } -#if defined(SO_DONTLINGER) && !defined(SYSV) +#if defined(SO_DONTLINGER) && !defined(SYSV) && !defined(solaris) { struct linger ld; @@ -658,7 +678,7 @@ /* * Autonomous game motion. */ - update_handler( ); + update_handler( FALSE ); @@ -871,7 +891,7 @@ /* * Autonomous game motion. */ - update_handler( ); + update_handler( FALSE ); @@ -1200,86 +1220,100 @@ bug("WWW-Who: fopen",0); perror(buf); } - for ( d = descriptor_list; d != NULL; d = d->next ) + else { - CHAR_DATA *wch; - char const *class; - - buf[0] = '\0'; - /* - * Check for match against restrictions. - * Don't use trust as that exposes trusted mortals. - */ - if ( d->connected != CON_PLAYING || d->character->invis_level > 1 - || d->character->incog_level > 1) - continue; + for ( d = descriptor_list; d != NULL; d = d->next ) + { + CHAR_DATA *wch; + char const *class; + char const *clasb; + + buf[0] = '\0'; + /* + * Check for match against restrictions. + * Don't use trust as that exposes trusted mortals. + */ + if ( d->connected != CON_PLAYING || d->character->invis_level > 1 + || d->character->incog_level > 1) + continue; - wch = ( d->original != NULL ) ? d->original : d->character; + wch = ( d->original != NULL ) ? d->original : d->character; - if (IS_SHIELDED(wch,SHD_INVISIBLE)) - continue; + if (IS_SHIELDED(wch,SHD_INVISIBLE)) + continue; - if (wch->invis_level >= 2 || wch->incog_level >= 2 ) - continue; + if (wch->invis_level >= 2 || wch->incog_level >= 2 ) + continue; - if (wch->in_room->vnum == ROOM_VNUM_CORNER) - continue; + if (wch->in_room->vnum == ROOM_VNUM_CORNER) + continue; - if ( wch->level < iLevelLower - || wch->level > iLevelUpper - || ( fImmortalOnly && wch->level < LEVEL_IMMORTAL ) - || ( fClassRestrict && !rgfClass[wch->class] ) - || ( fRaceRestrict && !rgfRace[wch->race]) - || ( fClan && !is_clan(wch)) - || ( fClanRestrict && !rgfClan[wch->clan])) - continue; + if ( wch->level < iLevelLower + || wch->level > iLevelUpper + || ( fImmortalOnly && wch->level < LEVEL_IMMORTAL ) + || ( fClassRestrict && !rgfClass[wch->class] ) + || ( fRaceRestrict && !rgfRace[wch->race]) + || ( fClan && !is_clan(wch)) + || ( fClanRestrict && !rgfClan[wch->clan])) + continue; - nMatch++; + nMatch++; - /* - * Figure out what to print for class. - */ - class = class_table[wch->class].who_name; - - /* - * Format it up. - */ - if (!is_clan(wch)) - { - sprintf(clandat, "X,3,3"); - } - else - { - if (clan_table[wch->clan].independent) - { - sprintf(clandat, "%s,0,0", clan_table[wch->clan].who_name); - } - else if (is_clead(wch) && is_pkill(wch)) + /* + * Figure out what to print for class. + */ + if (wch->pcdata->tier != 2) { - sprintf(clandat, "%s,1,1", clan_table[wch->clan].who_name); - } - else if (is_clead(wch) && !is_pkill(wch)) - { - sprintf(clandat, "%s,2,1", clan_table[wch->clan].who_name); - } - else if (is_pkill(wch)) - { - sprintf(clandat, "%s,1,0", clan_table[wch->clan].who_name); + class = class_table[wch->class].who_name; + clasb = ""; } else { - sprintf(clandat, "%s,2,0", clan_table[wch->clan].who_name); + class = class_table[wch->class].swho_name; + clasb = class_table[wch->clasb].swho_name; } - } - sprintf(buf2, "%s", IS_NPC(wch) ? "" : wch->pcdata->title); - str_replace(buf2, "{%", "{-"); - sprintf( buf, "%3d,%s,%s,%s,%s%s\n\r", wch->level, + + /* + * Format it up. + */ + if (!is_clan(wch)) + { + sprintf(clandat, "X,3,3"); + } + else + { + if (clan_table[wch->clan].independent) + { + sprintf(clandat, "%s,0,0", clan_table[wch->clan].who_name); + } + else if (is_clead(wch) && is_pkill(wch)) + { + sprintf(clandat, "%s,1,1", clan_table[wch->clan].who_name); + } + else if (is_clead(wch) && !is_pkill(wch)) + { + sprintf(clandat, "%s,2,1", clan_table[wch->clan].who_name); + } + else if (is_pkill(wch)) + { + sprintf(clandat, "%s,1,0", clan_table[wch->clan].who_name); + } + else + { + sprintf(clandat, "%s,2,0", clan_table[wch->clan].who_name); + } + } + sprintf(buf2, "%s", IS_NPC(wch) ? "" : wch->pcdata->title); + str_replace(buf2, "{%", "{-"); + sprintf( buf, "%3d,%s,%s%s%s,%s,%s%s\n\r", wch->level, wch->race < MAX_PC_RACE ? pc_race_table[wch->race].who_name : " ", - class, clandat, wch->name, buf2); - fprintf(fg,buf); + class, (wch->pcdata->tier == 2) ? "/" : "" , clasb, clandat, + wch->name, buf2); + fprintf(fg,buf); + } + fclose(fg); } - fclose(fg); close( desc ); free_descriptor(dnew); return; @@ -1314,6 +1348,11 @@ { sprintf( log_buf, "Closing link to %s.", ch->name ); log_string( log_buf ); + if ( ch->pet && ch->pet->in_room == NULL ) + { + char_to_room(ch->pet, get_room_index(ROOM_VNUM_LIMBO) ); + extract_char(ch->pet, TRUE); + } if ( dclose->connected == CON_PLAYING ) { act( "$n has lost $s link.", ch, NULL, NULL, TO_ROOM ); @@ -1492,8 +1531,14 @@ } else { - d->repeat++; - if ( d->repeat == 25 ) + if ( ++d->repeat == 25 && !d->character ) + { + sprintf( log_buf, "Address %s Spamming ! at CON_GET_NAME", d->host ); + log_string( log_buf ); + write_to_descriptor( d->descriptor, "\n\rYou've been logged and warned, continued spamming will get you banned.\n\r", 0 ); + close_socket ( d ); + } + else if ( d->repeat == 25 ) { sprintf( log_buf, "%s input spamming!", d->host ); log_string( log_buf ); @@ -1581,7 +1626,9 @@ else percent = -1; - if (percent >= 100) + if (!IS_NPC(victim) && (victim->spirit)) + sprintf(wound,"is DEAD!"); + else if (percent >= 100) sprintf(wound,"is in excellent condition."); else if (percent >= 90) sprintf(wound,"has a few scratches."); @@ -1700,7 +1747,8 @@ outlet += 6; if ((pexit = ch->in_room->exit[outlet]) != NULL && pexit ->u1.to_room != NULL - && (can_see_room(ch,pexit->u1.to_room) + && ((can_see_room(ch,pexit->u1.to_room) + && can_see_door(ch,pexit->exit_info)) || (IS_AFFECTED(ch,AFF_INFRARED) && !IS_AFFECTED(ch,AFF_BLIND))) && !IS_SET(pexit->exit_info,EX_CLOSED)) @@ -1715,7 +1763,8 @@ portal = get_obj_exit( door_name[door], ch->in_room->contents); if ((portal != NULL) - && !IS_AFFECTED(ch,AFF_BLIND)) + && !IS_AFFECTED(ch,AFF_BLIND) + && can_see_door(ch,(long)portal->value[1])) { found = TRUE; round = TRUE; @@ -1826,7 +1875,7 @@ } outbuf = alloc_mem( 2 * d->outsize ); strncpy( outbuf, d->outbuf, d->outtop ); - free_mem( d->outbuf, d->outsize ); + free_mem( d->outbuf, d->outsize, "comm.c/write_to_buffer" ); d->outbuf = outbuf; d->outsize *= 2; } @@ -1879,6 +1928,7 @@ void nanny( DESCRIPTOR_DATA *d, char *argument ) { DESCRIPTOR_DATA *d_old, *d_next; + MUD_DATA *pmud; char buf[MAX_STRING_LENGTH]; char newbuf[MAX_STRING_LENGTH]; char arg[MAX_INPUT_LENGTH]; @@ -1887,6 +1937,7 @@ CHAR_DATA *victim; char *pwdnew; char *p; + char *strtime; int iClass,race,i,weapon; int pos; bool fOld; @@ -1904,7 +1955,7 @@ close_socket( d ); return; - case CON_GET_NAME: +case CON_GET_NAME: if ( argument[0] == '\0' ) { close_socket( d ); @@ -1995,6 +2046,13 @@ return; } + sprintf( buf, "NOTICE: This system REQUIRES fantasy role-playing type names, If + your\n\r"); + write_to_buffer( d, buf, 0 ); + sprintf( buf, "chosen name does not conform to this, an IMM *WILL* eventually ask\n\r"); + write_to_buffer( d, buf, 0 ); + sprintf( buf, "you to delete it and create a new character.\n\r\n\r"); + write_to_buffer( d, buf, 0 ); sprintf( buf, "Did I get that right, %s (Y/N)? ", argument ); write_to_buffer( d, buf, 0 ); d->connected = CON_CONFIRM_NEW_NAME; @@ -2002,7 +2060,7 @@ } break; - case CON_GET_OLD_PASSWORD: +case CON_GET_OLD_PASSWORD: #if defined(unix) write_to_buffer( d, "\n\r", 2 ); #endif @@ -2028,8 +2086,13 @@ wiznet(log_buf,NULL,NULL,WIZ_SITES,0,get_trust(ch)); ch->pcdata->socket = str_dup( d->host ); - if (IS_SET(ch->act, PLR_REROLL ) ) + if (IS_SET(ch->act, PLR_SECOND ) || IS_SET(ch->act, PLR_THIRD ) ) { + long act; + int color; + + act = ch->act; + color = ch->color; sprintf( strsave, "%s%s", PLAYER_DIR, capitalize( ch->name ) ); sprintf(newbuf, "%s", str_dup( ch->pcdata->pwd )); sprintf( argument, "%s", capitalize( ch->name ) ); @@ -2037,11 +2100,17 @@ d->character = NULL; fOld = load_char_reroll( d, argument ); ch = d->character; - free_string( ch->pcdata->pwd ); + free_string( ch->pcdata->pwd, "comm.c/nanny #1" ); ch->pcdata->pwd = str_dup( newbuf ); newbuf[0] = '\0'; - ch->pcdata->tier = 1; + if (IS_SET(act, PLR_SECOND ) ) + ch->pcdata->tier = 1; + else + ch->pcdata->tier = 2; ch->pcdata->socket = str_dup( d->host ); + ch->color = color; + if ( IS_SET( act, PLR_COLOUR ) ) + SET_BIT( ch->act, PLR_COLOUR ); write_to_buffer( d, echo_on_str, 0 ); write_to_buffer(d,"The following races are available:\n\r\n\r",0); pos = 0; @@ -2063,7 +2132,6 @@ d->connected = CON_GET_NEW_RACE; break; } - if ( IS_IMMORTAL(ch) ) { do_help( ch, "imotd" ); @@ -2084,11 +2152,13 @@ force_quit(victim, ""); } + check_robbed( ch ); + break; /* RT code for breaking link */ - case CON_BREAK_CONNECT: +case CON_BREAK_CONNECT: switch( *argument ) { case 'y' : case 'Y': @@ -2132,7 +2202,7 @@ } break; - case CON_CONFIRM_NEW_NAME: +case CON_CONFIRM_NEW_NAME: switch ( *argument ) { case 'y': case 'Y': @@ -2156,7 +2226,7 @@ } break; - case CON_GET_NEW_PASSWORD: +case CON_GET_NEW_PASSWORD: #if defined(unix) write_to_buffer( d, "\n\r", 2 ); #endif @@ -2181,13 +2251,13 @@ } } - free_string( ch->pcdata->pwd ); + free_string( ch->pcdata->pwd, "comm.c/nanny #2" ); ch->pcdata->pwd = str_dup( pwdnew ); write_to_buffer( d, "Please retype password: ", 0 ); d->connected = CON_CONFIRM_NEW_PASSWORD; break; - case CON_CONFIRM_NEW_PASSWORD: +case CON_CONFIRM_NEW_PASSWORD: #if defined(unix) write_to_buffer( d, "\n\r", 2 ); #endif @@ -2222,7 +2292,7 @@ d->connected = CON_GET_NEW_RACE; break; - case CON_GET_NEW_RACE: +case CON_GET_NEW_RACE: one_argument(argument,arg); @@ -2285,7 +2355,7 @@ break; - case CON_GET_NEW_SEX: +case CON_GET_NEW_SEX: switch ( argument[0] ) { case 'm': case 'M': ch->sex = SEX_MALE; @@ -2303,8 +2373,11 @@ } write_to_buffer( d, echo_on_str, 0 ); - write_to_buffer(d,"The following classes are available:\n\r\n\r",0); - if (ch->pcdata->tier != 1) { + if (ch->pcdata->tier == 2) + write_to_buffer(d,"The following primary classes are available:\n\r\n\r",0); + else + write_to_buffer(d,"The following classes are available:\n\r\n\r",0); + if (ch->pcdata->tier < 1) { ch->pcdata->tier = 0; for ( iClass = 0; iClass < MAX_CLASS/2; iClass++ ) { @@ -2321,11 +2394,14 @@ } } write_to_buffer(d,"\n\r\n\r",0); - write_to_buffer(d,"What is your class ? ",0); + if (ch->pcdata->tier == 2) + write_to_buffer(d,"What is your PRIMARY class ? ",0); + else + write_to_buffer(d,"What is your class ? ",0); d->connected = CON_GET_NEW_CLASS; break; - case CON_GET_NEW_CLASS: +case CON_GET_NEW_CLASS: iClass = class_lookup(argument); if ( iClass == -1 ) @@ -2334,7 +2410,7 @@ "That's not a class.\n\rWhat IS your class? ", 0 ); return; } - if (ch->pcdata->tier != 1) { + if (ch->pcdata->tier < 1) { if (iClass >= (MAX_CLASS/2)) { write_to_buffer( d, "That's not a first tier class.\n\rWhat IS your class? ", 0 ); @@ -2348,7 +2424,60 @@ } } ch->class = iClass; + if (ch->pcdata->tier == 0) { + ch->newbie = 1; + } + + if (ch->pcdata->tier == 2) { + write_to_buffer( d, echo_on_str, 0 ); + write_to_buffer(d,"The following secondary classes are available:\n\r\n\r",0); + for ( iClass = 0; iClass < MAX_CLASS/2; iClass++ ) + { + if (iClass == (ch->class - (MAX_CLASS/2))) + continue; + write_to_buffer(d," ",0); + write_to_buffer(d,class_table[iClass].name,0); + write_to_buffer(d,"\n\r",1); + } + write_to_buffer(d,"\n\r\n\r",0); + write_to_buffer(d,"What is your SECONDARY class ? ",0); + d->connected = CON_GET_SECOND_CLASS; + break; + } + + sprintf( log_buf, "%s@%s new player.", ch->name, d->host ); + log_string( log_buf ); + wiznet("Newbie alert! $N sighted.",ch,NULL,WIZ_NEWBIE,0,0); + wiznet(log_buf,NULL,NULL,WIZ_SITES,0,get_trust(ch)); + + write_to_buffer( d, "\n\r", 2 ); + write_to_buffer( d, "You may be good, neutral, or evil.\n\r",0); + write_to_buffer( d, "Which alignment (G/N/E)? ",0); + d->connected = CON_GET_ALIGNMENT; + break; +case CON_GET_SECOND_CLASS: + iClass = class_lookup(argument); + + if ( iClass == -1 ) + { + write_to_buffer( d, + "That's not a class.\n\rWhat IS your secondary class? ", 0 ); + return; + } + if (iClass >= (MAX_CLASS/2)) { + write_to_buffer( d, + "That's not a first tier class.\n\rWhat IS your secondary class? ", 0 ); + return; + } + if (iClass == (ch->class - (MAX_CLASS/2))) { + write_to_buffer( d, + "You cannot choose the first tier equivalent of your primary class.\n\r", 0); + write_to_buffer( d, + "What IS your secondary class? ", 0 ); + return; + } + ch->clasb = iClass; sprintf( log_buf, "%s@%s new player.", ch->name, d->host ); log_string( log_buf ); wiznet("Newbie alert! $N sighted.",ch,NULL,WIZ_NEWBIE,0,0); @@ -2376,7 +2505,11 @@ group_add(ch,"rom basics",FALSE); group_add(ch,class_table[ch->class].base_group,FALSE); + if (ch->pcdata->tier == 2) + group_add(ch,class_table[ch->clasb].base_group,FALSE); ch->pcdata->learned[gsn_recall] = 50; + if (ch->pcdata->tier == 2) + ch->pcdata->learned[gsn_recall] = 75; write_to_buffer(d,"Do you wish to customize this character?\n\r",0); write_to_buffer(d,"Customization takes time, but allows a wider range of skills and abilities.\n\r",0); write_to_buffer(d,"Customize (Y/N)? ",0); @@ -2399,6 +2532,8 @@ break; case 'n': case 'N': group_add(ch,class_table[ch->class].default_group,TRUE); + if (ch->pcdata->tier == 2) + group_add(ch,class_table[ch->clasb].default_group,TRUE); write_to_buffer( d, "\n\r", 2 ); write_to_buffer(d, "Please pick a weapon from the following choices:\n\r",0); @@ -2419,7 +2554,7 @@ } break; - case CON_PICK_WEAPON: +case CON_PICK_WEAPON: write_to_buffer(d,"\n\r",2); weapon = weapon_lookup(argument); if (weapon == -1 || ch->pcdata->learned[*weapon_table[weapon].gsn] <= 0) @@ -2444,7 +2579,7 @@ d->connected = CON_READ_MOTD; break; - case CON_GEN_GROUPS: +case CON_GEN_GROUPS: send_to_char("\n\r",ch); if (!str_cmp(argument,"done")) { @@ -2481,13 +2616,13 @@ do_help(ch,"menu choice"); break; - case CON_READ_IMOTD: +case CON_READ_IMOTD: write_to_buffer(d,"\n\r",2); do_help( ch, "motd" ); d->connected = CON_READ_MOTD; break; - case CON_READ_MOTD: +case CON_READ_MOTD: if ( ch->pcdata == NULL || ch->pcdata->pwd[0] == '\0') { write_to_buffer( d, "Warning! Null password!\n\r",0 ); @@ -2497,7 +2632,7 @@ } write_to_buffer( d, - "\n\rWelcome to ROT 1.4. Please do not feed the immortals.\n\r", + "\n\rWelcome to RoT 2.0, Please do not feed the twits.\n\r", 0 ); ch->next = char_list; char_list = ch; @@ -2508,6 +2643,9 @@ { ch->perm_stat[class_table[ch->class].attr_prime] += 3; + if (ch->pcdata->tier == 2) + ch->perm_stat[class_table[ch->clasb].attr_prime] = + UMIN(ch->perm_stat[class_table[ch->clasb].attr_prime] + 2, 25); ch->level = 1; ch->exp = exp_per_level(ch,ch->pcdata->points); @@ -2525,7 +2663,8 @@ obj_to_char(create_object(get_obj_index(OBJ_VNUM_MAP),0),ch); obj_to_char(create_object(get_obj_index(OBJ_VNUM_WMAP),0),ch); obj_to_char(create_object(get_obj_index(OBJ_VNUM_EMAP),0),ch); - + obj_to_char(create_object(get_obj_index(OBJ_VNUM_QPOUCH),0),ch); + do_pack(ch, ch->name); char_to_room( ch, get_room_index( ROOM_VNUM_SCHOOL ) ); send_to_char("\n\r",ch); do_help(ch,"NEWBIE INFO"); @@ -2560,9 +2699,276 @@ } do_unread(ch,""); + + check_robbed( ch ); + break; - } +case CON_MUD_GET_NAME: + if (argument[0] == '\0') + { + write_to_buffer( d, "Aborted.\n\r", 0); + ch->next = char_list; + char_list = ch; + d->connected = CON_PLAYING; + char_to_room( ch, ch->was_in_room ); + if ( ch->pmud != NULL ) + { + free_mud(ch->pmud); + ch->pmud = NULL; + } + break; + } + smash_tilde( argument ); + + pmud = new_mud(); + pmud->next = NULL; + pmud->sender = str_dup( ch->name ); + pmud->date = str_dup( "" ); + pmud->name = str_dup( "" ); + pmud->base = str_dup( "" ); + pmud->address = str_dup( "" ); + pmud->port = 0; + pmud->www = str_dup( "" ); + ch->pmud = pmud; + + buf[0] = '\0'; + sprintf(buf, "%s{x", argument); + free_string( ch->pmud->name, "comm.c/nanny #3" ); + ch->pmud->name = str_dup( buf ); + buf[0] = '\0'; + send_to_char( "\n\r{GEnter the code base for the mud:{x\n\r",ch ); + send_to_char( "{Gie: {RRoT, ROM, Smaug, Merc{x\n\r\n\r",ch ); + send_to_char( " {YBase:{x ",ch); + d->connected = CON_MUD_GET_BASE; + break; + +case CON_MUD_GET_BASE: + if (argument[0] == '\0') + { + write_to_buffer( d, "Aborted.\n\r", 0); + ch->next = char_list; + char_list = ch; + d->connected = CON_PLAYING; + char_to_room( ch, ch->was_in_room ); + if ( ch->pmud != NULL ) + { + free_mud(ch->pmud); + ch->pmud = NULL; + } + break; + } + smash_tilde( argument ); + + buf[0] = '\0'; + sprintf(buf, "%s{x", argument); + free_string( ch->pmud->base, "comm.c/nanny #4" ); + ch->pmud->base = str_dup( buf ); + buf[0] = '\0'; + send_to_char( "\n\r{GEnter the address for the mud, do not enter the port number yet:{x\n\r",ch ); + send_to_char( "{Gie: {Rmud.rot.com{x\n\r\n\r",ch ); + send_to_char( " {YAddress:{x ",ch); + d->connected = CON_MUD_GET_ADDRESS; + break; + +case CON_MUD_GET_ADDRESS: + if (argument[0] == '\0') + { + write_to_buffer( d, "Aborted.\n\r", 0); + ch->next = char_list; + char_list = ch; + d->connected = CON_PLAYING; + char_to_room( ch, ch->was_in_room ); + if ( ch->pmud != NULL ) + { + free_mud(ch->pmud); + ch->pmud = NULL; + } + break; + } + smash_tilde( argument ); + + buf[0] = '\0'; + sprintf(buf, "%s{x", argument); + free_string( ch->pmud->address, "comm.c/nanny #5" ); + ch->pmud->address = str_dup( buf ); + buf[0] = '\0'; + send_to_char( "\n\r{GEnter the port for the mud:{x\n\r",ch ); + send_to_char( "{Gie: {R9000{x\n\r\n\r",ch ); + send_to_char( " {YPort:{x ",ch); + d->connected = CON_MUD_GET_PORT; + break; + +case CON_MUD_GET_PORT: + if (argument[0] == '\0') + { + write_to_buffer( d, "Aborted.\n\r", 0); + ch->next = char_list; + char_list = ch; + d->connected = CON_PLAYING; + char_to_room( ch, ch->was_in_room ); + if ( ch->pmud != NULL ) + { + free_mud(ch->pmud); + ch->pmud = NULL; + } + break; + } + + if (!is_number(argument) || (atoi(argument) < 1) + || (atoi(argument) > 9999)) + { + send_to_char( "\n\r{RThat's NOT a valid port.\n\r", ch ); + send_to_char( "\n\r{GEnter the port for the mud:{x\n\r",ch ); + send_to_char( "{Gie: {R9000{x\n\r\n\r",ch ); + send_to_char( " {YPort:{x ",ch); + d->connected = CON_MUD_GET_PORT; + break; + } + ch->pmud->port = atoi(argument); + send_to_char( "\n\r{GEnter the WWW page address for the mud:{x\n\r",ch ); + send_to_char( "{Gie: {Rhttp://www.rot.com/~rot{x\n\r",ch ); + send_to_char( "{GLeave blank if there is not a www page, anything other than a functional{x\n\r", ch); + send_to_char( "{Gweb page address here will cause this ad to be deleted by the imms.{x\n\r\n\r", ch); + send_to_char( " {YWWW:{x ",ch); + d->connected = CON_MUD_GET_WWW; + break; + +case CON_MUD_GET_WWW: + buf[0] = '\0'; + if (argument[0] == '\0') + { + sprintf(buf, ""); + } else + { + sprintf(buf, "%s{x", argument); + } + str_replace(buf, "~", "[-]"); + free_string( ch->pmud->www, "comm.c/nanny #6" ); + ch->pmud->www = str_dup( buf ); + buf[0] = '\0'; + send_to_char( "\n\r",ch); + send_to_char( "{G Name:{x ",ch); + sprintf(buf, "%s\n\r", ch->pmud->name); + send_to_char(buf,ch); + buf[0] = '\0'; + send_to_char( "{GCode Base:{x ",ch); + sprintf(buf, "%s\n\r", ch->pmud->base); + send_to_char(buf,ch); + buf[0] = '\0'; + send_to_char( "{G Address:{x ",ch); + sprintf(buf, "%s ", ch->pmud->address); + send_to_char(buf,ch); + buf[0] = '\0'; + send_to_char( "{GPort{x ",ch); + sprintf(buf, "%d\n\r", ch->pmud->port); + send_to_char(buf,ch); + buf[0] = '\0'; + send_to_char( "{G WWW:{x ",ch); + sprintf(buf, "%s\n\r", ch->pmud->www); + str_replace(buf, "[-]", "~"); + send_to_char(buf,ch); + buf[0] = '\0'; + + send_to_char( "\n\r{GSave the above to the mud ads list?{x\n\r\n\r",ch ); + send_to_char( " {Y(Y/N)?{x ",ch); + d->connected = CON_MUD_SAVE; + break; + +case CON_MUD_SAVE: + write_to_buffer(d,"\n\r",2); + switch ( argument[0] ) + { + case 'y': case 'Y': + ch->pmud->next = NULL; + strtime = ctime( ¤t_time ); + strtime[strlen(strtime)-1] = '\0'; + ch->pmud->date = str_dup( strtime ); + ch->pmud->date_stamp = current_time; + + append_mud(ch->pmud); + ch->pmud = NULL; + ch->next = char_list; + char_list = ch; + d->connected = CON_PLAYING; + char_to_room( ch, ch->was_in_room ); + break; + case 'n': case 'N': + write_to_buffer( d, "Aborted.\n\r", 0); + ch->next = char_list; + char_list = ch; + d->connected = CON_PLAYING; + char_to_room( ch, ch->was_in_room ); + if ( ch->pmud != NULL ) + { + free_mud(ch->pmud); + ch->pmud = NULL; + } + break; + default: + send_to_char( " {Y(Y/N)?{x ",ch); + return; + } + break; + +case CON_REROLL: +#if defined(unix) + write_to_buffer( d, "\n\r", 2 ); +#endif + + sprintf( log_buf, "%s@%s is recreating.", ch->name, d->host ); + log_string( log_buf ); + wiznet(log_buf,NULL,NULL,WIZ_SITES,0,get_trust(ch)); + ch->pcdata->socket = str_dup( d->host ); + + { + long act; + int color; + + act = ch->act; + color = ch->color; + sprintf( strsave, "%s%s", PLAYER_DIR, capitalize( ch->name ) ); + sprintf(newbuf, "%s", str_dup( ch->pcdata->pwd )); + sprintf( argument, "%s", capitalize( ch->name ) ); + free_char( d->character ); + d->character = NULL; + fOld = load_char_reroll( d, argument ); + ch = d->character; + free_string( ch->pcdata->pwd, "comm.c/nanny #7" ); + ch->pcdata->pwd = str_dup( newbuf ); + newbuf[0] = '\0'; + if (IS_SET(act, PLR_SECOND ) ) + ch->pcdata->tier = 1; + else if (IS_SET(act, PLR_THIRD ) ) + ch->pcdata->tier = 2; + else + ch->pcdata->tier = 0; + ch->pcdata->socket = str_dup( d->host ); + ch->color = color; + if ( IS_SET( act, PLR_COLOUR ) ) + SET_BIT( ch->act, PLR_COLOUR ); + write_to_buffer( d, echo_on_str, 0 ); + write_to_buffer(d,"The following races are available:\n\r\n\r",0); + pos = 0; + for ( race = 1; race_table[race].name != NULL; race++ ) + { + if (!race_table[race].pc_race) + break; + sprintf(newbuf, "%6s%-24s", " ", race_table[race].name); + write_to_buffer(d,newbuf,0); + pos++; + if (pos >= 2) { + write_to_buffer(d,"\n\r",1); + pos = 0; + } + } + newbuf[0] = '\0'; + write_to_buffer(d,"\n\r\n\r",0); + write_to_buffer(d,"What is your race (help for more information)? ",0); + d->connected = CON_GET_NEW_RACE; + } + break; + } return; } @@ -2578,7 +2984,11 @@ * Reserved words. */ if ( is_name( name, - "all auto immortal immortals self someone something the you demise balance circle loner honor") ) +"all auto immortal immortals self anonymous someone something the you demise +circle loner honor phuq this mud gay buzz biotch delos shimtis lobo balance +thunder cosm none quit null natas aaa bbb ccc ddd eee fff ggg hhh iii jjj +kkk lll mmm nnn ooo ppp qqq rrr sss ttt uuu vvv www xxx yyy zzz asdf fdsa +qwer queer jkl lkj poiuy cyber coke psy darkblade artimus") ) return FALSE; if (str_cmp(capitalize(name),"Alander") && (!str_prefix("Alan",name) @@ -2700,7 +3110,7 @@ { if ( fConn == FALSE ) { - free_string( d->character->pcdata->pwd ); + free_string( d->character->pcdata->pwd, "comm.c/check_reconnect" ); d->character->pcdata->pwd = str_dup( ch->pcdata->pwd ); } else @@ -2858,7 +3268,7 @@ void page_to_char_bw( const char *txt, CHAR_DATA *ch ) { if ( txt == NULL || ch->desc == NULL) - + return; if (ch->lines == 0 ) { @@ -2905,7 +3315,7 @@ *++point2 = '\0'; } *point2 = '\0'; - free_string( ch->desc->showstr_head ); + free_string( ch->desc->showstr_head, "comm.c/page_to_char #1" ); ch->desc->showstr_head = str_dup( buf ); ch->desc->showstr_point = ch->desc->showstr_head; show_string( ch->desc, "" ); @@ -2926,7 +3336,7 @@ *++point2 = '\0'; } *point2 = '\0'; - free_string( ch->desc->showstr_head ); + free_string( ch->desc->showstr_head, "comm.c/page_to_char #2" ); ch->desc->showstr_head = str_dup( buf ); ch->desc->showstr_point = ch->desc->showstr_head; show_string( ch->desc, "" ); @@ -2949,7 +3359,7 @@ { if (d->showstr_head) { - free_string(d->showstr_head); + free_string(d->showstr_head, "comm.c/show_string #1"); d->showstr_head = 0; } d->showstr_point = 0; @@ -2977,7 +3387,7 @@ { if (d->showstr_head) { - free_string(d->showstr_head); + free_string(d->showstr_head, "comm.c/show_string #2"); d->showstr_head = 0; } d->showstr_point = 0; @@ -3145,6 +3555,14 @@ : "something"; break; + case 'v': + i = obj1->short_descr; + break; + + case 'V': + i = obj2->short_descr; + break; + case 'd': if ( !arg2 || ((char *) arg2)[0] == '\0' ) { @@ -3166,6 +3584,13 @@ { i = "Thoth"; } + if (!IS_NPC(ch)) + { + if (ch->pcdata->deity) + { + i = ch->pcdata->deity->name; + } + } break; } --- const.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/const.c Fri Aug 6 23:06:04 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -59,6 +57,23 @@ 1, 2, 2, 3, 4, 6, 4, 1, 6, 10, 6 }; +/* + * Bank table, be sure to keep MAX_BANKS in merc.h up to date + */ +const struct bank_type bank_table [MAX_BANKS] = +{ + { "First National Bank of Midgaard", + 3334, 8, 20 }, + { "Southern Thera Savings and Loan", + 13004, 8, 16 }, + { "Ofcol City Depository", + 5554, 9, 20 }, + { "New Thalos Savings and Trust", + 9779, 7, 19 }, + { "First National Bank of Thera", + 22044, 5, 21 } +}; + /* item type list */ const struct item_type item_table [] = { @@ -94,6 +109,7 @@ { ITEM_DEMON_STONE,"demon_stone" }, { ITEM_EXIT, "exit" }, { ITEM_PIT, "pit" }, + { ITEM_PASSBOOK, "passbook" }, { 0, NULL } }; @@ -140,6 +156,16 @@ { NULL, 0, 0 } }; +/* levnet table and prototype for future flag setting */ +const struct wiznet_type levnet_table [] = +{ + { "on", WIZ_ON, 0 }, + { "prefix", WIZ_PREFIX, 0 }, + { "newbies", WIZ_NEWBIE, 0 }, + { "levels", WIZ_LEVELS, 0 }, + { NULL, 0, 0 } +}; + /* attack table -- not very organized :( * Be sure to keep MAX_DAMAGE_MESSAGE up * to date in merc.h @@ -190,6 +216,126 @@ { NULL, NULL, 0 } }; +/* mobile hp,damage,ac table, for level-changing mobs */ +const struct moblev_type moblev_table [MAX_LEVEL+1] = +{ +/* + { hpdice, hpsides, hpbonus, damdice, damsides, dambonus, mobac }, +*/ + + { 1, 3, 5, 1, 2, 2, 10 }, + { 1, 5, 8, 1, 2, 2, 10 }, + { 2, 2, 12, 1, 3, 2, 9 }, + { 2, 4, 16, 1, 3, 2, 9 }, + { 2, 6, 21, 1, 3, 3, 8 }, + { 3, 5, 26, 1, 5, 3, 8 }, + { 4, 5, 35, 1, 5, 4, 7 }, + { 5, 5, 43, 2, 2, 4, 7 }, + { 5, 6, 51, 2, 3, 5, 6 }, + { 2, 21, 59, 2, 3, 6, 6 }, + { 5, 8, 67, 2, 4, 6, 5 }, + { 4, 12, 75, 2, 4, 7, 5 }, + { 7, 7, 82, 2, 5, 8, 4 }, + { 6, 9, 91, 2, 6, 8, 4 }, + { 6, 10, 99, 2, 6, 9, 3 }, + { 6, 11, 107, 3, 4, 9, 3 }, + { 7, 10, 116, 3, 5, 10, 2 }, + { 7, 11, 125, 3, 5, 11, 2 }, + { 8, 10, 135, 2, 9, 11, 1 }, + { 6, 15, 146, 2, 9, 12, 1 }, + { 9, 10, 157, 4, 4, 13, 0 }, + { 9, 11, 168, 3, 7, 13, 0 }, + { 3, 39, 181, 3, 7, 14, -1 }, + { 10, 11, 194, 4, 5, 14, -1 }, + { 6, 21, 208, 3, 8, 15, -2 }, + { 7, 19, 223, 3, 8, 16, -2 }, + { 6, 24, 238, 4, 6, 16, -3 }, + { 11, 13, 254, 4, 6, 17, -3 }, + { 7, 23, 271, 5, 5, 18, -4 }, + { 7, 24, 289, 4, 7, 18, -4 }, + { 12, 14, 307, 4, 7, 19, -5 }, + { 7, 27, 327, 3, 11, 19, -5 }, + { 4, 51, 347, 5, 6, 20, -6 }, + { 14, 14, 367, 5, 6, 21, -6 }, + { 13, 16, 389, 3, 12, 21, -7 }, + { 7, 33, 411, 3, 12, 22, -7 }, + { 8, 30, 434, 5, 7, 23, -8 }, + { 14, 17, 458, 2, 21, 23, -8 }, + { 9, 29, 482, 2, 21, 24, -9 }, + { 16, 16, 508, 4, 10, 24, -9 }, + { 15, 18, 534, 5, 8, 25, -10 }, + { 13, 22, 561, 5, 8, 26, -10 }, + { 7, 44, 589, 4, 11, 26, -11 }, + { 14, 21, 623, 4, 11, 27, -11 }, + { 17, 17, 658, 5, 9, 28, -12 }, + { 5, 65, 687, 4, 12, 28, -12 }, + { 10, 35, 705, 4, 12, 29, -13 }, + { 10, 36, 737, 2, 27, 29, -13 }, + { 14, 26, 769, 5, 10, 30, -14 }, + { 15, 25, 802, 6, 8, 31, -14 }, + { 16, 24, 835, 7, 7, 31, -15 }, + { 13, 31, 869, 7, 7, 32, -15 }, + { 11, 38, 904, 5, 11, 33, -16 }, + { 20, 20, 946, 6, 9, 33, -16 }, + { 16, 27, 977, 6, 9, 34, -17 }, + { 17, 26, 1015, 4, 15, 34, -17 }, + { 8, 59, 1054, 7, 8, 35, -18 }, + { 6, 81, 1095, 7, 8, 36, -18 }, + { 17, 28, 1136, 6, 10, 36, -19 }, + { 18, 27, 1178, 6, 10, 37, -19 }, + { 8, 65, 1221, 5, 13, 38, -20 }, + { 9, 59, 1266, 7, 9, 38, -20 }, + { 20, 26, 1313, 7, 9, 39, -21 }, + { 13, 42, 1361, 6, 11, 39, -21 }, + { 22, 24, 1418, 8, 8, 40, -22 }, + { 23, 24, 1463, 8, 8, 41, -22 }, + { 18, 32, 1516, 2, 39, 41, -23 }, + { 24, 24, 1572, 2, 39, 42, -23 }, + { 11, 56, 1629, 6, 12, 43, -24 }, + { 22, 27, 1696, 3, 27, 43, -24 }, + { 23, 27, 1752, 3, 27, 44, -25 }, + { 20, 32, 1817, 4, 20, 44, -25 }, + { 24, 27, 1884, 5, 16, 45, -26 }, + { 10, 69, 1956, 6, 13, 46, -26 }, + { 22, 31, 2029, 4, 21, 46, -27 }, + { 14, 51, 2107, 4, 21, 47, -27 }, + { 23, 31, 2188, 5, 17, 48, -28 }, + { 21, 35, 2272, 6, 14, 48, -28 }, + { 15, 51, 2361, 8, 10, 49, -29 }, + { 14, 56, 2454, 9, 9, 49, -29 }, + { 10, 81, 2552, 5, 18, 50, -30 }, + { 16, 51, 2654, 5, 18, 51, -30 }, + { 28, 29, 2762, 6, 15, 51, -31 }, + { 24, 35, 2874, 6, 15, 52, -31 }, + { 26, 33, 2992, 7, 13, 53, -32 }, + { 19, 47, 3117, 2, 51, 53, -32 }, + { 28, 32, 3247, 2, 51, 54, -33 }, + { 25, 37, 3384, 4, 25, 54, -33 }, + { 27, 35, 3527, 5, 20, 55, -34 }, + { 14, 71, 3678, 5, 20, 56, -34 }, + { 31, 31, 3848, 7, 14, 56, -35 }, + { 17, 61, 4003, 8, 12, 57, -35 }, + { 21, 49, 4190, 6, 17, 58, -36 }, + { 32, 33, 4361, 9, 11, 58, -36 }, + { 14, 80, 4553, 9, 11, 59, -37 }, + { 28, 39, 4767, 7, 15, 59, -37 }, + { 25, 45, 4979, 8, 13, 60, -38 }, + { 15, 80, 5187, 10, 10, 61, -38 }, + { 30, 39, 5433, 3, 39, 61, -39 }, + { 33, 37, 5662, 3, 39, 62, -39 }, + { 18, 71, 5917, 5, 23, 63, -40 }, + { 22, 59, 6184, 7, 16, 63, -40 }, + { 28, 47, 6463, 9, 12, 64, -41 }, + { 35, 38, 6755, 8, 14, 64, -41 }, + { 27, 51, 7060, 10, 11, 65, -42 }, + { 27, 52, 7380, 10, 11, 66, -42 }, + { 31, 46, 7713, 7, 17, 66, -43 }, + { 37, 39, 8061, 7, 17, 67, -43 }, + { 15, 101, 8425, 9, 13, 68, -44 }, + { 13, 119, 8804, 8, 15, 68, -44 }, + { 39, 39, 9201, 8, 15, 69, -45 } +}; + /* race table */ const struct race_type race_table [] = { @@ -726,6 +872,8 @@ { 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100 }, { "" }, + { "" }, + FALSE, { 13, 13, 13, 13, 13 }, { 18, 18, 18, 18, 18 }, 0 @@ -737,6 +885,8 @@ points, { class multipliers }, { bonus skills }, + { home towns }, + home towns active, { base stats }, { max stats }, size @@ -748,6 +898,8 @@ { 100, 100, 100, 100, 100, 100, 100, 90, 90, 90, 90, 90, 90, 90 }, { "" }, + { "midgaard", "newthalos" }, + FALSE, { 13, 13, 13, 13, 13 }, { 18, 18, 18, 18, 18 }, SIZE_MEDIUM @@ -759,6 +911,8 @@ { 100, 125, 100, 120, 120, 105, 115, 90, 113, 90, 108, 95, 95, 104 }, { "sneak", "hide" }, + { "" }, + FALSE, { 12, 14, 13, 15, 11 }, { 16, 20, 18, 21, 15 }, SIZE_SMALL @@ -770,6 +924,8 @@ { 150, 100, 125, 100, 110, 110, 110, 135, 90, 113, 90, 113, 99, 99 }, { "berserk" }, + { "" }, + FALSE, { 14, 12, 13, 11, 15 }, { 20, 16, 19, 15, 21 }, SIZE_MEDIUM @@ -781,6 +937,8 @@ { 200, 125, 150, 105, 125, 150, 120, 180, 113, 135, 95, 135, 135, 108 }, { "bash", "fast healing" }, + { "" }, + FALSE, { 16, 11, 13, 11, 14 }, { 22, 15, 18, 15, 20 }, SIZE_LARGE @@ -792,50 +950,60 @@ { 100, 100, 120, 200, 150, 100, 150, 90, 90, 108, 180, 95, 90, 135 }, { "" }, + { "" }, + FALSE, { 10, 15, 15, 15, 10 }, { 14, 21, 21, 20, 14 }, SIZE_TINY }, { - "halfling", "Hfling", + "halfling", "Hflng", 5, { 105, 120, 100, 150, 150, 120, 120, 95, 108, 90, 135, 108, 108, 108 }, { "sneak", "hide" }, + { "" }, + FALSE, { 11, 14, 12, 15, 13 }, { 15, 20, 16, 21, 18 }, SIZE_SMALL }, { - "halforc", "Hf-Orc", + "halforc", "HfOrc", 6, { 200, 200, 120, 100, 125, 150, 105, 180, 180, 108, 90, 135, 135, 95 }, { "fast healing" }, + { "" }, + FALSE, { 14, 11, 11, 14, 15 }, { 19, 15, 15, 20, 21 }, SIZE_MEDIUM }, { - "goblin", "Goblin", + "goblin", "Gobln", 5, { 105, 125, 110, 125, 120, 120, 110, 95, 113, 99, 113, 99, 108, 99 }, { "sneak", "hide" }, + { "" }, + FALSE, { 11, 14, 12, 15, 14 }, { 16, 20, 16, 19, 20 }, SIZE_SMALL }, { - "halfelf", "Hf-Elf", + "halfelf", "HfElf", 2, { 105, 105, 105, 105, 105, 105, 105, 95, 95, 95, 95, 95, 95, 95 }, { "" }, + { "" }, + FALSE, { 12, 13, 14, 13, 13 }, { 17, 18, 19, 18, 18 }, SIZE_MEDIUM @@ -847,6 +1015,8 @@ { 110, 105, 150, 125, 120, 100, 120, 99, 95, 135, 113, 108, 90, 108 }, { "" }, + { "" }, + FALSE, { 12, 14, 15, 11, 12 }, { 17, 19, 20, 16, 17 }, SIZE_LARGE @@ -858,17 +1028,21 @@ { 100, 110, 150, 150, 125, 105, 150, 90, 99, 135, 135, 99, 95, 135 }, { "" }, + { "" }, + FALSE, { 11, 15, 14, 12, 12 }, { 16, 20, 19, 15, 15 }, SIZE_SMALL }, { - "draconian", "Dracon", + "draconian", "Draco", 11, { 125, 150, 200, 100, 110, 125, 150, 113, 135, 180, 90, 108, 113, 135 }, { "fast healing" }, + { "" }, + FALSE, { 16, 13, 12, 11, 15 }, { 22, 18, 16, 15, 21 }, SIZE_HUGE @@ -880,6 +1054,8 @@ { 100, 110, 100, 175, 110, 110, 95, 90, 100, 90, 165, 100, 100, 85 }, { "enhanced damage" }, + { "" }, + FALSE, { 15, 12, 10, 8, 16 }, { 20, 17, 15, 13, 21 }, SIZE_LARGE @@ -891,17 +1067,21 @@ { 110, 110, 125, 110, 175, 110, 110, 100, 100, 115, 100, 165, 100, 100 }, { "" }, + { "" }, + FALSE, { 15, 11, 10, 16, 15 }, { 20, 16, 15, 20, 19 }, SIZE_LARGE }, { - "heucuva", "Heucuv", + "heucuva", "Heucu", 10, { 110, 110, 110, 100, 110, 110, 100, 100, 100, 100, 90, 100, 100, 90 }, { "second attack" }, + { "" }, + FALSE, { 20, 5, 5, 20, 20 }, { 25, 10, 10, 25, 25 }, SIZE_MEDIUM @@ -913,17 +1093,21 @@ { 125, 110, 150, 150, 110, 125, 180, 115, 100, 140, 140, 100, 115, 170 }, { "meditation" }, + { "" }, + FALSE, { 14, 14, 16, 15, 14 }, { 19, 19, 21, 20, 19 }, SIZE_MEDIUM }, { - "minotaur", "Minotr", + "minotaur", "Minot", 7, { 110, 110, 110, 95, 110, 110, 110, 100, 100, 100, 85, 100, 100, 100 }, { "enhanced damage" }, + { "" }, + FALSE, { 18, 11, 10, 11, 17 }, { 23, 16, 15, 16, 22 }, SIZE_LARGE @@ -935,6 +1119,8 @@ { 110, 110, 110, 175, 110, 110, 150, 100, 100, 100, 165, 100, 100, 140 }, { "" }, + { "" }, + FALSE, { 18, 14, 5, 9, 16 }, { 23, 19, 10, 14, 21 }, SIZE_LARGE @@ -946,6 +1132,8 @@ { 180, 105, 130, 105, 105, 130, 100, 170, 93, 115, 95, 95, 115, 98 }, { "fast healing" }, + { "" }, + FALSE, { 20, 13, 13, 10, 20 }, { 25, 18, 18, 15, 25 }, SIZE_GIANT @@ -963,93 +1151,93 @@ /* { - name, who, attr_prime, weapon, - {guild1, guild2, guild3}, thac0_00, thac0_32, hp_min, hp_max, mana?, + name, who, swho, attr_prime, weapon, + thac0_00, thac0_32, hp_min, hp_max, mana?, base_group, default_group } */ { - "mage", "Mag", STAT_INT, OBJ_VNUM_SCHOOL_DAGGER, - { 3018, 9618, 18113 }, 75, 20, 6, 6, 8, TRUE, + "mage", "Mage ", "Ma", STAT_INT, OBJ_VNUM_SCHOOL_DAGGER, + 75, 20, 6, 6, 8, TRUE, "mage basics", "mage default" }, { - "cleric", "Cle", STAT_WIS, OBJ_VNUM_SCHOOL_MACE, - { 3003, 9619, 5699 }, 75, 20, 2, 7, 10, TRUE, + "cleric", "Clerc", "Cl", STAT_WIS, OBJ_VNUM_SCHOOL_MACE, + 75, 20, 2, 7, 10, TRUE, "cleric basics", "cleric default" }, { - "thief", "Thi", STAT_DEX, OBJ_VNUM_SCHOOL_DAGGER, - { 3028, 9639, 5633 }, 75, 20, -4, 8, 13, FALSE, + "thief", "Thief", "Th", STAT_DEX, OBJ_VNUM_SCHOOL_DAGGER, + 75, 20, -4, 8, 13, FALSE, "thief basics", "thief default" }, { - "warrior", "War", STAT_STR, OBJ_VNUM_SCHOOL_SWORD, - { 3022, 9633, 5613 }, 75, 20, -10, 13, 18, FALSE, + "warrior", "Warr ", "Wa", STAT_STR, OBJ_VNUM_SCHOOL_SWORD, + 75, 20, -10, 13, 18, FALSE, "warrior basics", "warrior default" }, { - "ranger", "Ran", STAT_STR, OBJ_VNUM_SCHOOL_SPEAR, - { 3372, 9752, 18111 }, 75, 20, -4, 9, 13, TRUE, + "ranger", "Range", "Ra", STAT_STR, OBJ_VNUM_SCHOOL_SPEAR, + 75, 20, -4, 9, 13, TRUE, "ranger basics", "ranger default" }, { - "druid", "Dru", STAT_WIS, OBJ_VNUM_SCHOOL_POLEARM, - { 3369, 9755, 18111 }, 75, 20, 0, 7, 10, TRUE, + "druid", "Druid", "Dr", STAT_WIS, OBJ_VNUM_SCHOOL_POLEARM, + 75, 20, 0, 7, 10, TRUE, "druid basics", "druid default" }, { - "vampire", "Vam", STAT_CON, OBJ_VNUM_SCHOOL_DAGGER, - { 3375, 9758, 18113 }, 75, 20, -30, 6, 8, TRUE, + "vampire", "Vampr", "Va", STAT_CON, OBJ_VNUM_SCHOOL_DAGGER, + 75, 20, -30, 6, 8, TRUE, "vampire basics", "vampire default" }, { - "wizard", "Wiz", STAT_INT, OBJ_VNUM_SCHOOL_DAGGER, - { 3018, 9618, 18113 }, 75, 10, -4, 6, 18, TRUE, + "wizard", "Wizrd", "Wi", STAT_INT, OBJ_VNUM_SCHOOL_DAGGER, + 75, 10, -4, 6, 18, TRUE, "wizard basics", "wizard default" }, { - "priest", "Prs", STAT_WIS, OBJ_VNUM_SCHOOL_MACE, - { 3003, 9619, 5699 }, 75, 10, 2, -3, 20, TRUE, + "priest", "Prst ", "Pr", STAT_WIS, OBJ_VNUM_SCHOOL_MACE, + 75, 10, 2, -3, 20, TRUE, "priest basics", "priest default" }, { - "mercenary", "Mer", STAT_DEX, OBJ_VNUM_SCHOOL_DAGGER, - { 3028, 9639, 5633 }, 75, 10, -14, 8, 23, FALSE, + "mercenary", "Mercn", "Me", STAT_DEX, OBJ_VNUM_SCHOOL_DAGGER, + 75, 10, -14, 8, 23, FALSE, "mercenary basics", "mercenary default" }, { - "gladiator", "Gla", STAT_STR, OBJ_VNUM_SCHOOL_SWORD, - { 3022, 9633, 5613 }, 75, 10, -20, 14, 25, FALSE, + "gladiator", "Gladr", "Gl", STAT_STR, OBJ_VNUM_SCHOOL_SWORD, + 75, 10, -20, 14, 25, FALSE, "gladiator basics", "gladiator default" }, { - "strider", "Str", STAT_INT, OBJ_VNUM_SCHOOL_DAGGER, - { 3372, 9752, 18111 }, 75, 10, -14, 10, 25, TRUE, + "strider", "Strid", "St", STAT_INT, OBJ_VNUM_SCHOOL_DAGGER, + 75, 10, -14, 10, 25, TRUE, "strider basics", "strider default" }, { - "sage", "Sag", STAT_WIS, OBJ_VNUM_SCHOOL_POLEARM, - { 3369, 9755, 18111 }, 75, 10, -10, 7, 20, TRUE, + "sage", "Sage ", "Sa", STAT_WIS, OBJ_VNUM_SCHOOL_POLEARM, + 75, 10, -10, 7, 20, TRUE, "sage basics", "sage default" }, { - "lich", "Lic", STAT_CON, OBJ_VNUM_SCHOOL_DAGGER, - { 3375, 9758, 18113 }, 75, 10, -40, 6, 18, TRUE, + "lich", "Lich ", "Li", STAT_CON, OBJ_VNUM_SCHOOL_DAGGER, + 75, 10, -40, 6, 18, TRUE, "lich basics", "lich default" } }; @@ -3166,7 +3354,7 @@ { "conjure", { 85, 102, 102, 102, 102, 95, 102, - 59, 102, 102, 102, 102, 71, 102 }, + 59, 102, 102, 102, 102, 71, 65 }, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, spell_conjure, TAR_IGNORE, POS_STANDING, @@ -4101,8 +4289,8 @@ { "word of recall", - { 63, 56, 103, 103, 47, 103, 73, - 53, 46, 103, 103, 37, 103, 63 }, + { 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 103 }, { 1, 1, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 1, 1 }, spell_word_of_recall, TAR_CHAR_SELF, POS_RESTING, @@ -4178,7 +4366,7 @@ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, spell_general_purpose, TAR_CHAR_OFFENSIVE, POS_FIGHTING, - NULL, TRUE, SLOT(401), 0, 12, + NULL, TRUE, SLOT(401), 100, 12, "general purpose ammo", "!General Purpose Ammo!", "" }, @@ -4188,9 +4376,23 @@ 104, 104, 104, 104, 104, 104, 104 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - spell_high_explosive, TAR_CHAR_OFFENSIVE, POS_FIGHTING, - NULL, TRUE, SLOT(402), 0, 12, - "high explosive ammo", "!High Explosive Ammo!", "" + spell_high_explosive, TAR_CHAR_OFFENSIVE, POS_FIGHTING, + NULL, TRUE, SLOT(402), 100, 12, + "high explosive ammo", "!High Explosive Ammo!", "" + }, + +/* + * Spells for Hero quest rewards. + */ + { + "shadow", + { 101, 101, 101, 101, 101, 101, 101, + 101, 101, 101, 101, 101, 101, 101 }, + { 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1 }, + spell_shadow, TAR_IGNORE, POS_STANDING, + NULL, TRUE, SLOT(453), 100, 12, + "shadow", "!Shadow!", "" }, @@ -4703,6 +4905,19 @@ spell_null, TAR_IGNORE, POS_STANDING, &gsn_recall, TRUE, SLOT( 0), 0, 12, "", "!Recall!", "" + }, +/* + * Skills for Hero quest rewards +*/ + { + "inscribe", + { 101, 101, 101, 101, 101, 101, 101, + 101, 101, 101, 101, 101, 101, 101 }, + { 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1 }, + spell_null, TAR_IGNORE, POS_STANDING, + &gsn_inscribe, TRUE, SLOT( 0), 0, 12, + "", "!Inscribe!", "" } }; @@ -5135,7 +5350,7 @@ { "creation", { 4, 4, -1, -1, 7, 4, -1, - 3, 3, -1, -1, 6, 3, -1 }, + 3, 3, -1, -1, 6, 3, 1 }, { "continual light", "create food", "create spring", "create water", "create rose", "conjure", "empower", "floating disc" } }, @@ -5229,7 +5444,7 @@ { 4, 4, -1, -1, 5, 7, 4, 3, 3, -1, -1, 4, 6, 3 }, { "fly", "gate", "nexus", "pass door", "portal", "summon", "teleport", - "transport", "word of recall" } + "transport" } }, { --- curse.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/curse.c Fri Aug 6 23:06:04 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -109,11 +107,11 @@ return; } - if (cost > (ch->gold * 100 + ch->silver)) + if (cost > ((ch->platinum * 10000) + (ch->gold * 100) + ch->silver)) { - act("$N says '{aYou do not have enough gold for my services.{x'", - ch,NULL,mob,TO_CHAR); - return; + act("$N says '{aYou do not have enough money for my services.{x'", + ch,NULL,mob,TO_CHAR); + return; } if (spell != NULL && ch->alignment >= 0) --- db2.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/db2.c Fri Aug 6 23:06:04 1999 @@ -1,37 +1,34 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ - #include #include #include @@ -338,15 +335,24 @@ exit(1); } } - else if (letter == 'D') + else if (letter == 'D') /* Death Message */ { pMobIndex->die_descr = fread_string( fp ); } - else if (letter == 'T') + else if (letter == 'T') /* Talk Message */ { pMobIndex->say_descr = fread_string( fp ); pMobIndex->say_descr[0] = UPPER(pMobIndex->say_descr[0]); } + else if (letter == 'C') /* Clan */ + { + if (pMobIndex->clan) + { + bug("Load_mobiles: duplicate clan fields.",0); + exit(1); + } + pMobIndex->clan = clan_lookup(fread_string(fp)); + } else { ungetc(letter,fp); @@ -578,14 +584,19 @@ else if ( letter == 'G') /* guild */ { - if (pObjIndex->class) - { - bug("Load_objects: duplicate class fields.",0); - exit(1); + GUILD_DATA *guild; + + guild = alloc_perm( sizeof(*guild) ); + guild->guild = class_lookup(fread_string(fp)); + if (guild->guild != -1) + { + if (pObjIndex->guild != NULL) + guild->next = pObjIndex->guild; + pObjIndex->guild = guild; + } else { + bug("Load_objects: vnum %d has an unknown guild name.",vnum); } - pObjIndex->class = class_lookup(fread_string(fp)); } - else { ungetc( letter, fp ); @@ -602,3 +613,110 @@ return; } +/* + * Snarf an dreams section. + */ +void load_dreams( FILE *fp ) +{ + DRM_INDEX_DATA *pDrmIndex; + + for ( ; ; ) + { + sh_int vnum, vnum_orig; + char letter; + int iHash; + + letter = fread_letter( fp ); + if ( letter != '#' ) + { + bug( "Load_dreams: # not found.", 0 ); + exit( 1 ); + } + + vnum = fread_number( fp ); + if ( vnum == 0 ) + break; + + vnum_orig = vnum; + vnum = top_drm_index; + + fBootDb = FALSE; + if ( get_drm_index( vnum ) != NULL ) + { + bug( "Load_dreams: vnum %d duplicated.", vnum ); + exit( 1 ); + } + fBootDb = TRUE; + + pDrmIndex = alloc_perm( sizeof(*pDrmIndex) ); + pDrmIndex->vnum = vnum; + pDrmIndex->description = fread_string( fp ); + for ( ; ; ) + { + char letter; + + letter = fread_letter( fp ); + + if ( letter == 'S' ) + break; + + if ( letter == 'A' ) + { + DREAM_ACT_DATA *pat; + + pat = alloc_perm( sizeof(*pat) ); + pat->string = fread_string( fp ); + pat->next = pDrmIndex->act; + pDrmIndex->act = pat; + } + + else if (letter == 'M') + { + if (pDrmIndex->move) + { + bug("Load_dreams: duplicate move fields.",0); + exit(1); + } + pDrmIndex->move = fread_number(fp); + } + + else if ( letter == 'C' ) + { + DREAM_CHANGE_DATA *pch; + + pch = alloc_perm( sizeof(*pch) ); + pch->keyword = str_dup(fread_word(fp)); + pch->value = str_dup(fread_word(fp)); + pch->next = pDrmIndex->change; + pDrmIndex->change = pch; + } + else if ( letter == 'O' ) + { + DREAM_OBJECT_DATA *pob; + + pob = alloc_perm( sizeof(*pob) ); + pob->vnum = fread_number( fp ); + pob->roomchar = str_dup(fread_word(fp)); + pob->variable = fread_number( fp ); + pob->t_min = fread_number( fp ); + pob->t_max = fread_number( fp ); + pob->next = pDrmIndex->object; + pDrmIndex->object = pob; + } + + else + { + bug( "Load_dreams: vnum %d has flag not 'DES'.", vnum_orig ); + exit( 1 ); + } + } + + iHash = vnum % MAX_KEY_HASH; + pDrmIndex->next = drm_index_hash[iHash]; + drm_index_hash[iHash] = pDrmIndex; + top_drm_index++; + } + + return; +} + --- db.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/db.c Sat Aug 14 20:31:11 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #include @@ -57,7 +55,9 @@ #endif #if !defined(OLD_RAND) +#if !defined(linux) long random(); +#endif void srandom(unsigned int); int getpid(); time_t time(time_t *tloc); @@ -99,6 +99,7 @@ TIME_INFO_DATA time_info; WEATHER_DATA weather_info; int chain; +int ladder; sh_int gsn_backstab; sh_int gsn_circle; @@ -164,6 +165,7 @@ sh_int gsn_track; sh_int gsn_gouge; sh_int gsn_grip; +sh_int gsn_inscribe; @@ -173,6 +175,7 @@ MOB_INDEX_DATA * mob_index_hash [MAX_KEY_HASH]; OBJ_INDEX_DATA * obj_index_hash [MAX_KEY_HASH]; ROOM_INDEX_DATA * room_index_hash [MAX_KEY_HASH]; +DRM_INDEX_DATA * drm_index_hash [MAX_KEY_HASH]; char * string_hash [MAX_KEY_HASH]; AREA_DATA * area_first; @@ -189,6 +192,7 @@ int top_help; int top_mob_index; int top_obj_index; +int top_drm_index; int top_reset; int top_room; int top_shop; @@ -203,14 +207,14 @@ * Increase MAX_STRING if you have too. * Tune the others only if you understand what you're doing. */ -#define MAX_STRING 2099200 +#define MAX_STRING 3205120 #define MAX_PERM_BLOCK 131072 -#define MAX_MEM_LIST 11 +#define MAX_MEM_LIST 12 void * rgFreeList [MAX_MEM_LIST]; const int rgSizeList [MAX_MEM_LIST] = { - 16, 32, 64, 128, 256, 1024, 2048, 4096, 8192, 16384, 32768-64 + 16, 32, 64, 128, 256, 1024, 2048, 4096, 8192, 16384, 32768, 65536-64 }; int nAllocString; @@ -244,12 +248,15 @@ void load_shops args( ( FILE *fp ) ); void load_socials args( ( FILE *fp ) ); void load_specials args( ( FILE *fp ) ); +void load_dreams args( ( FILE *fp ) ); void load_notes args( ( void ) ); void load_bans args( ( void ) ); +void load_banklist args( ( void ) ); void load_wizlist args( ( void ) ); void load_clanlist args( ( void ) ); void fix_exits args( ( void ) ); void reset_area args( ( AREA_DATA * pArea ) ); +long fread_exit args( ( FILE *fp) ); /* * Big mama top level function. @@ -402,6 +409,7 @@ else if ( !str_cmp( word, "SHOPS" ) ) load_shops (fpArea); else if ( !str_cmp( word, "SOCIALS" ) ) load_socials (fpArea); else if ( !str_cmp( word, "SPECIALS" ) ) load_specials(fpArea); + else if ( !str_cmp( word, "DREAMS" ) ) load_dreams (fpArea); else { bug( "Boot_db: bad section name.", 0 ); @@ -440,6 +448,8 @@ log_string( "Loading Bans." ); load_bans(); strcat(boot_buf,"t this be a le"); + log_string( "Loading Banklist." ); + load_banklist(); log_string( "Loading Wizlist." ); load_wizlist(); strcat(boot_buf," -"); @@ -448,6 +458,7 @@ strcat(boot_buf,"\n\r"); log_string( "Loading Songs." ); load_songs(); + boot_deities(); } if ( ( pRoomIndex = get_room_index( 315 ) ) == NULL) { @@ -985,6 +996,8 @@ pRoomIndex = alloc_perm( sizeof(*pRoomIndex) ); pRoomIndex->owner = str_dup(""); + pRoomIndex->warn = str_dup(""); + pRoomIndex->heal_neg = FALSE; pRoomIndex->people = NULL; pRoomIndex->contents = NULL; pRoomIndex->extra_descr = NULL; @@ -998,8 +1011,12 @@ if ( 2900 <= vnum && vnum < 3400) SET_BIT(pRoomIndex->room_flags,ROOM_LAW); if ( 20000 <= vnum && vnum < 21000) + { SET_BIT(pRoomIndex->room_flags,ROOM_NOWHERE); + SET_BIT(pRoomIndex->room_flags,ROOM_NO_RECALL); + } pRoomIndex->sector_type = fread_number( fp ); + pRoomIndex->transfer = NULL; pRoomIndex->light = 0; for ( door = 0; door <= 11; door++ ) pRoomIndex->exit[door] = NULL; @@ -1021,8 +1038,11 @@ else if ( letter == 'M') /* mana room */ pRoomIndex->mana_rate = fread_number(fp); - else if ( letter == 'C') /* clan */ - { + else if ( letter == 'W') /* warn */ + pRoomIndex->warn = fread_string(fp); + + else if ( letter == 'C') /* clan */ + { if (pRoomIndex->clan) { bug("Load_rooms: duplicate clan fields.",0); @@ -1030,12 +1050,39 @@ } pRoomIndex->clan = clan_lookup(fread_string(fp)); } - + else if ( letter == 'G') /* guild */ + { + GUILD_DATA *guild; + + guild = alloc_perm( sizeof(*guild) ); + guild->guild = class_lookup(fread_string(fp)); + if (guild->guild != -1) + { + if (pRoomIndex->guild != NULL) + guild->next = pRoomIndex->guild; + pRoomIndex->guild = guild; + } else { + bug("Load_rooms: vnum %d has an unknown guild name.",vnum); + } + } + else if ( letter == 'R') /* race */ + { + RACE_DATA *race; + race = alloc_perm( sizeof(*race) ); + race->race = race_lookup(fread_string(fp)); + if (race->race != 0) + { + if (pRoomIndex->race != NULL) + race->next = pRoomIndex->race; + pRoomIndex->race = race; + } else { + bug("Load_rooms: vnum %d has an unknown race name.",vnum); + } + } else if ( letter == 'D' ) { EXIT_DATA *pexit; - int locks; door = fread_number( fp ); if ( door < 0 || door > 11 ) @@ -1047,24 +1094,58 @@ pexit = alloc_perm( sizeof(*pexit) ); pexit->description = fread_string( fp ); pexit->keyword = fread_string( fp ); - pexit->exit_info = 0; - locks = fread_number( fp ); + pexit->exit_info = fread_exit( fp ); pexit->key = fread_number( fp ); pexit->u1.vnum = fread_number( fp ); - switch ( locks ) + if (IS_SET(pexit->exit_info, EX_CLOSED)) + REMOVE_BIT(pexit->exit_info, EX_CLOSED); + if (IS_SET(pexit->exit_info, EX_LOCKED)) + REMOVE_BIT(pexit->exit_info, EX_LOCKED); + if (!IS_SET(pexit->exit_info, EX_ISDOOR)) { - case 1: pexit->exit_info = EX_ISDOOR; break; - case 2: pexit->exit_info = EX_ISDOOR | EX_PICKPROOF; break; - case 3: pexit->exit_info = EX_ISDOOR | EX_NOPASS; break; - case 4: pexit->exit_info = EX_ISDOOR|EX_NOPASS|EX_PICKPROOF; - break; + if (IS_SET(pexit->exit_info, EX_PICKPROOF) + || IS_SET(pexit->exit_info, EX_NOPASS) + || IS_SET(pexit->exit_info, EX_EASY) + || IS_SET(pexit->exit_info, EX_HARD) + || IS_SET(pexit->exit_info, EX_INFURIATING) + || IS_SET(pexit->exit_info, EX_NOCLOSE) + || IS_SET(pexit->exit_info, EX_NOLOCK)) + { + SET_BIT(pexit->exit_info, EX_ISDOOR); + } } pRoomIndex->exit[door] = pexit; pRoomIndex->old_exit[door] = pexit; top_exit++; } + else if ( letter == 'F') /* fall redirect */ + { + EXIT_DATA *pexit; + + pexit = alloc_perm( sizeof(*pexit) ); + pexit->description = str_dup("");; + pexit->keyword = str_dup("");; + pexit->exit_info = 0; + pexit->key = -1; + pexit->u1.vnum = fread_number( fp ); + SET_BIT(pexit->exit_info, EX_ISDOOR); + pRoomIndex->fall = pexit; + } + else if ( letter == 'T') /* transfer redirect */ + { + EXIT_DATA *pexit; + + pexit = alloc_perm( sizeof(*pexit) ); + pexit->description = str_dup("");; + pexit->keyword = str_dup("");; + pexit->exit_info = 0; + pexit->key = -1; + pexit->u1.vnum = fread_number( fp ); + SET_BIT(pexit->exit_info, EX_ISDOOR); + pRoomIndex->transfer = pexit; + } else if ( letter == 'E' ) { EXTRA_DESCR_DATA *ed; @@ -1076,7 +1157,6 @@ pRoomIndex->extra_descr = ed; top_ed++; } - else if (letter == 'O') { if (pRoomIndex->owner[0] != '\0') @@ -1087,14 +1167,23 @@ pRoomIndex->owner = fread_string(fp); } - else { - bug( "Load_rooms: vnum %d has flag not 'DES'.", vnum ); + bug( "Load_rooms: vnum %d has flag not 'CDEGHMORST'.", vnum ); exit( 1 ); } } - + if (pRoomIndex->heal_rate < 0) + REMOVE_BIT(pRoomIndex->room_flags, ROOM_NO_RECALL); + if (pRoomIndex->heal_rate < 0) + { + pRoomIndex->heal_rate = -(pRoomIndex->heal_rate); + pRoomIndex->heal_neg = TRUE; + } + if (pRoomIndex->mana_rate < 0) + { + pRoomIndex->mana_rate = -(pRoomIndex->mana_rate); + } iHash = vnum % MAX_KEY_HASH; pRoomIndex->next = room_index_hash[iHash]; room_index_hash[iHash] = pRoomIndex; @@ -1187,16 +1276,11 @@ /* * Translate all room exits from virtual to real. * Has to be done after all rooms are read in. - * Check for bad reverse exits. */ void fix_exits( void ) { -/* extern const sh_int rev_dir []; - char buf[MAX_STRING_LENGTH]; */ ROOM_INDEX_DATA *pRoomIndex; -/* ROOM_INDEX_DATA *to_room; */ EXIT_DATA *pexit; -/* EXIT_DATA *pexit_rev; */ int iHash; int door; @@ -1224,40 +1308,31 @@ } } } - if (!fexit) - SET_BIT(pRoomIndex->room_flags,ROOM_NO_MOB); - } - } - strcat(boot_buf,"ky' of thi"); -/* - for ( iHash = 0; iHash < MAX_KEY_HASH; iHash++ ) - { - for ( pRoomIndex = room_index_hash[iHash]; - pRoomIndex != NULL; - pRoomIndex = pRoomIndex->next ) - { - for ( door = 0; door <= 5; door++ ) + if ( ( pexit = pRoomIndex->fall ) != NULL ) { - if ( ( pexit = pRoomIndex->exit[door] ) != NULL - && ( to_room = pexit->u1.to_room ) != NULL - && ( pexit_rev = to_room->exit[rev_dir[door]] ) != NULL - && pexit_rev->u1.to_room != pRoomIndex - && (pRoomIndex->vnum < 1200 || pRoomIndex->vnum > 1299) - && (pRoomIndex->vnum != 10525) - && (pRoomIndex->vnum != 8705) - && (pRoomIndex->vnum != 8717)) - { - sprintf( buf, "Fix_exits: %d:%d -> %d:%d -> %d.", - pRoomIndex->vnum, door, - to_room->vnum, rev_dir[door], - (pexit_rev->u1.to_room == NULL) - ? 0 : pexit_rev->u1.to_room->vnum ); - bug( buf, 0 ); + if ( pexit->u1.vnum <= 0 + || get_room_index(pexit->u1.vnum) == NULL) + pexit->u1.to_room = NULL; + else + { + pexit->u1.to_room = get_room_index( pexit->u1.vnum ); } } + if ( ( pexit = pRoomIndex->transfer ) != NULL ) + { + if ( pexit->u1.vnum <= 0 + || get_room_index(pexit->u1.vnum) == NULL) + pexit->u1.to_room = NULL; + else + { + pexit->u1.to_room = get_room_index( pexit->u1.vnum ); + } + } + if (!fexit && (pRoomIndex->transfer == NULL)) + SET_BIT(pRoomIndex->room_flags,ROOM_NO_MOB); } } -*/ + strcat(boot_buf,"ky' of thi"); strcat(boot_buf,"s world.\n\r Havi"); return; } @@ -2007,7 +2082,7 @@ obj->value[4] = pObjIndex->value[4]; obj->weight = pObjIndex->weight; obj->clan = pObjIndex->clan; - obj->class = pObjIndex->class; + obj->got_from = 0; if (level == -1 || pObjIndex->new_format) obj->cost = pObjIndex->cost; @@ -2033,6 +2108,7 @@ case ITEM_TRASH: case ITEM_CONTAINER: case ITEM_PIT: + case ITEM_PASSBOOK: case ITEM_DRINK_CON: case ITEM_KEY: case ITEM_FOOD: @@ -2245,7 +2321,7 @@ /* - * Translates mob virtual number to its obj index struct. + * Translates obj virtual number to its obj index struct. * Hash table lookup. */ OBJ_INDEX_DATA *get_obj_index( int vnum ) @@ -2269,10 +2345,33 @@ return NULL; } - +/* + * Translates dream virtual number to its dream index struct. + * Hash table lookup. + */ +DRM_INDEX_DATA *get_drm_index( int vnum ) +{ + DRM_INDEX_DATA *pDrmIndex; + + for ( pDrmIndex = drm_index_hash[vnum % MAX_KEY_HASH]; + pDrmIndex != NULL; + pDrmIndex = pDrmIndex->next ) + { + if ( pDrmIndex->vnum == vnum ) + return pDrmIndex; + } + + if ( fBootDb ) + { + bug( "Get_drm_index: bad vnum %d.", vnum ); + exit( 1 ); + } + + return NULL; +} /* - * Translates mob virtual number to its room index struct. + * Translates room virtual number to its room index struct. * Hash table lookup. */ ROOM_INDEX_DATA *get_room_index( int vnum ) @@ -2414,6 +2513,75 @@ return number; } +long fread_exit( FILE *fp) +{ + int number; + char c; + bool negative = FALSE; + bool isnumber = FALSE; + + do + { + c = getc(fp); + } + while ( isspace(c)); + + if (c == '-') + { + negative = TRUE; + c = getc(fp); + } + + number = 0; + + if (!isdigit(c)) + { + while (('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z')) + { + number += flag_convert(c); + c = getc(fp); + } + } + + while (isdigit(c)) + { + number = number * 10 + c - '0'; + isnumber = TRUE; + c = getc(fp); + } + + if (c == '|') + number += fread_flag(fp); + + else if ( c != ' ') + ungetc(c,fp); + + if (isnumber && (number != 0)) + { + long exnum = 0; + switch ( number ) + { + default: exnum = 0; break; + case 1: exnum = EX_ISDOOR; break; + case 2: exnum = EX_ISDOOR | EX_PICKPROOF; break; + case 3: exnum = EX_ISDOOR | EX_NOPASS; break; + case 4: exnum = EX_ISDOOR|EX_NOPASS|EX_PICKPROOF; + break; + } + bug( "Fread_exit: Ex_flags in old format: %d", number ); + number = exnum; + } + + if (negative) + return -1 * number; + + return number; +} + + + + + long flag_convert(char letter ) { long bitsum = 0; @@ -2764,7 +2932,7 @@ * Free some memory. * Recycle it back onto the free list for blocks of that size. */ -void free_mem( void *pMem, int sMem ) +void free_mem( void *pMem, int sMem, char *instring ) { int iList; int *magic; @@ -2775,6 +2943,7 @@ if (*magic != MAGIC_NUM) { bug("Attempt to recyle invalid memory of size %d.",sMem); +printf("Initiated by routine: %s\n",instring); bug((char*) pMem + sizeof(*magic),0); return; } @@ -2865,14 +3034,16 @@ * Null is legal here to simplify callers. * Read-only shared strings are not touched. */ -void free_string( char *pstr ) +void free_string( char *pstr, char *instring) { + char buf[MAX_STRING_LENGTH]; if ( pstr == NULL || pstr == &str_empty[0] || ( pstr >= string_space && pstr < top_string ) ) return; - free_mem( pstr, strlen(pstr) + 1 ); + sprintf(buf, "%s -> db.c/free_string", instring); + free_mem( pstr, strlen(pstr) + 1, buf); return; } @@ -2881,6 +3052,10 @@ void do_areas( CHAR_DATA *ch, char *argument ) { char buf[MAX_STRING_LENGTH]; + char bufa[MAX_STRING_LENGTH]; + char bufb[MAX_STRING_LENGTH]; + char bufc[MAX_STRING_LENGTH]; + char bufd[MAX_STRING_LENGTH]; BUFFER *output; AREA_DATA *pArea1; AREA_DATA *pArea2; @@ -2903,16 +3078,42 @@ for ( iArea = 0; iArea < iAreaHalf; iArea++ ) { - sprintf( buf, "%-39s%-39s\n\r", - pArea1->credits, (pArea2 != NULL) ? pArea2->credits : "" ); - AreaStrLen = strlen( buf ); + sprintf( bufa, "%-39s", pArea1->credits); + sprintf( bufb, "%-39s", (pArea2 != NULL) ? pArea2->credits : " " ); + AreaStrLen = strlen( bufa ); for( AreaCnt = 0; AreaCnt < AreaStrLen; AreaCnt++) { - if (buf[AreaCnt] == 123) - buf[AreaCnt] = 91; - if (buf[AreaCnt] == 125) - buf[AreaCnt] = 93; - } + if (bufa[AreaCnt] == 123) + bufa[AreaCnt] = 91; + if (bufa[AreaCnt] == 125) + bufa[AreaCnt] = 93; + } + sprintf(bufc, "%c%c%c%c", + bufa[13], bufa[14], bufa[15], bufa[16]); + sprintf(bufd, "%c%c%c{C%c", + bufa[13], bufa[14], bufa[15], bufa[16]); + str_replace(bufa, bufc, bufd); + str_replace(bufa, "] ", "]{Y "); + AreaStrLen = strlen( bufb ); + for( AreaCnt = 0; AreaCnt < AreaStrLen; AreaCnt++) + { + if (bufb[AreaCnt] == 123) + bufb[AreaCnt] = 91; + if (bufb[AreaCnt] == 125) + bufb[AreaCnt] = 93; + } + if (AreaStrLen > 16) + { + sprintf(bufc, "%c%c%c%c", + bufb[13], bufb[14], bufb[15], bufb[16]); + sprintf(bufd, "%c%c%c{C%c", + bufb[13], bufb[14], bufb[15], bufb[16]); + str_replace(bufb, bufc, bufd); + } + str_replace(bufb, "] ", "]{Y "); + sprintf( buf, "{%s%s{%s%s{x\n\r", + (bufa[0] == 60) ? "R" : "G", bufa, + (bufb[0] == 60) ? "R" : "G", bufb ); add_buf(output,buf); pArea1 = pArea1->next; if ( pArea2 != NULL ) @@ -2938,6 +3139,7 @@ sprintf( buf, "(in use)%5d\n\r", mobile_count ); send_to_char( buf, ch ); sprintf( buf, "Objs %5d(%d new format)\n\r", top_obj_index,newobjs ); send_to_char( buf, ch ); + sprintf( buf, "Dreams %5d\n\r", top_drm_index ); send_to_char( buf, ch ); sprintf( buf, "Resets %5d\n\r", top_reset ); send_to_char( buf, ch ); sprintf( buf, "Rooms %5d\n\r", top_room ); send_to_char( buf, ch ); sprintf( buf, "Shops %5d\n\r", top_shop ); send_to_char( buf, ch ); @@ -2978,7 +3180,7 @@ aff_count = 0; /* mobile prototypes */ - fprintf(fp,"MobProt %4d (%8ld bytes)\n", + fprintf(fp,"MobProt %4d (%8d bytes)\n", top_mob_index, top_mob_index * (sizeof(*pMobIndex))); /* mobs */ @@ -2994,7 +3196,7 @@ for (fch = char_free; fch != NULL; fch = fch->next) count2++; - fprintf(fp,"Mobs %4d (%8ld bytes), %2d free (%ld bytes)\n", + fprintf(fp,"Mobs %4d (%8d bytes), %2d free (%d bytes)\n", count, count * (sizeof(*fch)), count2, count2 * (sizeof(*fch))); /* pcdata */ @@ -3002,7 +3204,7 @@ for (pc = pcdata_free; pc != NULL; pc = pc->next) count++; - fprintf(fp,"Pcdata %4d (%8ld bytes), %2d free (%ld bytes)\n", + fprintf(fp,"Pcdata %4d (%8d bytes), %2d free (%d bytes)\n", num_pcs, num_pcs * (sizeof(*pc)), count, count * (sizeof(*pc))); /* descriptors */ @@ -3012,7 +3214,7 @@ for (d= descriptor_free; d != NULL; d = d->next) count2++; - fprintf(fp, "Descs %4d (%8ld bytes), %2d free (%ld bytes)\n", + fprintf(fp, "Descs %4d (%8d bytes), %2d free (%d bytes)\n", count, count * (sizeof(*d)), count2, count2 * (sizeof(*d))); /* object prototypes */ @@ -3024,7 +3226,7 @@ nMatch++; } - fprintf(fp,"ObjProt %4d (%8ld bytes)\n", + fprintf(fp,"ObjProt %4d (%8d bytes)\n", top_obj_index, top_obj_index * (sizeof(*pObjIndex))); @@ -3039,7 +3241,7 @@ for (obj = obj_free; obj != NULL; obj = obj->next) count2++; - fprintf(fp,"Objs %4d (%8ld bytes), %2d free (%ld bytes)\n", + fprintf(fp,"Objs %4d (%8d bytes), %2d free (%d bytes)\n", count, count * (sizeof(*obj)), count2, count2 * (sizeof(*obj))); /* affects */ @@ -3047,15 +3249,15 @@ for (af = affect_free; af != NULL; af = af->next) count++; - fprintf(fp,"Affects %4d (%8ld bytes), %2d free (%ld bytes)\n", + fprintf(fp,"Affects %4d (%8d bytes), %2d free (%d bytes)\n", aff_count, aff_count * (sizeof(*af)) ,count, count * (sizeof(*af))); /* rooms */ - fprintf(fp,"Rooms %4d (%8ld bytes)\n", + fprintf(fp,"Rooms %4d (%8d bytes)\n", top_room, top_room * (sizeof(*room))); /* exits */ - fprintf(fp,"Exits %4d (%8ld bytes)\n", + fprintf(fp,"Exits %4d (%8d bytes)\n", top_exit, top_exit * (sizeof(*exit))); fclose(fp); @@ -3081,14 +3283,17 @@ fprintf(fp,"\nObject Analysis\n"); fprintf(fp, "---------------\n"); + fprintf(fp,"Vnum Lev Counts Type Description\n"); + fprintf(fp,"-----------------------------------------------------\n"); nMatch = 0; for (vnum = 0; nMatch < top_obj_index; vnum++) if ((pObjIndex = get_obj_index(vnum)) != NULL) { nMatch++; - fprintf(fp,"#%-4d %3d active %3d reset %s\n", - pObjIndex->vnum,pObjIndex->count, - pObjIndex->reset_num,pObjIndex->short_descr); + fprintf(fp,"#%-5d %3d %3d a %3d r %-15s %s\n", + pObjIndex->vnum,pObjIndex->level,pObjIndex->count, + pObjIndex->reset_num,item_type_name(pObjIndex), + pObjIndex->short_descr); } /* close file */ @@ -3277,7 +3482,7 @@ /* - * Removes the tildes from a string. + * Removes the tildes and dollars from a string. * Used for player-entered strings that go into disk files. */ void smash_tilde( char *str ) @@ -3286,6 +3491,8 @@ { if ( *str == '~' ) *str = '-'; + if ( *str == '$' ) + *str = '_'; } return; @@ -3724,10 +3931,14 @@ OBJ_DATA *toportal; EXIT_DATA *pexit; int clannum, door, todoor; + int chkdoor, countdoor; sh_int room, toroom; if (code == 0) + { chain = 3120; + ladder = 9818; + } if ((code == 0) || (code == ROOM_VNUM_CLANS)) { @@ -3796,28 +4007,39 @@ && !IS_SET(pToRoomIndex->room_flags, ROOM_NOWHERE) && !IS_SET(pToRoomIndex->room_flags, ROOM_LOCKED) && (pToRoomIndex->vnum != ROOM_VNUM_CHAIN) + && (pToRoomIndex->vnum != ROOM_VNUM_LADDER) && (pToRoomIndex->exit[todoor] == NULL) && (pToRoomIndex->exit[todoor+6] == NULL)) { portal = get_obj_exit( "exit", pRoomIndex->contents ); if (portal == NULL) - break; + { + countdoor = 0; + for (chkdoor = 0; chkdoor < 6; chkdoor++) + { + if (pToRoomIndex->exit[chkdoor] != NULL) + if (!IS_SET(pToRoomIndex->exit[chkdoor]->exit_info, EX_CLOSED)) + countdoor++; + } + if (countdoor > 1) + break; + } } } } portal = create_object(get_obj_index(OBJ_VNUM_EXIT),1); sprintf(buf,"exit %s", dir_name[door]); - free_string( portal->name ); + free_string( portal->name, "db.c/randomize_entrances #1" ); portal->name = str_dup( buf ); - free_string( portal->short_descr ); + free_string( portal->short_descr, "db.c/randomize_entrances #2" ); portal->short_descr = str_dup( dir_name[door] ); portal->value[0] = pToRoomIndex->vnum; obj_to_room( portal, pRoomIndex ); toportal = create_object(get_obj_index(OBJ_VNUM_EXIT),1); sprintf(buf,"exit %s", dir_name[todoor]); - free_string( toportal->name ); + free_string( toportal->name, "db.c/randomize_entrances #3" ); toportal->name = str_dup( buf ); - free_string( toportal->short_descr ); + free_string( toportal->short_descr, "db.c/randomize_entrances #4" ); toportal->short_descr = str_dup( dir_name[todoor] ); toportal->value[0] = pRoomIndex->vnum; obj_to_room( toportal, pToRoomIndex ); @@ -3906,9 +4128,9 @@ todoor = 4; portal = create_object(get_obj_index(OBJ_VNUM_EXIT),1); sprintf(buf,"exit %s", dir_name[door]); - free_string( portal->name ); + free_string( portal->name, "db.c/randomize_entrances #5" ); portal->name = str_dup( buf ); - free_string( portal->short_descr ); + free_string( portal->short_descr, "db.c/randomize_entrances #6" ); portal->short_descr = str_dup( dir_name[door] ); portal->value[0] = pToRoomIndex->vnum; obj_to_room( portal, pRoomIndex ); @@ -3916,6 +4138,88 @@ obj_to_room( toportal, pToRoomIndex ); buf[0] = '\0'; if (code != 0) + { + return; + } + } + if ((code == 0) || (code == ROOM_VNUM_LADDER)) + { + CHAR_DATA *rch; + + if (code == ROOM_VNUM_LADDER) + { + if (number_range(0, 1000) < 500) + return; + } + room = ROOM_VNUM_LADDER; + if ( ( pRoomIndex = get_room_index( room ) ) == NULL ) + { + bug( "Ladder Room: bad vnum %d.", room ); + return; + } + door = 5; + todoor = 4; + portal = get_obj_exit( dir_name[door], pRoomIndex->contents ); + if ((portal != NULL) && (portal->item_type == ITEM_EXIT)) + { + toroom = portal->value[0]; + pToRoomIndex = get_room_index( toroom ); + if ( pToRoomIndex != NULL ) + { + toportal = get_obj_exit( "ladder", pToRoomIndex->contents ); + if ((toportal != NULL) && (toportal->item_type == ITEM_EXIT)) + extract_obj( toportal ); + } + extract_obj( portal ); + } else { + toroom = 9818; + ladder = 9818; + } + pToRoomIndex = get_room_index( toroom ); + for ( ; ; ) + { + door = number_range( 0, 3 ); + if ( (pexit = pToRoomIndex->exit[door] ) != NULL) + { + if ((pexit->u1.to_room->vnum >= 9814) + && (pexit->u1.to_room->vnum <= 9825)) + { + toroom = pexit->u1.to_room->vnum; + break; + } + } + } + if (door < 2) + todoor = door+2; + else + todoor = door-2; + + sprintf(buf,"The rope ladder drifts off to the %s.\n\r", + dir_name[door]); + for ( rch = pToRoomIndex->people; rch != NULL; rch = rch->next_in_room ) + send_to_char( buf, rch ); + + pToRoomIndex = get_room_index( toroom ); + sprintf(buf,"A rope ladder drifts in from the %s.\n\r", + dir_name[todoor]); + for ( rch = pToRoomIndex->people; rch != NULL; rch = rch->next_in_room ) + send_to_char( buf, rch ); + + ladder = toroom; + door = 5; + todoor = 4; + portal = create_object(get_obj_index(OBJ_VNUM_EXIT),1); + sprintf(buf,"exit %s", dir_name[door]); + free_string( portal->name, "db.c/randomize_entrances #7" ); + portal->name = str_dup( buf ); + free_string( portal->short_descr, "db.c/randomize_entrances #8" ); + portal->short_descr = str_dup( dir_name[door] ); + portal->value[0] = pToRoomIndex->vnum; + obj_to_room( portal, pRoomIndex ); + toportal = create_object(get_obj_index(OBJ_VNUM_LADDER),1); + obj_to_room( toportal, pToRoomIndex ); + buf[0] = '\0'; + if (code != 0) { return; } --- db.h Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/db.h Fri Aug 6 23:06:04 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ /* vals from db.c */ @@ -37,8 +35,10 @@ extern int newobjs; extern MOB_INDEX_DATA * mob_index_hash [MAX_KEY_HASH]; extern OBJ_INDEX_DATA * obj_index_hash [MAX_KEY_HASH]; +extern DRM_INDEX_DATA * drm_index_hash [MAX_KEY_HASH]; extern int top_mob_index; extern int top_obj_index; +extern int top_drm_index; extern int top_affect; extern int top_ed; extern AREA_DATA * area_first; --- effects.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/effects.c Fri Aug 6 23:06:04 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) --- fight.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/fight.c Sun Aug 15 17:28:28 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -64,6 +62,11 @@ DECLARE_DO_FUN(do_vdth ); DECLARE_DO_FUN(do_look ); +const int vam_str [] = +{ + 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, + 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5 +}; /* * Local functions. @@ -150,6 +153,11 @@ /* PCs next */ if (!IS_NPC(ch) || IS_AFFECTED(ch,AFF_CHARM)) { + if ( !IS_NPC(rch) && !IS_NPC(victim) + && ( !is_pkill(rch) || !is_pkill(victim) ) + && !IS_SET(victim->act, PLR_TWIT) ) + continue; + if ( ( (!IS_NPC(rch) && IS_SET(rch->act,PLR_AUTOASSIST)) || IS_AFFECTED(rch,AFF_CHARM)) && is_same_group(ch,rch) @@ -231,13 +239,20 @@ if (ch->position < POS_RESTING) return; + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } if (ch->stunned) { ch->stunned--; if (!ch->stunned) { send_to_char( "You regain your equilibrium.\n\r", ch); - act( "$n regains $m equilibrium.", ch, NULL, NULL, TO_ROOM ); + act( "$n regains $s equilibrium.", ch, NULL, NULL, TO_ROOM ); } return; } @@ -262,6 +277,14 @@ { check_improve(ch,gsn_dual_wield,TRUE,1); } + else if (!IS_NPC(ch) && (ch->pcdata->tier == 2) ) + { + if ( get_skill(ch,gsn_dual_wield) != 0 && (!IS_NPC(ch) + && ch->level >= skill_table[gsn_dual_wield].skill_level[ch->clasb])) + { + check_improve(ch,gsn_dual_wield,TRUE,1); + } + } } if ( ch->fighting != victim ) return; @@ -539,7 +562,7 @@ * Can't beat a dead char! * Guard against weird room-leavings. */ - if ( victim->position == POS_DEAD || ch->in_room != victim->in_room ) + if ( victim->position == POS_DEAD || ch->in_room != victim->in_room || victim->spirit) return; /* @@ -600,6 +623,13 @@ { thac0_00 = class_table[ch->class].thac0_00; thac0_32 = class_table[ch->class].thac0_32; + if (ch->pcdata->tier == 2) + { + thac0_00 = UMIN(class_table[ch->class].thac0_00, + class_table[ch->clasb].thac0_00); + thac0_32 = UMIN(class_table[ch->class].thac0_32, + class_table[ch->clasb].thac0_32); + } } thac0 = interpolate( ch->level, thac0_00, thac0_32 ); @@ -615,9 +645,6 @@ if (dt == gsn_backstab) thac0 -= 10 * (100 - get_skill(ch,gsn_backstab)); - if (dt == gsn_circle) - thac0 -= 10 * (100 - get_skill(ch,gsn_circle)); - switch(dam_type) { case(DAM_PIERCE):victim_ac = GET_AC(victim,AC_PIERCE)/10; break; @@ -625,6 +652,33 @@ case(DAM_SLASH): victim_ac = GET_AC(victim,AC_SLASH)/10; break; default: victim_ac = GET_AC(victim,AC_EXOTIC)/10; break; }; + + if ( ( ( !strcmp( class_table[victim->class].name, "vampire" ) ) + || ( !strcmp( class_table[victim->class].name, "lich" ) ) ) + && ( IS_OUTSIDE( victim ) ) + && ( vam_str[time_info.hour] != 0 ) ) + { + if ( ( time_info.hour > 6 ) && ( time_info.hour < 18 ) ) + { + victim_ac += ( victim_ac*( vam_str[time_info.hour]/100 ) ); + } else { + victim_ac -= ( victim_ac*( vam_str[time_info.hour]/100 ) ); + } + } else if (!IS_NPC(victim) && (victim->pcdata->tier == 2 ) ) + { + if ( ( !strcmp( class_table[victim->clasb].name, "vampire" ) ) + && ( IS_OUTSIDE( victim ) ) + && ( vam_str[time_info.hour] != 0 ) ) + { + if ( ( time_info.hour > 6 ) && ( time_info.hour < 18 ) ) + { + victim_ac += ( victim_ac*( vam_str[time_info.hour]/100 ) ); + } else { + victim_ac -= ( victim_ac*( vam_str[time_info.hour]/100 ) ); + } + } + + } if (victim_ac < -15) victim_ac = (victim_ac + 15) / 5 - 15; @@ -675,7 +729,19 @@ { if (wield->clan) { - dam = dice(ch->level/3,3) * skill/100; + float adlev, inclev; + int cntr; + + adlev = 8; + inclev = .01; + for (cntr = 0; cntr <= ch->level; cntr++) + { + adlev += .57; + adlev += inclev; + inclev += .005; + } + cntr = (int)adlev; + dam = dice(cntr/3,3) * skill/100; } else { if (wield->pIndexData->new_format) @@ -704,13 +770,43 @@ /* * Bonuses. */ + + if ( ( ( !strcmp( class_table[ch->class].name, "vampire" ) ) + || ( !strcmp( class_table[ch->class].name, "lich" ) ) ) + && ( IS_OUTSIDE( ch ) ) + && ( vam_str[time_info.hour] != 0 ) ) + { + if ( ( time_info.hour > 6 ) && ( time_info.hour < 18 ) ) + { + dam -= ( dam*( vam_str[time_info.hour]/100 ) ); + } else { + dam += ( dam*( vam_str[time_info.hour]/100 ) ); + } + } else if ( !IS_NPC(ch) && ( ch->pcdata->tier == 2 ) ) + { + if ( ( !strcmp( class_table[ch->clasb].name, "vampire" ) ) + && ( IS_OUTSIDE( ch ) ) + && ( vam_str[time_info.hour] != 0 ) ) + { + if ( ( time_info.hour > 6 ) && ( time_info.hour < 18 ) ) + { + dam -= ( dam*( vam_str[time_info.hour]/100 ) ); + } else { + dam += ( dam*( vam_str[time_info.hour]/100 ) ); + } + } + } + if ( get_skill(ch,gsn_enhanced_damage) > 0 ) { diceroll = number_percent(); if (diceroll <= get_skill(ch,gsn_enhanced_damage)) { check_improve(ch,gsn_enhanced_damage,TRUE,6); - dam += 2 * ( dam * diceroll/300); + if (str_cmp(class_table[ch->class].name,"gladiator")) + dam += 2 * ( dam * diceroll/300); + else + dam += 2 * ( dam * diceroll/200); } } @@ -720,17 +816,19 @@ dam = dam * 3 / 2; if ( dt == gsn_backstab && wield != NULL) + { if ( wield->value[0] != 2 ) dam *= 2 + (ch->level / 10); else dam *= 2 + (ch->level / 8); - + } if ( dt == gsn_circle && wield != NULL) + { if ( wield->value[0] != 2 ) - dam *= 2 + (ch->level / 15); + dam *= 1.5 + (ch->level / 15); else - dam *= 2 + (ch->level / 12); - + dam *= 1.5 + (ch->level / 12); + } dam += GET_DAMROLL(ch) * UMIN(100,skill) /100; if ( dam <= 0 ) @@ -788,7 +886,7 @@ act("{k$p draws life from $n.{x",victim,wield,NULL,TO_ROOM); act("{iYou feel $p drawing your life away.{x", victim,wield,NULL,TO_CHAR); - damage_old(ch,victim,dam,0,DAM_NEGATIVE,FALSE); + damage(ch,victim,dam,0,DAM_NEGATIVE,FALSE); ch->alignment = UMAX(-1000,ch->alignment - 1); if ( ch->pet != NULL ) ch->pet->alignment = ch->alignment; @@ -833,7 +931,7 @@ { dt = skill_lookup("iceshield"); dam = number_range(5, 15); - damage_old(victim, ch, dam, dt, DAM_COLD, TRUE); + damage(victim, ch, dam, dt, DAM_COLD, TRUE); } } if (IS_SHIELDED(victim, SHD_FIRE)) @@ -842,7 +940,7 @@ { dt = skill_lookup("fireshield"); dam = number_range(10, 20); - damage_old(victim, ch, dam, dt, DAM_FIRE, TRUE); + damage(victim, ch, dam, dt, DAM_FIRE, TRUE); } } if (IS_SHIELDED(victim, SHD_SHOCK)) @@ -851,7 +949,7 @@ { dt = skill_lookup("shockshield"); dam = number_range(15, 25); - damage_old(victim, ch, dam, dt, DAM_LIGHTNING, TRUE); + damage(victim, ch, dam, dt, DAM_LIGHTNING, TRUE); } } } @@ -949,6 +1047,13 @@ { thac0_00 = class_table[ch->class].thac0_00; thac0_32 = class_table[ch->class].thac0_32; + if (ch->pcdata->tier == 2) + { + thac0_00 = UMIN(class_table[ch->class].thac0_00, + class_table[ch->clasb].thac0_00); + thac0_32 = UMIN(class_table[ch->class].thac0_32, + class_table[ch->clasb].thac0_32); + } } thac0 = interpolate( ch->level, thac0_00, thac0_32 ); @@ -964,9 +1069,6 @@ if (dt == gsn_backstab) thac0 -= 10 * (100 - get_skill(ch,gsn_backstab)); - if (dt == gsn_circle) - thac0 -= 10 * (100 - get_skill(ch,gsn_circle)); - switch(dam_type) { case(DAM_PIERCE):victim_ac = GET_AC(victim,AC_PIERCE)/10; break; @@ -1024,7 +1126,19 @@ { if (wield->clan) { - dam = dice(ch->level/3,3) * skill/100; + float adlev, inclev; + int cntr; + + adlev = 8; + inclev = .01; + for (cntr = 0; cntr <= ch->level; cntr++) + { + adlev += .57; + adlev += inclev; + inclev += .005; + } + cntr = (int)adlev; + dam = dice(cntr/3,3) * skill/100; } else { if (wield->pIndexData->new_format) @@ -1059,7 +1173,10 @@ if (diceroll <= get_skill(ch,gsn_enhanced_damage)) { check_improve(ch,gsn_enhanced_damage,TRUE,6); - dam += 2 * ( dam * diceroll/300); + if (str_cmp(class_table[ch->class].name,"gladiator")) + dam += 2 * ( dam * diceroll/300); + else + dam += 2 * ( dam * diceroll/200); } } @@ -1069,17 +1186,19 @@ dam = dam * 3 / 2; if ( dt == gsn_backstab && wield != NULL) + { if ( wield->value[0] != 2 ) dam *= 2 + (ch->level / 10); else dam *= 2 + (ch->level / 8); - + } if ( dt == gsn_circle && wield != NULL) + { if ( wield->value[0] != 2 ) - dam *= 2 + (ch->level / 15); + dam *= 1.5 + (ch->level / 15); else - dam *= 2 + (ch->level / 12); - + dam *= 1.5 + (ch->level / 12); + } dam += GET_DAMROLL(ch) * UMIN(100,skill) /100; if ( dam <= 0 ) @@ -1097,13 +1216,15 @@ bool damage(CHAR_DATA *ch,CHAR_DATA *victim,int dam,int dt,int dam_type, bool show) { - OBJ_DATA *corpse; bool immune; if ( victim->position == POS_DEAD ) return FALSE; + if (ch->spirit || victim->spirit) + return FALSE; + /* * Stop up any residual loopholes. */ @@ -1118,10 +1239,12 @@ send_to_char("{cYou {z{Breally{x{c shouldn't cheat.{x\n\r",ch); if (obj != NULL) extract_obj(obj); + obj = get_eq_char( ch, WEAR_SECONDARY ); + if (obj != NULL) + extract_obj(obj); } } - /* damage reduction */ if ( dam > 35) @@ -1129,9 +1252,6 @@ if ( dam > 80) dam = (dam - 80)/2 + 80; - - - if ( victim != ch ) { /* @@ -1141,6 +1261,8 @@ if ( is_safe( ch, victim ) ) return FALSE; + if (ch->spirit || victim->spirit) + return FALSE; if ( victim->position > POS_STUNNED ) { if ( victim->fighting == NULL ) @@ -1153,23 +1275,6 @@ { if ( ch->fighting == NULL ) set_fighting( ch, victim ); - - /* - * If victim is charmed, ch might attack victim's master. - taken out by Russ! */ -/* - if ( IS_NPC(ch) - && IS_NPC(victim) - && IS_AFFECTED(victim, AFF_CHARM) - && victim->master != NULL - && victim->master->in_room == ch->in_room - && number_bits( 3 ) == 0 ) - { - stop_fighting( ch, FALSE ); - multi_hit( ch, victim->master, TYPE_UNDEFINED ); - return FALSE; - } -*/ } /* @@ -1236,6 +1341,9 @@ break; } + if (ch->spirit || victim->spirit) + return FALSE; + if (show) dam_message( ch, victim, dam, dt, immune ); @@ -1252,9 +1360,9 @@ && victim->hit < 1 ) victim->hit = 1; update_pos( victim ); - if (dt == gsn_feed) + if (dt == gsn_feed && !victim->spirit) { - ch->hit = UMIN(ch->hit+((dam/3)*2), ch->max_hit); + ch->hit = UMIN(ch->hit+((dam/4)*3), ch->max_hit); update_pos( ch ); } @@ -1326,12 +1434,14 @@ /* * Dying penalty: - * 2/3 way back to previous level. + * 5/6 way back to previous level. */ if ( victim->exp > exp_per_level(victim,victim->pcdata->points) * victim->level ) - gain_exp( victim, (5 * (exp_per_level(victim,victim->pcdata->points) - * victim->level - victim->exp)/6) + 50 ); + if (!IS_SET(victim->act, PLR_LQUEST)) + gain_exp( victim, (5 * + (exp_per_level(victim,victim->pcdata->points) + * victim->level - victim->exp)/6) + 50 ); } sprintf( log_buf, "%s got toasted by %s at %s [room %d]", @@ -1373,10 +1483,12 @@ do_get(ch, "all.gcash corpse"); if ( IS_SET(ch->act, PLR_AUTOSAC) ) + { if ( IS_SET(ch->act,PLR_AUTOLOOT) && corpse && corpse->contains) return TRUE; /* leave if corpse has treasure */ else do_sacrifice( ch, "corpse" ); + } } return TRUE; @@ -1517,327 +1629,6 @@ return TRUE; } -/* - * Inflict damage from a hit. - */ -bool damage_old( CHAR_DATA *ch, CHAR_DATA *victim, int dam, int dt, int -dam_type, bool show ) { - - OBJ_DATA *corpse; - bool immune; - - if ( victim->position == POS_DEAD ) - return FALSE; - - /* - * Stop up any residual loopholes. - */ - - if ( dam > 1200 && dt >= TYPE_HIT && !IS_IMMORTAL(ch)) - { - bug( "Damage: %d: more than 1200 points!", dam ); - dam = 1200; - if (!IS_IMMORTAL(ch)) - { - OBJ_DATA *obj; - obj = get_eq_char( ch, WEAR_WIELD ); - send_to_char("{cYou {z{Greally{x{c shouldn't cheat.{x\n\r",ch); - if (obj != NULL) - extract_obj(obj); - } - - } - - - /* damage reduction */ - if ( dam > 35) - dam = (dam - 35)/2 + 35; - if ( dam > 80) - dam = (dam - 80)/2 + 80; - - - - - if ( victim != ch ) - { - /* - * Certain attacks are forbidden. - * Most other attacks are returned. - */ - if ( is_safe( ch, victim ) ) - return FALSE; - - if ( victim->position > POS_STUNNED ) - { - if ( victim->fighting == NULL ) - set_fighting( victim, ch ); - if (victim->timer <= 4) - victim->position = POS_FIGHTING; - } - - if ( victim->position > POS_STUNNED ) - { - if ( ch->fighting == NULL ) - set_fighting( ch, victim ); - - /* - * If victim is charmed, ch might attack victim's master. - */ - if ( IS_NPC(ch) - && IS_NPC(victim) - && IS_AFFECTED(victim, AFF_CHARM) - && victim->master != NULL - && victim->master->in_room == ch->in_room - && number_bits( 3 ) == 0 ) - { - stop_fighting( ch, FALSE ); - multi_hit( ch, victim->master, TYPE_UNDEFINED ); - return FALSE; - } - } - - /* - * More charm stuff. - */ - if ( victim->master == ch ) - stop_follower( victim ); - } - - /* - * Inviso attacks ... not. - */ - if ( IS_SHIELDED(ch, SHD_INVISIBLE) ) - { - affect_strip( ch, gsn_invis ); - affect_strip( ch, gsn_mass_invis ); - REMOVE_BIT( ch->shielded_by, SHD_INVISIBLE ); - act( "$n fades into existence.", ch, NULL, NULL, TO_ROOM ); - } - - /* - * Damage modifiers. - */ - - if ( dam > 1 && !IS_NPC(victim) - && victim->pcdata->condition[COND_DRUNK] > 10 ) - dam = 9 * dam / 10; - - if ( dam > 1 && IS_SHIELDED(victim, SHD_SANCTUARY) ) - dam /= 2; - - if ( dam > 1 && ((IS_SHIELDED(victim, SHD_PROTECT_EVIL) && IS_EVIL(ch) ) - || (IS_SHIELDED(victim, SHD_PROTECT_GOOD) && IS_GOOD(ch) ))) - dam -= dam / 4; - - immune = FALSE; - - - /* - * Check for parry, and dodge. - */ - if ( dt >= TYPE_HIT && ch != victim) - { - if ( check_parry( ch, victim ) ) - return FALSE; - if ( check_dodge( ch, victim ) ) - return FALSE; - if ( check_shield_block(ch,victim)) - return FALSE; - - } - - switch(check_immune(victim,dam_type)) - { - case(IS_IMMUNE): - immune = TRUE; - dam = 0; - break; - case(IS_RESISTANT): - dam -= dam/3; - break; - case(IS_VULNERABLE): - dam += dam/2; - break; - } - - if (show) - dam_message( ch, victim, dam, dt, immune ); - - if (dam == 0) - return FALSE; - - /* - * Hurt the victim. - * Inform the victim of his new state. - */ - victim->hit -= dam; - if ( !IS_NPC(victim) - && victim->level >= LEVEL_IMMORTAL - && victim->hit < 1 ) - victim->hit = 1; - update_pos( victim ); - if (dt == gsn_feed) - { - ch->hit = UMIN(ch->hit+((dam/3)*2), ch->max_hit); - update_pos( ch ); - } - - switch( victim->position ) - { - case POS_MORTAL: - act( "{c$n is mortally wounded, and will die soon, if not aided.{x", - victim, NULL, NULL, TO_ROOM ); - send_to_char( - "{cYou are mortally wounded, and will die soon, if not aided.{x\n\r", - victim ); - break; - - case POS_INCAP: - act( "{c$n is incapacitated and will slowly die, if not aided.{x", - victim, NULL, NULL, TO_ROOM ); - send_to_char( - "{cYou are incapacitated and will slowly {Rdie{c, if not aided.{x\n\r", - victim ); - break; - - case POS_STUNNED: - act( "{c$n is stunned, but will probably recover.{x", - victim, NULL, NULL, TO_ROOM ); - send_to_char("{cYou are stunned, but will probably recover.{x\n\r", - victim ); - break; - - case POS_DEAD: - if ((IS_NPC(victim)) && ( victim->die_descr[0] != '\0')) - { - act( "{c$n $T{x", victim, 0, victim->die_descr, TO_ROOM ); - } - else - { - act( "{c$n is {CDEAD!!{x", victim, 0, 0, TO_ROOM ); - } - send_to_char( "{cYou have been {RKILLED!!{x\n\r\n\r", victim ); - break; - - default: - if ( dam > victim->max_hit / 4 ) - send_to_char( "{cThat really did {RHURT!{x\n\r", victim ); - if ( victim->hit < victim->max_hit / 4 ) - send_to_char( "{cYou sure are {z{RBLEEDING!{x\n\r", victim ); - break; - } - - /* - * Sleep spells and extremely wounded folks. - */ - if ( !IS_AWAKE(victim) ) - stop_fighting( victim, FALSE ); - - /* - * Payoff for killing things. - */ - if ( victim->position == POS_DEAD ) - { - group_gain( ch, victim ); - - if ( !IS_NPC(victim) ) - { - sprintf( log_buf, "%s killed by %s at %d", - victim->name, - (IS_NPC(ch) ? ch->short_descr : ch->name), - victim->in_room->vnum ); - log_string( log_buf ); - - /* - * Dying penalty: - * 2/3 way back to previous level. - */ - if ( victim->exp > exp_per_level(victim,victim->pcdata->points) - * victim->level ) - gain_exp( victim, (2 * (exp_per_level(victim,victim->pcdata->points) - * victim->level - victim->exp)/3) + 50 ); - } - - sprintf( log_buf, "%s got toasted by %s at %s [room %d]", - (IS_NPC(victim) ? victim->short_descr : victim->name), - (IS_NPC(ch) ? ch->short_descr : ch->name), - ch->in_room->name, ch->in_room->vnum); - - if (IS_NPC(victim)) - wiznet(log_buf,NULL,NULL,WIZ_MOBDEATHS,0,0); - else - wiznet(log_buf,NULL,NULL,WIZ_DEATHS,0,0); - - raw_kill( victim, ch ); - /* dump the flags */ - if (ch != victim && !IS_NPC(ch) && (!is_same_clan(ch,victim) - || clan_table[victim->clan].independent)) - { - if (IS_SET(victim->act,PLR_TWIT)) - REMOVE_BIT(victim->act,PLR_TWIT); - } - /* RT new auto commands */ - - if ( !IS_NPC(ch) && IS_NPC(victim) ) - { - corpse = get_obj_list( ch, "corpse", ch->in_room->contents ); - - if ( IS_SET(ch->act, PLR_AUTOLOOT) && - corpse && corpse->contains) /* exists and not empty */ - do_get( ch, "all corpse" ); - - if (IS_SET(ch->act,PLR_AUTOGOLD) && - corpse && corpse->contains && /* exists and not empty */ - !IS_SET(ch->act,PLR_AUTOLOOT)) - do_get(ch, "gold corpse"); - - if ( IS_SET(ch->act, PLR_AUTOSAC) ) - if ( IS_SET(ch->act,PLR_AUTOLOOT) && corpse && corpse->contains) - return TRUE; /* leave if corpse has treasure */ - else - do_sacrifice( ch, "corpse" ); - } - - return TRUE; - } - - if ( victim == ch ) - return TRUE; - - /* - * Take care of link dead people. - */ - if ( !IS_NPC(victim) && victim->desc == NULL ) - { - if ( number_range( 0, victim->wait ) == 0 ) - { - do_recall( victim, "" ); - return TRUE; - } - } - - /* - * Wimp out? - */ - if ( IS_NPC(victim) && dam > 0 && victim->wait < PULSE_VIOLENCE / 2) - { - if ( ( IS_SET(victim->act, ACT_WIMPY) && number_bits( 2 ) == 0 - && victim->hit < victim->max_hit / 5) - || ( IS_AFFECTED(victim, AFF_CHARM) && victim->master != NULL - && victim->master->in_room != victim->in_room ) ) - do_flee( victim, "" ); - } - - if ( !IS_NPC(victim) - && victim->hit > 0 - && victim->hit <= victim->wimpy - && victim->wait < PULSE_VIOLENCE / 2 ) - do_flee( victim, "" ); - - tail_chain( ); - return TRUE; -} - bool is_safe(CHAR_DATA *ch, CHAR_DATA *victim) { if (victim->in_room == NULL || ch->in_room == NULL) @@ -1849,6 +1640,16 @@ if (!IS_NPC(ch) && IS_IMMORTAL(ch)) return FALSE; + if (ch->spirit) + { + send_to_char("You need a body for that!\n\r", ch); + return TRUE; + } + if (victim->spirit) + { + send_to_char("Spirits are difficult to harm.\n\r",ch); + return TRUE; + } /* killing mobiles */ if (IS_NPC(victim)) { @@ -1860,6 +1661,12 @@ return TRUE; } + if (!IS_NPC(ch) && IS_SET(victim->in_room->room_flags,ROOM_CLAN_ENT)) + { + send_to_char("Not in this room.\n\r",ch); + return TRUE; + } + if (victim->pIndexData->pShop != NULL) { send_to_char("The shopkeeper wouldn't like that.\n\r",ch); @@ -1870,7 +1677,7 @@ if (IS_SET(victim->act,ACT_TRAIN) || IS_SET(victim->act,ACT_PRACTICE) || IS_SET(victim->act,ACT_IS_HEALER) - || IS_SET(victim->act,ACT_IS_CHANGER) + || IS_SET(victim->act,ACT_IS_BANKER) || IS_SET(victim->act,ACT_IS_SATAN) || IS_SET(victim->act,ACT_IS_PRIEST)) { @@ -1920,6 +1727,9 @@ /* player doing the killing */ else { + if (IS_SET(victim->in_room->room_flags,ROOM_ARENA)) + return FALSE; + if (IS_SET(victim->act,PLR_TWIT) ) return FALSE; @@ -1974,25 +1784,72 @@ return TRUE; } - if ( ( ( ch->class < MAX_CLASS/2 ) - && ( victim->class < MAX_CLASS/2 ) ) - || ( ( ch->class >= MAX_CLASS/2 ) - && ( victim->class >= MAX_CLASS/2 ) ) ) + if ( ( ( ch->pcdata->tier == 2 ) + && ( victim->pcdata->tier == 2 ) ) + || ( ( ch->pcdata->tier == 1 ) + && ( victim->pcdata->tier == 1 ) ) + || ( ( ch->pcdata->tier == 0 ) + && ( victim->pcdata->tier == 0 ) ) ) { if (ch->level > victim->level + 10) { send_to_char("Pick on someone your own size.\n\r",ch); return TRUE; } - if (ch->level < victim->level - 10) + if (ch->level < victim->level - 20) { - send_to_char("Pick on someone your own size.\n\r",ch); + send_to_char("If you wish to die, there are less painful methods.\n\r",ch); return TRUE; } - } else { - send_to_char("Pick on someone in your own tier.\n\r",ch); + } + + if ( ( ch->pcdata->tier == 2 ) + && ( victim->pcdata->tier == 0 ) ) + { + send_to_char("Pick on someone your own size.\n\r",ch); return TRUE; } + + if ( ( ch->pcdata->tier == 0 ) + && ( victim->pcdata->tier == 2 ) ) + { + send_to_char("If you wish to die, there are less painful methods.\n\r",ch); + return TRUE; + } + + if ( ( ( ch->pcdata->tier == 1 ) + && ( victim->pcdata->tier == 0 ) ) + || ( ( ch->pcdata->tier == 2 ) + && ( victim->pcdata->tier == 1 ) ) ) + { + if (ch->level < (victim->level - 30)) + { + send_to_char("If you wish to die, there are less painful methods.\n\r",ch); + return TRUE; + } + if (ch->level > victim->level) + { + send_to_char("Pick on someone your own size.\n\r",ch); + return TRUE; + } + } + + if ( ( ( ch->pcdata->tier == 0 ) + && ( victim->pcdata->tier == 1 ) ) + || ( ( ch->pcdata->tier == 1 ) + && ( victim->pcdata->tier == 2 ) ) ) + { + if (ch->level < (victim->level - 10)) + { + send_to_char("If you wish to die, there are less painful methods.\n\r",ch); + return TRUE; + } + if (ch->level > (victim->level + 20)) + { + send_to_char("Pick on someone your own size.\n\r",ch); + return TRUE; + } + } } } return FALSE; @@ -2004,6 +1861,16 @@ return TRUE; if (!IS_NPC(ch) && IS_IMMORTAL(ch)) return FALSE; + if (ch->spirit) + { + send_to_char("You need a body for that!\n\r", ch); + return TRUE; + } + if (victim->spirit) + { + send_to_char("Spirits are difficult to harm.\n\r",ch); + return TRUE; + } if (IS_SET(victim->in_room->room_flags,ROOM_SAFE)) { send_to_char("Not in this room.\n\r",ch); @@ -2056,6 +1923,12 @@ if (!IS_NPC(ch) && IS_IMMORTAL(ch)) return FALSE; + if (ch->spirit) + return TRUE; + + if (victim->spirit) + return TRUE; + /* killing mobiles */ if (IS_NPC(victim)) { @@ -2063,6 +1936,9 @@ if (IS_SET(victim->in_room->room_flags,ROOM_SAFE)) return TRUE; + if (!IS_NPC(ch) && IS_SET(victim->in_room->room_flags,ROOM_CLAN_ENT)) + return TRUE; + if (victim->pIndexData->pShop != NULL) return TRUE; @@ -2070,7 +1946,7 @@ if (IS_SET(victim->act,ACT_TRAIN) || IS_SET(victim->act,ACT_PRACTICE) || IS_SET(victim->act,ACT_IS_HEALER) - || IS_SET(victim->act,ACT_IS_CHANGER) + || IS_SET(victim->act,ACT_IS_BANKER) || IS_SET(victim->act,ACT_IS_SATAN) || IS_SET(victim->act,ACT_IS_PRIEST)) return TRUE; @@ -2122,6 +1998,9 @@ /* player doing the killing */ else { + if (IS_SET(victim->in_room->room_flags,ROOM_ARENA)) + return FALSE; + if (IS_SET(victim->act,PLR_TWIT) ) return FALSE; @@ -2152,24 +2031,66 @@ if (!is_pkill(victim)) return TRUE; - if (is_same_clan(ch,victim)) + if (is_same_clan(ch,victim)) + return TRUE; + + if ( ( ( ch->pcdata->tier == 2 ) + && ( victim->pcdata->tier == 2 ) ) + || ( ( ch->pcdata->tier == 1 ) + && ( victim->pcdata->tier == 1 ) ) + || ( ( ch->pcdata->tier == 0 ) + && ( victim->pcdata->tier == 0 ) ) ) + { + if (ch->level > victim->level + 10) + { + return TRUE; + } + if (ch->level < victim->level - 20) + { + return TRUE; + } + } + + if ( ( ch->pcdata->tier == 2 ) + && ( victim->pcdata->tier == 0 ) ) + { + return TRUE; + } + + if ( ( ch->pcdata->tier == 0 ) + && ( victim->pcdata->tier == 2 ) ) + { return TRUE; + } - if ( ( ( ch->class < MAX_CLASS/2 ) - && ( victim->class < MAX_CLASS/2 ) ) - || ( ( ch->class >= MAX_CLASS/2 ) - && ( victim->class >= MAX_CLASS/2 ) ) ) + if ( ( ( ch->pcdata->tier == 1 ) + && ( victim->pcdata->tier == 0 ) ) + || ( ( ch->pcdata->tier == 2 ) + && ( victim->pcdata->tier == 1 ) ) ) { - if (ch->level > victim->level + 10) + if (ch->level < (victim->level - 30)) { return TRUE; - } - if (ch->level < victim->level - 10) + } + if (ch->level > victim->level) { return TRUE; - } - } else { - return TRUE; + } + } + + if ( ( ( ch->pcdata->tier == 0 ) + && ( victim->pcdata->tier == 1 ) ) + || ( ( ch->pcdata->tier == 1 ) + && ( victim->pcdata->tier == 2 ) ) ) + { + if (ch->level < (victim->level - 10)) + { + return TRUE; + } + if (ch->level > (victim->level + 20)) + { + return TRUE; + } } } } @@ -2293,6 +2214,7 @@ if ( victim->hit <= -11 ) { victim->position = POS_DEAD; + victim->spirit = 1; return; } @@ -2319,6 +2241,13 @@ if ( IS_AFFECTED(ch, AFF_SLEEP) ) affect_strip( ch, gsn_sleep ); + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } ch->fighting = victim; ch->position = POS_FIGHTING; ch->stunned = 0; @@ -2369,6 +2298,8 @@ OBJ_DATA *obj; OBJ_DATA *obj_next; char *name; + int gold, silver, platinum; + int wearloc; if ( IS_NPC(ch) ) { @@ -2380,6 +2311,12 @@ { obj_next = obj->next_content; obj_from_char( obj ); + if (!IS_NPC(killer) && killer->pcdata->is_aquest) + { + obj->got_from = ch->pIndexData->vnum; + } else { + obj->got_from = 0; + } if (obj->item_type == ITEM_POTION) obj->timer = number_range(500,1000); if (obj->item_type == ITEM_SCROLL) @@ -2402,7 +2339,7 @@ name = ch->short_descr; corpse = create_object(get_obj_index(OBJ_VNUM_CORPSE_NPC), 0); corpse->timer = number_range( 3, 6 ); - if ( ch->gold > 0 || ch->platinum > 0 ) + if ( ch->silver > 0 || ch->gold > 0 || ch->platinum > 0 ) { obj_to_obj( create_money( ch->platinum, ch->gold, ch->silver ), corpse ); ch->platinum = 0; @@ -2428,34 +2365,97 @@ corpse->killer = str_dup(killer->name); if (ch->platinum > 1 || ch->gold > 1 || ch->silver > 1) { - obj_to_obj(create_money(ch->platinum/2, ch->gold / 2, ch->silver/2), corpse); + silver = number_range( 0, ch->silver/3 ); + gold = number_range( 0, ch->gold/3 ); + platinum = number_range( 0, ch->platinum/3 ); + obj_to_obj(create_money((ch->platinum/2)-platinum, (ch->gold/2)-gold, (ch->silver/2)-silver), corpse); ch->platinum -= ch->platinum/2; ch->gold -= ch->gold/2; ch->silver -= ch->silver/2; + obj_to_room( create_money( platinum, gold, silver ), ch->in_room ); + act( "Some money spills across the floor.", ch, NULL, NULL, TO_ROOM ); + act( "Some of your money spills across the floor.", ch, NULL, NULL, TO_CHAR ); } } corpse->cost = 0; + } corpse->level = ch->level; sprintf( buf, corpse->short_descr, name ); - free_string( corpse->short_descr ); + free_string( corpse->short_descr, "fight.c/make_corpse #1" ); corpse->short_descr = str_dup( buf ); sprintf( buf, corpse->description, name ); - free_string( corpse->description ); + free_string( corpse->description, "fight.c/make_corpse #2" ); corpse->description = str_dup( buf ); + if (!IS_NPC(ch) && !IS_NPC(killer)) + { + wearloc = number_range(0, MAX_WEAR-1); + if ( ( obj = get_eq_char( ch, wearloc ) ) != NULL ) + { + if ((obj->wear_loc != WEAR_FLOAT) + && (obj->item_type != ITEM_PASSBOOK) + && (!obj->clan) + && (!obj->quest)) + { + obj_from_char( obj ); + obj_to_room(obj,ch->in_room); + act("$p falls to the floor.",ch,obj,NULL,TO_ROOM); + act("$p falls to the floor.",ch,obj,NULL,TO_CHAR); + } + } + wearloc = number_range(0, MAX_WEAR-1); + if ( ( obj = get_eq_char( ch, wearloc ) ) != NULL ) + { + if ((obj->wear_loc != WEAR_FLOAT) + && (obj->item_type != ITEM_PASSBOOK) + && (!obj->clan) + && (!obj->quest)) + { + obj_from_char( obj ); + obj_to_room(obj,ch->in_room); + act("$p falls to the floor.",ch,obj,NULL,TO_ROOM); + act("$p falls to the floor.",ch,obj,NULL,TO_CHAR); + } + } + wearloc = number_range(0, MAX_WEAR-1); + if ( ( obj = get_eq_char( ch, wearloc ) ) != NULL ) + { + if ((obj->wear_loc != WEAR_FLOAT) + && (obj->item_type != ITEM_PASSBOOK) + && (!obj->clan) + && (!obj->quest)) + { + obj_from_char( obj ); + obj_to_room(obj,ch->in_room); + act("$p falls to the floor.",ch,obj,NULL,TO_ROOM); + act("$p falls to the floor.",ch,obj,NULL,TO_CHAR); + } + } + } + for ( obj = ch->carrying; obj != NULL; obj = obj_next ) { bool floating = FALSE; obj_next = obj->next_content; + if (IS_OBJ_STAT(obj,ITEM_LQUEST) ) + continue; + if (obj->pIndexData->vnum == OBJ_VNUM_QPOUCH) + continue; if (obj->wear_loc == WEAR_FLOAT) floating = TRUE; obj_from_char( obj ); + if (IS_NPC(ch) && !IS_NPC(killer) && killer->pcdata->is_aquest) + { + obj->got_from = ch->pIndexData->vnum; + } else { + obj->got_from = 0; + } if (obj->item_type == ITEM_POTION) obj->timer = number_range(500,1000); if (obj->item_type == ITEM_SCROLL) @@ -2467,9 +2467,14 @@ } REMOVE_BIT(obj->extra_flags,ITEM_VIS_DEATH); - if ( IS_SET( obj->extra_flags, ITEM_INVENTORY ) ) + if ( obj->item_type == ITEM_PASSBOOK ) + { + change_banklist(ch, FALSE, obj->value[0], obj->value[1], 0, obj->name); extract_obj( obj ); - else if (floating) + } else if ( IS_SET( obj->extra_flags, ITEM_INVENTORY ) ) + { + extract_obj( obj ); + } else if (floating) { if (IS_OBJ_STAT(obj,ITEM_ROT_DEATH)) /* get rid of it! */ { @@ -2501,7 +2506,18 @@ obj_to_obj( obj, corpse ); } - obj_to_room( corpse, ch->in_room ); + if (!IS_NPC(ch)) + { + act("$p vanishes in a bright flash.",ch,corpse,NULL,TO_ROOM); + act("Your corpse vanishes in a bright flash.",ch,corpse,NULL,TO_CHAR); + if (ch->level < 20) + obj_to_room( corpse, get_room_index( ROOM_VNUM_MORGUE_SCHOOL ) ); + else + obj_to_room( corpse, get_room_index( home_table[ch->home].morgue )); + } else + { + obj_to_room( corpse, ch->in_room ); + } return; } @@ -2734,15 +2750,15 @@ } sprintf( buf, obj->short_descr, name ); - free_string( obj->short_descr ); + free_string( obj->short_descr, "fight.c/death_cry #1" ); obj->short_descr = str_dup( buf ); sprintf( buf, obj->description, name ); - free_string( obj->description ); + free_string( obj->description, "fight.c/death_cry #2" ); obj->description = str_dup( buf ); sprintf( buf, obj->name, name ); - free_string( obj->name ); + free_string( obj->name, "fight.c/death_cry #3" ); obj->name = str_dup( buf ); if (obj->item_type == ITEM_FOOD) @@ -2796,6 +2812,52 @@ stop_fighting( victim, TRUE ); make_corpse( victim, killer ); + if ( IS_NPC(victim) && !IS_NPC(killer)) + { + if ((killer->can_aquest == 2) && (victim->pIndexData->vnum == killer->pcdata->quest_mob)) + { + bool found = FALSE; + OBJ_DATA *object; + int level_vnum; + + level_vnum = ((killer->level/10) + 56); + for ( object = killer->carrying; object != NULL; object = object->next_content ) + { + if (IS_OBJ_STAT(object,ITEM_LQUEST) + && (object->pIndexData->vnum == level_vnum)) + found = TRUE; + } + if (!found) + { + char buf[MAX_INPUT_LENGTH]; + OBJ_DATA *obj; + OBJ_DATA *obj_next; + + sprintf(buf, "You quickly pick up the %s.\n\r", killer->pcdata->lquest_obj); + send_to_char(buf, killer); + object = create_object(get_obj_index(level_vnum), 0); + sprintf( buf, "%s", killer->pcdata->lquest_obj ); + free_string( object->short_descr, "fight.c/raw_kill #1" ); + object->short_descr = str_dup( buf ); + free_string( object->description, "fight.c/raw_kill #2" ); + object->description = str_dup( buf ); + free_string( object->name, "fight.c/raw_kill #3" ); + object->name = str_dup( buf ); + buf[0] = '\0'; + SET_BIT(object->extra_flags,ITEM_LQUEST); + for ( obj = killer->carrying; obj != NULL; obj = obj_next ) + { + obj_next = obj->next_content; + if (obj->pIndexData->vnum == OBJ_VNUM_QPOUCH) + { + obj_to_obj(object,obj); + break; + } + } + } + } + } + if ( IS_NPC(victim) ) { victim->pIndexData->killed++; @@ -2804,6 +2866,54 @@ return; } + do_mod_favor(victim, 4); + + if (killer->race == victim->race) + do_mod_favor(killer, 9); + + if (!IS_NPC(killer)) + { + if ( strcmp(killer->pcdata->socket, victim->pcdata->socket ) ) + { + do_mod_favor(killer, 5); + killer->pcdata->pkills++; + } + victim->pcdata->pdeath++; + if (!is_banklist( victim ) ) + { + int bank; + + bank = number_range(0, MAX_BANKS-1); + if ((number_range(1, 100) < 50) && victim->balance[bank]) + { + char buf[MAX_STRING_LENGTH]; + int amount; + int pwd; + OBJ_DATA *pbook; + EXTRA_DESCR_DATA *ed; + + amount = (number_range(1, 75) /100) * victim->balance[bank]; + pwd = number_range(1, 20000); + pbook = create_object(get_obj_index(OBJ_VNUM_PASSBOOK), 0); + sprintf( buf, "%s %s", capitalize(victim->name), pbook->name); + free_string( pbook->name, "fight.c/raw_kill #4" ); + pbook->name = str_dup( buf ); + sprintf(buf, "The passbook is covered with strange magical symbols that prevent your eyes\n\rfrom focusing on the inscriptions. Only the word {B%s{x is legible.\n\r", + capitalize(victim->name)); + ed = alloc_perm( sizeof(*ed) ); + ed->keyword = str_dup( "passbook" ); + ed->description = str_dup( buf ); + ed->next = pbook->extra_descr; + pbook->extra_descr = ed; + pbook->value[0] = bank; + pbook->value[1] = pwd; + pbook->value[2] = amount; + obj_to_char( pbook, killer ); + send_to_char("{RA passbook appears in your inventory!{x\n\r", killer); + change_banklist(killer, TRUE, bank, amount, pwd, victim->name); + } + } + } extract_char( victim, FALSE ); while ( victim->affected ) affect_remove( victim, victim->affected ); @@ -2811,11 +2921,10 @@ victim->shielded_by = race_table[victim->race].shd; for (i = 0; i < 4; i++) victim->armor[i]= 100; - victim->position = POS_RESTING; + victim->position = POS_STANDING; victim->hit = UMAX( 1, victim->hit ); victim->mana = UMAX( 1, victim->mana ); victim->move = UMAX( 1, victim->move ); -/* save_char_obj( victim ); we're stable enough to not need this :) */ return; } @@ -2881,6 +2990,8 @@ */ xp = xp_compute( gch, victim, group_levels ); + if (!IS_NPC(ch) && IS_SET(ch->act, PLR_LQUEST)) + xp = 0; sprintf( buf, "{BYou receive {W%d{B experience points.{x\n\r", xp ); send_to_char( buf, gch ); gain_exp( gch, xp ); @@ -2924,36 +3035,33 @@ if (!IS_NPC(gch)) { if (gch->class >= MAX_CLASS/2) - level_range -= 5; + level_range -= 4; + if (gch->pcdata->tier == 2) + level_range -= 1; } - if (!IS_NPC(gch) && !IS_NPC(victim)) - { - xp = 1; - return xp; - } /* compute the base exp */ switch (level_range) { default : base_exp = 0; break; case -9 : base_exp = 1; break; - case -8 : base_exp = 2; break; - case -7 : base_exp = 5; break; - case -6 : base_exp = 9; break; - case -5 : base_exp = 11; break; - case -4 : base_exp = 22; break; - case -3 : base_exp = 33; break; - case -2 : base_exp = 50; break; - case -1 : base_exp = 66; break; - case 0 : base_exp = 83; break; - case 1 : base_exp = 99; break; - case 2 : base_exp = 121; break; - case 3 : base_exp = 143; break; - case 4 : base_exp = 165; break; + case -8 : base_exp = 3; break; + case -7 : base_exp = 8; break; + case -6 : base_exp = 14; break; + case -5 : base_exp = 22; break; + case -4 : base_exp = 32; break; + case -3 : base_exp = 44; break; + case -2 : base_exp = 58; break; + case -1 : base_exp = 73; break; + case 0 : base_exp = 90; break; + case 1 : base_exp = 109; break; + case 2 : base_exp = 130; break; + case 3 : base_exp = 152; break; + case 4 : base_exp = 176; break; } if (level_range > 4) - base_exp = 160 + 20 * (level_range - 4); + base_exp = 176 + 24 * (level_range - 4); /* do alignment computations */ @@ -3104,14 +3212,18 @@ * xp = xp * time_per_level / 12; */ } - xp = xp*.75; - +/* xp = xp*.75; + */ /* randomize the rewards */ xp = number_range (xp * 3/4, xp * 5/4); /* adjust for grouping */ xp = xp * gch->level/( UMAX(1,total_levels -1) ); + if (!IS_NPC(gch) && !IS_NPC(victim)) + if (xp > 1) + xp = xp/2; + return xp; } @@ -3161,14 +3273,14 @@ { if (ch == victim) { - sprintf( buf1, "{k$n %s $melf%c{x",vp,punct); - sprintf( buf2, "{hYou %s yourself%c{x",vs,punct); + sprintf( buf1, "{k$n %s {k$melf%c{x",vp,punct); + sprintf( buf2, "{hYou %s {hyourself%c{x",vs,punct); } else { - sprintf( buf1, "{k$n %s $N%c{x", vp, punct ); - sprintf( buf2, "{hYou %s $N%c{x", vs, punct ); - sprintf( buf3, "{i$n %s you%c{x", vp, punct ); + sprintf( buf1, "{k$n %s {k$N%c {R[{k%d{R]{x", vp, punct, dam ); + sprintf( buf2, "{hYou %s {h$N%c {R[{h%d{R]{x", vs, punct, dam ); + sprintf( buf3, "{i$n %s {iyou%c {R[{i%d{R]{x", vp, punct, dam ); } } else @@ -3203,14 +3315,14 @@ { if (ch == victim) { - sprintf( buf1, "{k$n's %s %s $m%c{x",attack,vp,punct); - sprintf( buf2, "{hYour %s %s you%c{x",attack,vp,punct); + sprintf( buf1, "{k$n's %s %s {k$m%c{x",attack,vp,punct); + sprintf( buf2, "{hYour %s %s {kyou%c{x",attack,vp,punct); } else { - sprintf( buf1, "{k$n's %s %s $N%c{x", attack, vp, punct ); - sprintf( buf2, "{hYour %s %s $N%c{x", attack, vp, punct ); - sprintf( buf3, "{i$n's %s %s you%c{x", attack, vp, punct ); + sprintf( buf1, "{k$n's %s %s {k$N%c {R[{k%d{R]{x", attack, vp, punct, dam ); + sprintf( buf2, "{hYour %s %s {h$N%c {R[{h%d{R]{x", attack, vp, punct, dam ); + sprintf( buf3, "{i$n's %s %s {iyou%c {R[{i%d{R]{x", attack, vp, punct, dam ); } } } @@ -3243,6 +3355,13 @@ if ( ( obj = get_eq_char( victim, WEAR_WIELD ) ) == NULL ) return; + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } if ( IS_OBJ_STAT(obj,ITEM_NOREMOVE)) { act("{j$S weapon won't budge!{x",ch,NULL,victim,TO_CHAR); @@ -3279,8 +3398,23 @@ || (!IS_NPC(ch) && ch->level < skill_table[gsn_berserk].skill_level[ch->class])) { - send_to_char("{hYou turn {rred{h in the face, but nothing happens.{x\n\r",ch); - return; + if (IS_NPC(ch)) + { + send_to_char("{hYou turn {rred{h in the face, but nothing happens.{x\n\r",ch); + return; + } + if (ch->pcdata->tier != 2) + { + send_to_char("{hYou turn {rred{h in the face, but nothing happens.{x\n\r",ch); + return; + } else if (chance == 0 + || (IS_NPC(ch) && !IS_SET(ch->off_flags,OFF_BERSERK)) + || (!IS_NPC(ch) + && ch->level < skill_table[gsn_berserk].skill_level[ch->clasb])) + { + send_to_char("{hYou turn {rred{h in the face, but nothing happens.{x\n\r",ch); + return; + } } if (IS_AFFECTED(ch,AFF_BERSERK) || is_affected(ch,gsn_berserk) @@ -3324,6 +3458,13 @@ ch->hit += ch->level * 2; ch->hit = UMIN(ch->hit,ch->max_hit); + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } send_to_char("{hYour pulse races as you are consumed by {rrage!{x\n\r",ch); act("{k$n gets a {cw{gi{rl{yd{k look in $s eyes.{x",ch,NULL,NULL,TO_ROOM); check_improve(ch,gsn_berserk,TRUE,2); @@ -3448,6 +3589,13 @@ found = TRUE; + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } send_to_char( "You stick a pin into your voodoo doll.\n\r",ch); act( "$n sticks a pin into a voodoo doll.", ch, NULL, NULL, TO_ROOM ); send_to_char( "{RYou double over with a sudden pain in your gut!{x\n\r",wch); @@ -3513,6 +3661,13 @@ found = TRUE; + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } send_to_char( "You slam your voodoo doll against the ground.\n\r",ch); act( "$n slams a voodoo doll against the ground.", ch, NULL, NULL, TO_ROOM ); send_to_char( "{RYour feet slide out from under you!{x\n\r",wch); @@ -3583,6 +3738,13 @@ found = TRUE; + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } send_to_char( "You toss your voodoo doll into the air.\n\r",ch); act( "$n tosses a voodoo doll into the air.", ch, NULL, NULL, TO_ROOM ); af.where = TO_SHIELDS; @@ -3648,13 +3810,28 @@ one_argument(argument,arg); if ( (chance = get_skill(ch,gsn_bash)) == 0 - || (IS_NPC(ch) && !IS_SET(ch->off_flags,OFF_BASH)) - || (!IS_NPC(ch) - && ch->level < skill_table[gsn_bash].skill_level[ch->class])) - { + || (IS_NPC(ch) && !IS_SET(ch->off_flags,OFF_BASH))) + { send_to_char("Bashing? What's that?\n\r",ch); return; } + + if (!IS_NPC(ch)) + { + if (ch->pcdata->tier != 2) + { + if (ch->level < skill_table[gsn_bash].skill_level[ch->class]) + { + send_to_char("Bashing? What's that?\n\r",ch); + return; + } + } else if ( (ch->level < skill_table[gsn_bash].skill_level[ch->class]) + && (ch->level < skill_table[gsn_bash].skill_level[ch->clasb]) ) + { + send_to_char("Bashing? What's that?\n\r",ch); + return; + } + } if (arg[0] == '\0') { @@ -3713,6 +3890,13 @@ return; } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } if ( ( ch->fighting == NULL ) && ( !IS_NPC( ch ) ) && ( !IS_NPC( victim ) ) ) @@ -3759,19 +3943,19 @@ /* now the attack */ if (number_percent() < chance ) { - - act("{i$n sends you sprawling with a powerful bash!{x", - ch,NULL,victim,TO_VICT); + int dam; + + dam = number_range(2,2 + 2 * ch->size + chance/20); + act("{i$n sends you sprawling with a powerful bash!{x",ch,NULL,victim,TO_VICT); act("{hYou slam into $N, and send $M flying!{x",ch,NULL,victim,TO_CHAR); - act("{k$n sends $N sprawling with a powerful bash.{x", - ch,NULL,victim,TO_NOTVICT); + act("{k$n sends $N sprawling with a powerful bash.{x",ch,NULL,victim,TO_NOTVICT); check_improve(ch,gsn_bash,TRUE,1); DAZE_STATE(victim, 3 * PULSE_VIOLENCE); WAIT_STATE(ch,skill_table[gsn_bash].beats); victim->position = POS_RESTING; - damage(ch,victim,number_range(2,2 + 2 * ch->size + chance/20),gsn_bash, - DAM_BASH,FALSE); + damage(ch,victim,dam,gsn_bash, + DAM_BASH,TRUE); chance = (get_skill(ch,gsn_stun)/5); if (number_percent() < chance ) { @@ -3814,14 +3998,29 @@ one_argument(argument,arg); if ( (chance = get_skill(ch,gsn_dirt)) == 0 - || (IS_NPC(ch) && !IS_SET(ch->off_flags,OFF_KICK_DIRT)) - || (!IS_NPC(ch) - && ch->level < skill_table[gsn_dirt].skill_level[ch->class])) + || (IS_NPC(ch) && !IS_SET(ch->off_flags,OFF_KICK_DIRT))) { send_to_char("{hYou get your feet dirty.{x\n\r",ch); return; } + if (!IS_NPC(ch)) + { + if (ch->pcdata->tier != 2) + { + if (ch->level < skill_table[gsn_dirt].skill_level[ch->class]) + { + send_to_char("{hYou get your feet dirty.{x\n\r",ch); + return; + } + } else if ( (ch->level < skill_table[gsn_dirt].skill_level[ch->class]) + && (ch->level < skill_table[gsn_dirt].skill_level[ch->clasb]) ) + { + send_to_char("{hYou get your feet dirty.{x\n\r",ch); + return; + } + } + if (arg[0] == '\0') { victim = ch->fighting; @@ -3922,13 +4121,24 @@ return; } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } /* now the attack */ if (number_percent() < chance) { AFFECT_DATA af; + int dam; + + dam = number_range(2,5); + act("{k$n is blinded by the dirt in $s eyes!{x",victim,NULL,NULL,TO_ROOM); act("{i$n kicks dirt in your eyes!{x",ch,NULL,victim,TO_VICT); - damage(ch,victim,number_range(2,5),gsn_dirt,DAM_NONE,FALSE); + damage(ch,victim,dam,gsn_dirt,DAM_NONE,TRUE); send_to_char("{DYou can't see a thing!{x\n\r",victim); check_improve(ch,gsn_dirt,TRUE,2); WAIT_STATE(ch,skill_table[gsn_dirt].beats); @@ -3959,14 +4169,30 @@ one_argument(argument,arg); - if ( (chance = get_skill(ch,gsn_gouge)) == 0 - || (!IS_NPC(ch) - && ch->level < skill_table[gsn_gouge].skill_level[ch->class])) + + if ( (chance = get_skill(ch,gsn_gouge)) == 0 ) { - send_to_char("Gouge? What's that?{x\n\r",ch); + send_to_char("Gouge? What's that?\n\r",ch); return; } + if (!IS_NPC(ch)) + { + if (ch->pcdata->tier != 2) + { + if (ch->level < skill_table[gsn_gouge].skill_level[ch->class]) + { + send_to_char("Gouge? What's that?\n\r",ch); + return; + } + } else if ( (ch->level < skill_table[gsn_gouge].skill_level[ch->class]) + && (ch->level < skill_table[gsn_gouge].skill_level[ch->clasb]) ) + { + send_to_char("Gouge? What's that?\n\r",ch); + return; + } + } + if (arg[0] == '\0') { victim = ch->fighting; @@ -4018,6 +4244,13 @@ return; } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } if ( ( ch->fighting == NULL ) && ( !IS_NPC( ch ) ) && ( !IS_NPC( victim ) ) ) @@ -4049,9 +4282,13 @@ if (number_percent() < chance) { AFFECT_DATA af; + int dam; + + dam = number_range(2,8); + act("{k$n is blinded by a poke in the eyes!{x",victim,NULL,NULL,TO_ROOM); act("{i$n gouges at your eyes!{x",ch,NULL,victim,TO_VICT); - damage(ch,victim,number_range(2,5),gsn_gouge,DAM_NONE,FALSE); + damage(ch,victim,dam,gsn_gouge,DAM_NONE,TRUE); send_to_char("{DYou see nothing but stars!{x\n\r",victim); check_improve(ch,gsn_gouge,TRUE,2); WAIT_STATE(ch,skill_table[gsn_gouge].beats); @@ -4083,14 +4320,28 @@ one_argument(argument,arg); if ( (chance = get_skill(ch,gsn_trip)) == 0 - || (IS_NPC(ch) && !IS_SET(ch->off_flags,OFF_TRIP)) - || (!IS_NPC(ch) - && ch->level < skill_table[gsn_trip].skill_level[ch->class])) + || (IS_NPC(ch) && !IS_SET(ch->off_flags,OFF_TRIP))) { send_to_char("Tripping? What's that?\n\r",ch); return; } + if (!IS_NPC(ch)) + { + if (ch->pcdata->tier != 2) + { + if (ch->level < skill_table[gsn_trip].skill_level[ch->class]) + { + send_to_char("Tripping? What's that?\n\r",ch); + return; + } + } else if ( (ch->level < skill_table[gsn_trip].skill_level[ch->class]) + && (ch->level < skill_table[gsn_trip].skill_level[ch->clasb]) ) + { + send_to_char("Tripping? What's that?\n\r",ch); + return; + } + } if (arg[0] == '\0') { @@ -4137,17 +4388,24 @@ return; } - if (victim == ch) + if (IS_AFFECTED(ch,AFF_CHARM) && ch->master == victim) { - send_to_char("{hYou fall flat on your face!{x\n\r",ch); - WAIT_STATE(ch,2 * skill_table[gsn_trip].beats); - act("{k$n trips over $s own feet!{x",ch,NULL,NULL,TO_ROOM); + act("$N is your beloved master.",ch,NULL,victim,TO_CHAR); return; } - if (IS_AFFECTED(ch,AFF_CHARM) && ch->master == victim) + if (ch->shadow) { - act("$N is your beloved master.",ch,NULL,victim,TO_CHAR); + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } + if (victim == ch) + { + send_to_char("{hYou fall flat on your face!{x\n\r",ch); + WAIT_STATE(ch,2 * skill_table[gsn_trip].beats); + act("{k$n trips over $s own feet!{x",ch,NULL,NULL,TO_ROOM); return; } @@ -4182,6 +4440,10 @@ /* now the attack */ if (number_percent() < chance) { + int dam; + + dam = number_range(2, 2 + 2 * victim->size); + act("{i$n trips you and you go down!{x",ch,NULL,victim,TO_VICT); act("{hYou trip $N and $N goes down!{x",ch,NULL,victim,TO_CHAR); act("{k$n trips $N, sending $M to the ground.{x",ch,NULL,victim,TO_NOTVICT); @@ -4190,8 +4452,7 @@ DAZE_STATE(victim,2 * PULSE_VIOLENCE); WAIT_STATE(ch,skill_table[gsn_trip].beats); victim->position = POS_RESTING; - damage(ch,victim,number_range(2, 2 + 2 * victim->size),gsn_trip, - DAM_BASH,TRUE); + damage(ch,victim,dam,gsn_trip,DAM_BASH,TRUE); } else { @@ -4258,6 +4519,13 @@ return; } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } if ( ( ch->fighting == NULL ) && ( !IS_NPC( ch ) ) && ( !IS_NPC( victim ) ) ) @@ -4304,6 +4572,13 @@ return; } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } one_hit_mock( ch, victim, TYPE_UNDEFINED, FALSE ); return; @@ -4372,6 +4647,13 @@ return; } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } if ( ( ch->fighting == NULL ) && ( !IS_NPC( ch ) ) && ( !IS_NPC( victim ) ) ) @@ -4448,6 +4730,13 @@ return; } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } if ( ( ch->fighting == NULL ) && ( !IS_NPC( ch ) ) && ( !IS_NPC( victim ) ) ) @@ -4456,12 +4745,30 @@ victim->attacker = FALSE; } + if (get_skill(ch,gsn_backstab) == 0 && !IS_AWAKE(victim) ) + { + WAIT_STATE( ch, skill_table[gsn_backstab].beats ); + multi_hit( ch, victim, gsn_backstab ); + if (!IS_NPC(ch)) + do_mod_favor(ch, 1); + return; + } + if (ch->shadow && (ch->shadowing == victim)) + { + WAIT_STATE( ch, skill_table[gsn_backstab].beats ); + multi_hit( ch, victim, gsn_backstab ); + if (!IS_NPC(ch)) + do_mod_favor(ch, 1); + return; + } WAIT_STATE( ch, skill_table[gsn_backstab].beats ); if ( number_percent( ) < get_skill(ch,gsn_backstab) - || ( get_skill(ch,gsn_backstab) >= 2 && !IS_AWAKE(victim) ) ) + || ( get_skill(ch,gsn_backstab) >= 1 && !IS_AWAKE(victim) ) ) { check_improve(ch,gsn_backstab,TRUE,1); multi_hit( ch, victim, gsn_backstab ); + if (!IS_NPC(ch)) + do_mod_favor(ch, 1); } else { @@ -4476,15 +4783,31 @@ { CHAR_DATA *victim; OBJ_DATA *obj; - - if ( get_skill(ch,gsn_circle) == 0 - || (!IS_NPC(ch) - && ch->level < skill_table[gsn_circle].skill_level[ch->class])) - { - send_to_char("Circle? What's that?\n\r",ch); + int chance; + + if ( (chance = get_skill(ch,gsn_circle)) == 0 ) + { + send_to_char("Circle? What's that?\n\r",ch); return; } + if (!IS_NPC(ch)) + { + if (ch->pcdata->tier != 2) + { + if (ch->level < skill_table[gsn_circle].skill_level[ch->class]) + { + send_to_char("Circle? What's that?\n\r",ch); + return; + } + } else if ( (ch->level < skill_table[gsn_circle].skill_level[ch->class]) + && (ch->level < skill_table[gsn_circle].skill_level[ch->clasb]) ) + { + send_to_char("Circle? What's that?\n\r",ch); + return; + } + } + if ( ( victim = ch->fighting ) == NULL ) { send_to_char( "You aren't fighting anyone.\n\r", ch ); @@ -4525,6 +4848,8 @@ act( "{hYou circle around $N.{x", ch, NULL, victim, TO_CHAR); act( "{k$n circles around behind $N.{x", ch, NULL, victim, TO_NOTVICT); multi_hit( ch, victim, gsn_circle ); + if (!IS_NPC(ch)) + do_mod_favor(ch, 1); } else { @@ -4541,16 +4866,31 @@ void do_feed( CHAR_DATA *ch, char *argument ) { CHAR_DATA *victim; - int dam; - - if ( get_skill(ch,gsn_feed) == 0 - || (!IS_NPC(ch) - && ch->level < skill_table[gsn_feed].skill_level[ch->class])) - { - send_to_char("Feed? What's that?\n\r",ch); + int chance; + + if ( (chance = get_skill(ch,gsn_feed)) == 0 ) + { + send_to_char("Feed? What's that?\n\r",ch); return; } + if (!IS_NPC(ch)) + { + if (ch->pcdata->tier != 2) + { + if (ch->level < skill_table[gsn_feed].skill_level[ch->class]) + { + send_to_char("Feed? What's that?\n\r",ch); + return; + } + } else if ( (ch->level < skill_table[gsn_feed].skill_level[ch->class]) + && (ch->level < skill_table[gsn_feed].skill_level[ch->clasb]) ) + { + send_to_char("Feed? What's that?\n\r",ch); + return; + } + } + if ( ( victim = ch->fighting ) == NULL ) { send_to_char( "You aren't fighting anyone.\n\r", ch ); @@ -4574,12 +4914,15 @@ if ( number_percent( ) < get_skill(ch,gsn_feed)/3 || ( get_skill(ch,gsn_feed) >= 2 && !IS_AWAKE(victim) ) ) { + int dam; + + dam=number_range( (((ch->level/2)+(victim->level/2))/3), + (((ch->level/2)+(victim->level/2))/3)*2 ); + check_improve(ch,gsn_feed,TRUE,1); - act( "{i$n bites you.{x", ch, NULL, victim, TO_VICT); - act( "{hYou bite $N.{x", ch, NULL, victim, TO_CHAR); - act( "{k$n bites $N.{x", ch, NULL, victim, TO_NOTVICT); - dam=number_range( (((ch->level/2)+(victim->level/2))/3), - (((ch->level/2)+(victim->level/2))/3)*2 ); + act("{i$n bites you.{x",ch,NULL,victim,TO_VICT); + act("{hYou bite $N.{x",ch,NULL,victim,TO_CHAR); + act("{k$n bites $N.{x",ch,NULL,victim,TO_NOTVICT); damage( ch, victim, dam, gsn_feed,DAM_NEGATIVE,TRUE); } else @@ -4615,9 +4958,26 @@ { EXIT_DATA *pexit; int door; + int gdoor; door = number_door( ); - if ( ( pexit = was_in->exit[door] ) == 0 + if ( ( ( pexit = was_in->exit[door+6] ) != NULL ) + && ( ch->alignment < 0 ) ) + gdoor = door+6; + else + gdoor = door; + + if ( ( ( pexit = was_in->exit[gdoor] ) == NULL ) + || ( IS_SET( ch->in_room->room_flags, ROOM_CLAN_ENT ) ) ) + { + OBJ_DATA *portal; + + portal = get_obj_exit(dir_name[door], was_in->contents ); + if (portal == NULL) + { + continue; + } + } else if ( ( pexit = was_in->exit[gdoor] ) == 0 || pexit->u1.to_room == NULL || IS_SET(pexit->exit_info, EX_CLOSED) || number_range(0,ch->daze) != 0 @@ -4627,12 +4987,21 @@ move_char( ch, door, FALSE, FALSE ); if ( ( now_in = ch->in_room ) == was_in ) + { continue; + } ch->in_room = was_in; act( "$n has {Yfled{x!", ch, NULL, NULL, TO_ROOM ); if ( !IS_NPC(ch) ) { + if (!IS_NPC(victim)) + { + if (ch->attacker == FALSE) + ch->pcdata->dflee++; + else + ch->pcdata->aflee++; + } send_to_char( "{BYou {Yflee{B from combat!{x\n\r", ch ); if( ( (ch->class == 2) || (ch->class == (MAX_CLASS/2)+1) ) && (number_percent() < 3*(ch->level/2) ) ) @@ -4654,12 +5023,16 @@ act( "$n is {Yzapped{x in the butt by a lightning bolt from above!", ch, NULL, NULL, TO_ROOM ); ch->hit -= (ch->hit/4); } - send_to_char( "You lost 10 exp.\n\r", ch); - gain_exp( ch, -10 ); + if (!IS_NPC(ch) && !IS_SET(ch->act, PLR_LQUEST)) + { + send_to_char( "You lost 10 exp.\n\r", ch); + gain_exp( ch, -10 ); + } } } ch->in_room = now_in; stop_fighting( ch, TRUE ); + do_mod_favor(ch, 2); return; } @@ -4718,6 +5091,12 @@ return; } + if (ch->spirit) + { + send_to_char( "That's tough to do without flesh.\n\r", ch); + return; + } + WAIT_STATE( ch, skill_table[gsn_rescue].beats ); if ( number_percent( ) > get_skill(ch,gsn_rescue)) { @@ -4726,9 +5105,17 @@ return; } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } act( "{yYou rescue $N!{x", ch, NULL, victim, TO_CHAR ); act( "{y$n rescues you!{x", ch, NULL, victim, TO_VICT ); act( "{y$n rescues $N!{x", ch, NULL, victim, TO_NOTVICT ); + do_mod_favor(ch, 6); check_improve(ch,gsn_rescue,TRUE,1); stop_fighting( fch, FALSE ); @@ -4744,14 +5131,22 @@ void do_kick( CHAR_DATA *ch, char *argument ) { CHAR_DATA *victim; - int dam; - if ( !IS_NPC(ch) - && ch->level < skill_table[gsn_kick].skill_level[ch->class] ) + if ( !IS_NPC(ch) ) { - send_to_char( - "You better leave the martial arts to fighters.\n\r", ch ); - return; + if ((ch->pcdata->tier != 2) + && (ch->level < skill_table[gsn_kick].skill_level[ch->class])) + { + send_to_char("You better leave the martial arts to fighters.\n\r", ch ); + return; + } + if ((ch->pcdata->tier == 2) + && (ch->level < skill_table[gsn_kick].skill_level[ch->class]) + && (ch->level < skill_table[gsn_kick].skill_level[ch->clasb])) + { + send_to_char("You better leave the martial arts to fighters.\n\r", ch ); + return; + } } if (IS_NPC(ch) && !IS_SET(ch->off_flags,OFF_KICK)) @@ -4769,11 +5164,15 @@ return; } - dam = number_range( 1, ch->level ); WAIT_STATE( ch, skill_table[gsn_kick].beats ); if ( get_skill(ch,gsn_kick) > number_percent()) { - damage(ch,victim,number_range( dam, (ch->level*1.5) ), gsn_kick,DAM_BASH,TRUE); + int dam; + + dam = number_range( 1, ch->level ); + dam = number_range( dam, (ch->level*1.5) ); + + damage(ch,victim,dam, gsn_kick,DAM_BASH,TRUE); check_improve(ch,gsn_kick,TRUE,1); } else @@ -4858,10 +5257,30 @@ || (!IS_NPC(victim) && victim->level < skill_table[gsn_grip].skill_level[victim->class])) { - WAIT_STATE( ch, skill_table[gsn_disarm].beats ); - disarm( ch, victim ); - check_improve(ch,gsn_disarm,TRUE,1); - return; + if (chance == 0 || IS_NPC(victim)) + { + WAIT_STATE( ch, skill_table[gsn_disarm].beats ); + disarm( ch, victim ); + check_improve(ch,gsn_disarm,TRUE,1); + return; + } + if ((victim->pcdata->tier != 2) + && (victim->level < skill_table[gsn_grip].skill_level[victim->class])) + { + WAIT_STATE( ch, skill_table[gsn_disarm].beats ); + disarm( ch, victim ); + check_improve(ch,gsn_disarm,TRUE,1); + return; + } + if ((victim->pcdata->tier == 2) + && (victim->level < skill_table[gsn_grip].skill_level[victim->class]) + && (victim->level < skill_table[gsn_grip].skill_level[victim->clasb])) + { + WAIT_STATE( ch, skill_table[gsn_disarm].beats ); + disarm( ch, victim ); + check_improve(ch,gsn_disarm,TRUE,1); + return; + } } if (number_percent() > (chance/5)*4) { @@ -4921,6 +5340,13 @@ return; } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } if ( IS_NPC(victim) || get_trust(ch) >= CREATOR ) { act( "{hYou slay $M in cold blood!{x", ch, NULL, victim, TO_CHAR ); --- finger.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/finger.c Fri Aug 6 23:06:04 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) --- flags.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/flags.c Fri Aug 6 23:06:04 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -406,6 +404,18 @@ flag_table = part_flags; } + else if (!str_prefix(arg3,"off")) + { + if (!IS_NPC(victim)) + { + send_to_char("Offensive can't be set on PCs.\n\r",ch); + return; + } + + flag = &victim->off_flags; + flag_table = off_flags; + } + else if (!str_prefix(arg3,"comm")) { if (IS_NPC(victim)) --- forget.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/forget.c Sat Aug 14 20:31:11 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -64,8 +62,6 @@ if (IS_NPC(rch)) return; - smash_tilde( argument ); - argument = one_argument(argument,arg); if (arg[0] == '\0') @@ -210,7 +206,7 @@ if(!strcmp(arg,rch->pcdata->forget[pos])) { send_to_char("Forget removed.\n\r",ch); - free_string(rch->pcdata->forget[pos]); + free_string(rch->pcdata->forget[pos], "forget.c/do_remember"); rch->pcdata->forget[pos] = NULL; found = TRUE; } --- handler.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/handler.c Sun Aug 15 17:32:53 1999 @@ -1,34 +1,32 @@ -/**************************************************************************r - * 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* 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. * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * +***************************************************************************/ +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -243,6 +241,21 @@ return -1; } +/* returns a flag for levnet */ +long levnet_lookup (const char *name) +{ + int flag; + + for (flag = 0; levnet_table[flag].name != NULL; flag++) + { + if (LOWER(name[0]) == LOWER(levnet_table[flag].name[0]) + && !str_prefix(name,levnet_table[flag].name)) + return flag; + } + + return -1; +} + /* returns class number */ int class_lookup (const char *name) { @@ -261,6 +274,174 @@ return -1; } +int pk_range(CHAR_DATA *ch,CHAR_DATA *victim) +{ +/* + 0 = no pkill + 1 = ch attack victim only + 2 = common attack + 3 = victim attack ch only +*/ + + if (IS_NPC(ch) || IS_NPC(victim)) + return 0; + + if (ch == victim) + return 0; + + if (victim->in_room == NULL || ch->in_room == NULL) + return 0; + + if (ch->spirit || victim->spirit) + return 0; + + if ((IS_SET(victim->in_room->room_flags,ROOM_ARENA)) + && (IS_SET(ch->in_room->room_flags,ROOM_ARENA))) + return 2; + + if (IS_SET(victim->act,PLR_TWIT) ) + { + if (pk_rangerev(victim, ch)) + return 2; + else + return 1; + } + if (IS_SET(ch->act,PLR_TWIT) ) + { + if (pk_rangerev(ch, victim)) + return 2; + else + return 3; + } + if (((victim->level >19) + || ((victim->class >= MAX_CLASS/2) + && (victim->level > 14))) + && (is_voodood(ch, victim) ) ) + { + if (pk_rangerev(victim, ch)) + return 1; + else + return 2; + } + if (((ch->level >19) + || ((ch->class >= MAX_CLASS/2) + && (ch->level > 14))) + && (is_voodood(victim, ch) ) ) + { + if (pk_rangerev(ch, victim)) + return 2; + else + return 3; + } + if (ch->on_quest || victim->on_quest) + return 0; + + if (!is_clan(ch) || !is_clan(victim)) + return 0; + + if (!is_pkill(ch) || !is_pkill(victim)) + return 0; + + if (is_same_clan(ch,victim)) + return 0; + + if ( ( ( ch->pcdata->tier == 2 ) + && ( victim->pcdata->tier == 2 ) ) + || ( ( ch->pcdata->tier == 1 ) + && ( victim->pcdata->tier == 1 ) ) + || ( ( ch->pcdata->tier == 0 ) + && ( victim->pcdata->tier == 0 ) ) ) + { + if (ch->level > victim->level + 20) + return 0; + if (victim->level > ch->level + 20) + return 0; + if (ch->level >= victim->level) + { + if (ch->level <= victim->level + 10) + return 2; + else + return 3; + } + if (victim->level >= ch->level) + { + if (victim->level <= ch->level + 10) + return 2; + else + return 1; + } + } + + if ( ( ch->pcdata->tier == 2 ) + && ( victim->pcdata->tier == 0 ) ) + return 0; + + if ( ( ch->pcdata->tier == 0 ) + && ( victim->pcdata->tier == 2 ) ) + return 0; + + if ( ( ( ch->pcdata->tier == 1 ) + && ( victim->pcdata->tier == 0 ) ) + || ( ( ch->pcdata->tier == 2 ) + && ( victim->pcdata->tier == 1 ) ) ) + { + if (victim->level > ch->level + 30) + return 0; + if (victim->level < ch->level - 10) + return 0; + if ( (victim->level <= ch->level + 20) + && (victim->level >= ch->level) ) + return 2; + if (victim->level > ch->level + 20) + return 1; + if (victim->level >= ch->level - 10) + return 3; + return 0; + } + + if (victim->level > ch->level + 10) + return 0; + if (victim->level < ch->level - 30) + return 0; + if ( (victim->level <= ch->level) + && (victim->level >= ch->level - 20) ) + return 2; + if (victim->level < ch->level - 20) + return 3; + if (victim->level <= ch->level + 10) + return 1; + return 0; +} + +bool pk_rangerev(CHAR_DATA *ch,CHAR_DATA *victim) +{ + if (IS_NPC(ch) || IS_NPC(victim)) + return FALSE; + + if (IS_SET(victim->act,PLR_TWIT) ) + return TRUE; + + if (((victim->level >19) + || ((victim->class >= MAX_CLASS/2) + && (victim->level > 14))) + && (is_voodood(ch, victim) ) ) + return TRUE; + + if (ch->on_quest || victim->on_quest) + return FALSE; + + if (!is_clan(ch) || !is_clan(victim)) + return FALSE; + + if (!is_pkill(ch) || !is_pkill(victim)) + return FALSE; + + if (is_same_clan(ch,victim)) + return FALSE; + + return TRUE; +} + /* for immunity, vulnerabiltiy, and resistant the 'globals' (magic and weapons) may be overriden three other cases -- wood, silver, and iron -- are checked in fight.c */ @@ -371,7 +552,13 @@ bool is_class_obj(OBJ_DATA *obj) { - return obj->class; + GUILD_DATA *guild; + + for (guild = obj->pIndexData->guild; guild != NULL; guild = guild->next) + { + return TRUE; + } + return FALSE; } bool clan_can_use(CHAR_DATA *ch, OBJ_DATA *obj) @@ -386,9 +573,19 @@ bool class_can_use(CHAR_DATA *ch, OBJ_DATA *obj) { + GUILD_DATA *guild; + if (!is_class_obj(obj)) return TRUE; - return (ch->class == obj->class); + + for (guild = obj->pIndexData->guild; guild != NULL; guild = guild->next) + { + if (ch->class == guild->guild) + return TRUE; + if (!IS_NPC(ch) && (ch->pcdata->tier == 2) && (ch->clasb == guild->guild) ) + return TRUE; + } + return FALSE; } /* checks mob format */ @@ -419,10 +616,19 @@ else if (!IS_NPC(ch)) { - if (ch->level < skill_table[sn].skill_level[ch->class]) - skill = 0; - else - skill = ch->pcdata->learned[sn]; + if (ch->pcdata->tier != 2) + { + if (ch->level < skill_table[sn].skill_level[ch->class]) + skill = 0; + else + skill = ch->pcdata->learned[sn]; + } else { + if ((ch->level < skill_table[sn].skill_level[ch->class]) + && (ch->level < skill_table[sn].skill_level[ch->clasb])) + skill = 0; + else + skill = ch->pcdata->learned[sn]; + } } else /* mobiles */ @@ -630,11 +836,12 @@ ch->pcdata->perm_move = ch->max_move; ch->pcdata->last_level = ch->played/3600; if (ch->pcdata->true_sex < 0 || ch->pcdata->true_sex > 2) + { if (ch->sex > 0 && ch->sex < 3) ch->pcdata->true_sex = ch->sex; else ch->pcdata->true_sex = 0; - + } } /* now restore the character to his/her true condition */ @@ -807,6 +1014,9 @@ if (class_table[ch->class].attr_prime == stat) max += 2; + if ( (ch->pcdata->tier == 2) && (class_table[ch->clasb].attr_prime == stat) ) + max += 1; + if ( ch->race == race_lookup("human")) max += 1; @@ -826,10 +1036,14 @@ max = pc_race_table[ch->race].max_stats[stat]; if (class_table[ch->class].attr_prime == stat) + { if (ch->race == race_lookup("human")) max += 3; else max += 2; + } + if ( (ch->pcdata->tier == 2) && (class_table[ch->clasb].attr_prime == stat) ) + max += 1; return UMIN(max,25); } @@ -1206,6 +1420,7 @@ paf_new = new_affect(); *paf_new = *paf; + VALIDATE(paf); paf_new->next = ch->affected; ch->affected = paf_new; @@ -1221,6 +1436,7 @@ paf_new = new_affect(); *paf_new = *paf; + VALIDATE(paf); paf_new->next = obj->affected; obj->affected = paf_new; @@ -1780,6 +1996,7 @@ obj->wear_loc = -1; if (!obj->enchanted) + { for ( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) if ( paf->location == APPLY_SPELL_AFFECT ) { @@ -1824,7 +2041,7 @@ affect_modify( ch, paf, FALSE ); affect_check(ch,paf->where,paf->bitvector); } - + } if ( obj->item_type == ITEM_LIGHT && obj->value[2] != 0 && ch->in_room != NULL @@ -2088,17 +2305,20 @@ extract_obj( obj ); } - char_from_room( ch ); - /* Death room is set in the clan table now */ if ( !fPull ) { +/* if ((clan_table[ch->clan].hall == ROOM_VNUM_ALTAR) && ch->alignment < 0) char_to_room(ch,get_room_index(ROOM_VNUM_ALTARB)); else char_to_room(ch,get_room_index(clan_table[ch->clan].hall)); +*/ + ch->spirit = 1; return; + } else { + char_from_room( ch ); } if ( IS_NPC(ch) ) @@ -2205,6 +2425,33 @@ return NULL; } +/* + * Find a char in the world. Name must match exact. + */ +CHAR_DATA *get_exact_world( CHAR_DATA *ch, char *argument ) +{ + char arg[MAX_INPUT_LENGTH]; + CHAR_DATA *wch; + int number; + int count; + + if ( ( wch = get_char_room( ch, argument ) ) != NULL ) + return wch; + + number = number_argument( argument, arg ); + count = 0; + for ( wch = char_list; wch != NULL ; wch = wch->next ) + { + if ( wch->in_room == NULL || !can_see( ch, wch ) + || str_cmp( arg, wch->name ) ) + continue; + if ( ++count == number ) + return wch; + } + + return NULL; +} + /* * Find a char in the world, no level check. @@ -2559,13 +2806,23 @@ char buf[MAX_STRING_LENGTH]; OBJ_DATA *obj; - if ( platinum < 0 || gold < 0 || silver < 0 - || (platinum == 0 && gold == 0 && silver == 0) ) + if ( platinum < 0 || gold < 0 || silver < 0 ) { - bug( "Create_money: zero or negative money.",UMIN(UMIN(platinum,gold),silver)); - platinum = UMAX(1,platinum); - gold = UMAX(1,gold); - silver = UMAX(1,silver); + bug( "Create_money: negative money.",UMIN(UMIN(platinum,gold),silver)); + platinum = UMAX(0,platinum); + gold = UMAX(0,gold); + silver = UMAX(0,silver); + } + + if (platinum == 0 && gold == 0 && silver == 0) + { + obj = create_object( get_obj_index( OBJ_VNUM_COINS ), 0 ); + obj->value[0] = silver; + obj->value[1] = gold; + obj->value[2] = platinum; + obj->cost = 0; + obj->weight = 0; + return obj; } if (platinum == 0 && gold == 0 && silver == 1) @@ -2584,31 +2841,31 @@ { obj = create_object( get_obj_index( OBJ_VNUM_PLATINUM_SOME ), 0 ); sprintf( buf, obj->short_descr, platinum ); - free_string( obj->short_descr ); + free_string( obj->short_descr, "handler.c/create_money #1" ); obj->short_descr = str_dup( buf ); obj->value[2] = platinum; obj->cost = platinum; - obj->weight = platinum/20; + obj->weight = platinum * 3 / 5; } else if (platinum == 0 && silver == 0) { obj = create_object( get_obj_index( OBJ_VNUM_GOLD_SOME ), 0 ); sprintf( buf, obj->short_descr, gold ); - free_string( obj->short_descr ); + free_string( obj->short_descr, "handler.c/create_money #2" ); obj->short_descr = str_dup( buf ); obj->value[1] = gold; obj->cost = gold; - obj->weight = gold/20; + obj->weight = gold * 2 / 5; } else if (platinum == 0 && gold == 0) { obj = create_object( get_obj_index( OBJ_VNUM_SILVER_SOME ), 0 ); sprintf( buf, obj->short_descr, silver ); - free_string( obj->short_descr ); + free_string( obj->short_descr, "handler.c/create_money #3" ); obj->short_descr = str_dup( buf ); obj->value[0] = silver; obj->cost = silver; - obj->weight = silver/20; + obj->weight = silver/10; } else @@ -2618,7 +2875,7 @@ obj->value[1] = gold; obj->value[2] = platinum; obj->cost = (10000 * platinum) + (100 * gold) + silver; - obj->weight = (platinum + gold + silver)/20; + obj->weight = (platinum * 3 / 5)+(gold * 2 / 5)+(silver / 10); } return obj; @@ -2765,12 +3022,60 @@ && ch->level > 9 && !IS_HERO(ch)) return FALSE; - if (!IS_IMMORTAL(ch) && pRoomIndex->clan && ch->clan != pRoomIndex->clan) + if (!IS_IMMORTAL(ch) && pRoomIndex->clan && !ch->clan) return FALSE; return TRUE; } +/* visibility on an exit */ +bool can_see_door( CHAR_DATA *ch, long exit_info ) +{ + if (IS_NPC(ch)) + return TRUE; + + if (IS_IMMORTAL(ch) && IS_SET(ch->act,PLR_HOLYLIGHT)) + return TRUE; + + if (IS_SET(exit_info, EX_MAGIC) + && !IS_AFFECTED(ch, AFF_DETECT_MAGIC)) + return FALSE; + + if (IS_SET(exit_info, EX_INVIS) + && !IS_AFFECTED(ch, AFF_DETECT_INVIS)) + return FALSE; + + if (IS_SET(exit_info, EX_FLY) + && !IS_AFFECTED(ch, AFF_FLYING)) + return FALSE; + + if (IS_SET(exit_info, EX_SWIM) + && !IS_AFFECTED(ch, AFF_FLYING)) + { + OBJ_DATA *obj; + bool found; + + found = FALSE; + + if (IS_IMMORTAL(ch)) + found = TRUE; + + for ( obj = ch->carrying; obj != NULL; obj = obj->next_content ) + { + if ( obj->item_type == ITEM_BOAT ) + { + found = TRUE; + break; + } + } + if ( !found ) + { + return FALSE; + } + } + + return TRUE; +} /* @@ -2835,6 +3140,10 @@ if ( obj->item_type == ITEM_EXIT) return FALSE; + if ( obj->item_type == ITEM_PORTAL + && !can_see_door(ch, (long)obj->value[1]) ) + return FALSE; + if ( !IS_NPC(ch) && IS_SET(ch->act, PLR_HOLYLIGHT) ) return TRUE; @@ -2858,7 +3167,11 @@ && !IS_AFFECTED(ch, AFF_DETECT_HIDDEN) ) return FALSE; - if ( room_is_dark( ch->in_room ) && !IS_AFFECTED(ch, AFF_INFRARED) ) + if ( room_is_dark( ch->in_room ) && !IS_AFFECTED(ch, AFF_DARK_VISION) ) + return FALSE; + + if ( obj->item_type == ITEM_CORPSE_PC && str_cmp(obj->owner, ch->name) + && !IS_IMMORTAL(ch)) return FALSE; return TRUE; @@ -2871,7 +3184,8 @@ */ bool can_drop_obj( CHAR_DATA *ch, OBJ_DATA *obj ) { - if ( !IS_SET(obj->extra_flags, ITEM_NODROP) ) + if ( !IS_SET(obj->extra_flags, ITEM_NODROP) + && !IS_SET(obj->extra_flags, ITEM_LQUEST) ) return TRUE; if ( !IS_NPC(ch) && ch->level >= LEVEL_IMMORTAL ) @@ -2885,7 +3199,7 @@ /* * Return ascii name of an item type. */ -char *item_type_name( OBJ_DATA *obj ) +char *item_type_name( OBJ_INDEX_DATA *obj ) { switch ( obj->item_type ) { @@ -2919,6 +3233,7 @@ case ITEM_DEMON_STONE: return "demon stone"; case ITEM_EXIT: return "exit"; case ITEM_PIT: return "pit"; + case ITEM_PASSBOOK: return "passbook"; } bug( "Item_type_name: unknown type %d.", obj->item_type ); @@ -3056,6 +3371,7 @@ if ( extra_flags & ITEM_QUEST ) strcat( buf, " quest" ); if ( extra_flags & ITEM_FORCED ) strcat( buf, " forced" ); if ( extra_flags & ITEM_QUESTPOINT ) strcat( buf, " questpoint" ); + if ( extra_flags & ITEM_LQUEST ) strcat( buf, " levelquest" ); return ( buf[0] != '\0' ) ? buf+1 : "none"; } @@ -3090,7 +3406,7 @@ if (act_flags & ACT_IS_HEALER ) strcat(buf, " healer"); if (act_flags & ACT_IS_SATAN ) strcat(buf, " evil_priest"); if (act_flags & ACT_IS_PRIEST ) strcat(buf, " priest"); - if (act_flags & ACT_IS_CHANGER ) strcat(buf, " changer"); + if (act_flags & ACT_IS_BANKER ) strcat(buf, " banker"); if (act_flags & ACT_NO_BODY ) strcat(buf, " no_body"); if (act_flags & ACT_NB_DROP ) strcat(buf, " nobd_drop"); if (act_flags & ACT_GAIN ) strcat(buf, " skill_train"); @@ -3111,6 +3427,7 @@ if (act_flags & PLR_NOSUMMON ) strcat(buf, " no_summon"); if (act_flags & PLR_NOFOLLOW ) strcat(buf, " no_follow"); if (act_flags & PLR_NOTRAN ) strcat(buf, " no_transport"); + if (act_flags & PLR_NOCANCEL ) strcat(buf, " no_cancel"); if (act_flags & PLR_FREEZE ) strcat(buf, " frozen"); if (act_flags & PLR_TWIT ) strcat(buf, " twit"); } @@ -3225,6 +3542,7 @@ if (room_flags & ROOM_HEROES_ONLY ) strcat(buf, " heroes"); if (room_flags & ROOM_NEWBIES_ONLY ) strcat(buf, " newbies"); if (room_flags & ROOM_LAW ) strcat(buf, " law"); + if (room_flags & ROOM_CLAN_ENT ) strcat(buf, " clan_ent"); if (room_flags & ROOM_NOWHERE ) strcat(buf, " nowhere"); if (room_flags & ROOM_LOCKED ) strcat(buf, " locked"); @@ -3342,6 +3660,7 @@ if (off_flags & OFF_DODGE ) strcat(buf, " dodge"); if (off_flags & OFF_FADE ) strcat(buf, " fade"); if (off_flags & OFF_FAST ) strcat(buf, " fast"); + if (off_flags & OFF_FEED ) strcat(buf, " feed"); if (off_flags & OFF_KICK ) strcat(buf, " kick"); if (off_flags & OFF_KICK_DIRT ) strcat(buf, " kick_dirt"); if (off_flags & OFF_PARRY ) strcat(buf, " parry"); @@ -3349,6 +3668,7 @@ if (off_flags & OFF_TAIL ) strcat(buf, " tail"); if (off_flags & OFF_TRIP ) strcat(buf, " trip"); if (off_flags & OFF_CRUSH ) strcat(buf, " crush"); + if (off_flags & OFF_CLAN_GUARD ) strcat(buf, " clan_guard"); if (off_flags & ASSIST_ALL ) strcat(buf, " assist_all"); if (off_flags & ASSIST_ALIGN ) strcat(buf, " assist_align"); if (off_flags & ASSIST_RACE ) strcat(buf, " assist_race"); --- healer.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/healer.c Fri Aug 6 23:06:04 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -175,7 +173,7 @@ if (cost > ((ch->platinum * 10000) + (ch->gold * 100) + ch->silver)) { - act("$N says '{aYou do not have enough gold for my services.{x'", + act("$N says '{aYou do not have enough money for my services.{x'", ch,NULL,mob,TO_CHAR); return; } --- interp.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/interp.c Sat Aug 14 20:31:11 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -95,7 +93,7 @@ { "get", do_get, POS_RESTING, 0, 1, LOG_NORMAL, 1 }, { "goto", do_goto, POS_DEAD, IM, 1, LOG_NORMAL, 1 }, { "group", do_group, POS_SLEEPING, 0, 1, LOG_NORMAL, 1 }, - { "guild", do_guild, POS_DEAD, L2, 1, LOG_ALWAYS, 1 }, + { "guild", do_guild, POS_DEAD, L3, 1, LOG_ALWAYS, 1 }, { "hit", do_kill, POS_FIGHTING, 0, 1, LOG_NORMAL, 0 }, { "inventory", do_inventory, POS_DEAD, 0, 1, LOG_NORMAL, 1 }, { "kill", do_kill, POS_FIGHTING, 0, 1, LOG_NORMAL, 1 }, @@ -106,13 +104,14 @@ { "order", do_order, POS_RESTING, 0, 1, LOG_NORMAL, 1 }, { "practice", do_practice, POS_SLEEPING, 0, 1, LOG_NORMAL, 1 }, { "rest", do_rest, POS_SLEEPING, 0, 1, LOG_NORMAL, 1 }, + { "run", do_run, POS_STANDING, 0, 1, LOG_NEVER, 1 }, { "sit", do_sit, POS_SLEEPING, 0, 1, LOG_NORMAL, 1 }, { "sockets", do_sockets, POS_DEAD, IM, 1, LOG_NORMAL, 1 }, { "stand", do_stand, POS_SLEEPING, 0, 1, LOG_NORMAL, 1 }, { "tell", do_tell, POS_SLEEPING, 0, 1, LOG_NORMAL, 1 }, { "unlock", do_unlock, POS_RESTING, 0, 1, LOG_NORMAL, 1 }, { "wield", do_wear, POS_RESTING, 0, 1, LOG_NORMAL, 1 }, - { "wizhelp", do_wizhelp, POS_DEAD, 0, 2, LOG_NORMAL, 1 }, + { "wizhelp", do_wizhelp, POS_DEAD, IM, 1, LOG_NORMAL, 1 }, /* * Informational commands. @@ -180,11 +179,13 @@ { "noloot", do_noloot, POS_DEAD, 0, 1, LOG_NORMAL, 1 }, { "nosummon", do_nosummon, POS_DEAD, 0, 1, LOG_NORMAL, 1 }, { "notran", do_notran, POS_DEAD, 0, 1, LOG_NORMAL, 1 }, + { "nocancel", do_nocancel, POS_DEAD, 0, 1, LOG_NORMAL, 1 }, { "outfit", do_outfit, POS_RESTING, 0, 1, LOG_NORMAL, 1 }, { "password", do_password, POS_DEAD, 0, 1, LOG_NEVER, 1 }, { "prompt", do_prompt, POS_DEAD, 0, 1, LOG_NORMAL, 1 }, { "scroll", do_scroll, POS_DEAD, 0, 1, LOG_NORMAL, 1 }, { "title", do_title, POS_DEAD, 0, 1, LOG_NORMAL, 1 }, + { "titlelock", do_titlelock, POS_DEAD, 0, 1, LOG_NORMAL, 1 }, { "unalias", do_unalias, POS_DEAD, 0, 1, LOG_NORMAL, 1 }, { "wimpy", do_wimpy, POS_DEAD, 0, 1, LOG_NORMAL, 1 }, @@ -209,9 +210,11 @@ { "gtell", do_gtell, POS_DEAD, 0, 1, LOG_NORMAL, 1 }, { ";", do_gtell, POS_DEAD, 0, 1, LOG_NORMAL, 0 }, /* { "music", do_music, POS_SLEEPING, 0, 1, LOG_NORMAL, 1 }, */ + { "mud", do_mud, POS_SLEEPING, 0, 1, LOG_NORMAL, 1 }, { "note", do_note, POS_SLEEPING, 0, 1, LOG_NORMAL, 1 }, { "pose", do_pose, POS_RESTING, 0, 1, LOG_NORMAL, 1 }, { "quest", do_quest, POS_SLEEPING, 0, 1, LOG_NORMAL, 1 }, + { "aquest", do_aquest, POS_RESTING, 0, 1, LOG_NORMAL, 1 }, { "ask", do_ask, POS_SLEEPING, 0, 1, LOG_NORMAL, 1 }, { "quote", do_quote, POS_SLEEPING, 0, 1, LOG_NORMAL, 1 }, { "quiet", do_quiet, POS_SLEEPING, 0, 1, LOG_NORMAL, 1 }, @@ -236,6 +239,7 @@ { "fill", do_fill, POS_RESTING, 0, 1, LOG_NORMAL, 1 }, { "give", do_give, POS_RESTING, 0, 1, LOG_NORMAL, 1 }, { "heal", do_heal, POS_RESTING, 0, 1, LOG_NORMAL, 1 }, + { "inscribe", do_inscribe, POS_RESTING, HE, 1, LOG_NORMAL, 1 }, { "repent", do_repent, POS_RESTING, 0, 1, LOG_NORMAL, 1 }, { "curse", do_curse, POS_RESTING, 0, 1, LOG_NORMAL, 1 }, { "hold", do_wear, POS_RESTING, 0, 1, LOG_NORMAL, 1 }, @@ -248,6 +252,7 @@ { "quaff", do_quaff, POS_RESTING, 0, 1, LOG_NORMAL, 1 }, { "recite", do_recite, POS_RESTING, 0, 1, LOG_NORMAL, 1 }, { "remove", do_remove, POS_RESTING, 0, 1, LOG_NORMAL, 1 }, + { "rob", do_rob, POS_STANDING, 0, 1, LOG_NORMAL, 1 }, { "sell", do_sell, POS_RESTING, 0, 1, LOG_NORMAL, 1 }, { "second", do_second, POS_RESTING, 0, 1, LOG_NORMAL, 1 }, { "take", do_get, POS_RESTING, 0, 1, LOG_NORMAL, 1 }, @@ -295,6 +300,7 @@ { "quit", do_quit, POS_DEAD, 0, 1, LOG_NORMAL, 1 }, { "recall", do_recall, POS_FIGHTING, 0, 1, LOG_NORMAL, 1 }, { "/", do_recall, POS_FIGHTING, 0, 1, LOG_NORMAL, 0 }, + { "rename", do_rename, POS_DEAD, L4, 1, LOG_NORMAL, 1 }, { "rent", do_rent, POS_DEAD, 0, 1, LOG_NORMAL, 0 }, { "save", do_save, POS_DEAD, 0, 1, LOG_NORMAL, 1 }, { "sleep", do_sleep, POS_SLEEPING, 0, 1, LOG_NORMAL, 1 }, @@ -306,6 +312,7 @@ { "visible", do_visible, POS_SLEEPING, 0, 1, LOG_NORMAL, 1 }, { "wake", do_wake, POS_SLEEPING, 0, 1, LOG_NORMAL, 1 }, { "where", do_where, POS_RESTING, 0, 1, LOG_NORMAL, 1 }, + { "deposit", do_deposit, POS_STANDING, 0, 1, LOG_NORMAL, 1 }, { "donate", do_donate, POS_STANDING, 5, 1, LOG_NORMAL, 1 }, { "cdonate", do_cdonate, POS_STANDING, 5, 1, LOG_NORMAL, 1 }, { "class", do_class, POS_SLEEPING, 0, 1, LOG_NORMAL, 1 }, @@ -314,12 +321,21 @@ { "remembe", do_remembe, POS_SLEEPING, 0, 1, LOG_NORMAL, 0 }, { "remember", do_remember, POS_SLEEPING, 0, 1, LOG_NORMAL, 1 }, { "voodoo", do_voodoo, POS_STANDING, 20, 1, LOG_NORMAL, 1 }, + { "withdraw", do_withdraw, POS_STANDING, 0, 1, LOG_NORMAL, 1 }, + /* + * Deity commands. + */ + { "devote", do_devote, POS_STANDING, 10, 1, LOG_NORMAL, 1 }, + { "supplicate", do_supplicate, POS_STANDING, 10, 1, LOG_NORMAL, 1 }, + { "deity", do_deities, POS_STANDING, 10, 1, LOG_NORMAL, 1 }, /* * Immortal commands. */ - { "advance", do_advance, POS_DEAD, ML, 1, LOG_ALWAYS, 1 }, + { "advance", do_advance, POS_DEAD, HE, 1, LOG_NORMAL, 1 }, + { "chlevel", do_chlevel, POS_DEAD, ML, 1, LOG_ALWAYS, 1 }, + { "authorize", do_authorize, POS_DEAD, IM, 1, LOG_NORMAL, 1 }, { "dump", do_dump, POS_DEAD, ML, 1, LOG_ALWAYS, 0 }, { "trust", do_trust, POS_DEAD, ML, 1, LOG_ALWAYS, 1 }, { "violate", do_violate, POS_DEAD, ML, 1, LOG_ALWAYS, 1 }, @@ -330,13 +346,13 @@ { "disconnect", do_disconnect, POS_DEAD, L3, 1, LOG_ALWAYS, 1 }, { "dupe", do_dupe, POS_DEAD, L1, 1, LOG_NORMAL, 1 }, { "finger", do_finger, POS_DEAD, 0, 1, LOG_NORMAL, 1 }, - { "flag", do_flag, POS_DEAD, L2, 1, LOG_ALWAYS, 1 }, + { "flag", do_flag, POS_DEAD, L3, 1, LOG_ALWAYS, 1 }, { "freeze", do_freeze, POS_DEAD, L4, 1, LOG_ALWAYS, 1 }, { "permban", do_permban, POS_DEAD, L1, 1, LOG_ALWAYS, 1 }, { "protect", do_protect, POS_DEAD, L1, 1, LOG_ALWAYS, 1 }, { "reboo", do_reboo, POS_DEAD, L1, 1, LOG_NORMAL, 0 }, { "reboot", do_reboot, POS_DEAD, L1, 1, LOG_ALWAYS, 1 }, - { "set", do_set, POS_DEAD, L2, 1, LOG_NORMAL, 1 }, + { "set", do_set, POS_DEAD, L3, 1, LOG_NORMAL, 1 }, { "shutdow", do_shutdow, POS_DEAD, ML, 1, LOG_NORMAL, 0 }, { "shutdown", do_shutdown, POS_DEAD, ML, 1, LOG_ALWAYS, 1 }, /* { "sockets", do_sockets, POS_DEAD, IM, 1, LOG_NORMAL, 1 }, */ @@ -344,6 +360,8 @@ { "wizlock", do_wizlock, POS_DEAD, L2, 1, LOG_ALWAYS, 1 }, { "force", do_force, POS_DEAD, L7, 1, LOG_NORMAL, 1 }, + { "forcedelet", do_forcedelet, POS_DEAD, L2, 1, LOG_NORMAL, 0 }, + { "forcedelete", do_forcedelete, POS_DEAD, L2, 1, LOG_ALWAYS, 1 }, { "load", do_load, POS_DEAD, L6, 1, LOG_NORMAL, 1 }, { "newlock", do_newlock, POS_DEAD, L1, 1, LOG_ALWAYS, 1 }, { "nochannels", do_nochannels, POS_DEAD, L6, 1, LOG_ALWAYS, 1 }, @@ -354,6 +372,7 @@ { "notell", do_notell, POS_DEAD, L5, 1, LOG_ALWAYS, 1 }, { "notitle", do_notitle, POS_DEAD, L3, 1, LOG_ALWAYS, 1 }, { "pack", do_pack, POS_DEAD, 0, 2, LOG_NORMAL, 1 }, + { "levnet", do_levnet, POS_DEAD, 0, 2, LOG_NORMAL, 1 }, { "pecho", do_pecho, POS_DEAD, L5, 1, LOG_NORMAL, 1 }, { "purge", do_purge, POS_DEAD, IM, 1, LOG_NORMAL, 1 }, { "restore", do_restore, POS_DEAD, L4, 1, LOG_NORMAL, 1 }, @@ -362,12 +381,14 @@ { "teleport", do_transfer, POS_DEAD, L6, 1, LOG_NORMAL, 1 }, { "transfer", do_transfer, POS_DEAD, L6, 1, LOG_NORMAL, 1 }, { "corner", do_corner, POS_DEAD, IM, 1, LOG_ALWAYS, 1 }, + { "match", do_arena, POS_DEAD, IM, 1, LOG_NORMAL, 1 }, { "twit", do_twit, POS_DEAD, L7, 1, LOG_NORMAL, 1 }, { "pardon", do_pardon, POS_DEAD, L7, 1, LOG_NORMAL, 1 }, /* { "at", do_at, POS_DEAD, L6, 1, LOG_NORMAL, 1 }, */ { "poofin", do_bamfin, POS_DEAD, L8, 1, LOG_NORMAL, 1 }, { "poofout", do_bamfout, POS_DEAD, L8, 1, LOG_NORMAL, 1 }, + { "ftick", do_ftick, POS_DEAD, ML, 1, LOG_NORMAL, 1 }, { "gecho", do_echo, POS_DEAD, L4, 1, LOG_NORMAL, 1 }, /* { "goto", do_goto, POS_DEAD, L8, 1, LOG_NORMAL, 1 }, */ { "ghost", do_ghost, POS_DEAD, IM, 1, LOG_NORMAL, 1 }, @@ -395,7 +416,7 @@ { "clone", do_clone, POS_DEAD, L6, 1, LOG_NORMAL, 1 }, - { "wiznet", do_wiznet, POS_DEAD, 0, 2, LOG_NORMAL, 1 }, + { "wiznet", do_wiznet, POS_DEAD, IM, 1, LOG_NORMAL, 1 }, { "immtalk", do_immtalk, POS_DEAD, IM, 1, LOG_NORMAL, 1 }, { "imotd", do_imotd, POS_DEAD, IM, 1, LOG_NORMAL, 1 }, { ":", do_immtalk, POS_DEAD, IM, 1, LOG_NORMAL, 0 }, @@ -417,11 +438,13 @@ /* * Commands needed last on list */ + { "lone", do_lone, POS_DEAD, 15, 1, LOG_NORMAL, 0 }, + { "loner", do_loner, POS_STANDING, 15, 1, LOG_NORMAL, 1 }, { "restring", do_restring, POS_STANDING, 0, 1, LOG_NORMAL, 1 }, { "delet", do_delet, POS_DEAD, 0, 1, LOG_NORMAL, 0 }, { "delete", do_delete, POS_STANDING, 0, 1, LOG_NORMAL, 1 }, { "rerol", do_rerol, POS_DEAD, 0, 2, LOG_NORMAL, 0 }, - { "reroll", do_reroll, POS_STANDING, 0, 2, LOG_NORMAL, 1 }, + { "reroll", do_reroll, POS_STANDING, 1, 1, LOG_NORMAL, 1 }, /* * End of list. @@ -430,8 +453,6 @@ }; - - /* * The main entry point for executing commands. * Can be recursively called from 'at', 'order', 'force'. @@ -502,15 +523,29 @@ && !str_prefix( command, cmd_table[cmd].name ) && cmd_table[cmd].level <= trust ) { + if (IS_NPC(ch)) + { + found = TRUE; + break; + } if (cmd_table[cmd].tier == 1) { found = TRUE; break; - } else if (ch->class >= MAX_CLASS/2) + } + if ((cmd_table[cmd].tier == 2) && ((ch->pcdata->tier >= 1) + || (IS_HERO(ch)))) { found = TRUE; break; - } else if (ch->level >= LEVEL_HERO) + } + if ((cmd_table[cmd].tier == 3) && (ch->pcdata->tier == 2)) + { + found = TRUE; + break; + } + if ((cmd_table[cmd].tier == 3) && (ch->pcdata->tier == 1) + && (IS_HERO(ch))) { found = TRUE; break; @@ -656,6 +691,13 @@ } + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } one_argument( argument, arg ); victim = NULL; if ( arg[0] == '\0' ) @@ -827,23 +869,37 @@ col = 0; for ( cmd = 0; cmd_table[cmd].name[0] != '\0'; cmd++ ) { - if ( cmd_table[cmd].level < LEVEL_HERO + if ( cmd_table[cmd].level < LEVEL_IMMORTAL && cmd_table[cmd].level <= get_trust( ch ) && cmd_table[cmd].show) { - if (cmd_table[cmd].tier == 1) + if (IS_NPC(ch)) + { + sprintf( buf, "%-12s", cmd_table[cmd].name ); + send_to_char( buf, ch ); + if ( ++col % 6 == 0 ) + send_to_char( "\n\r", ch ); + } else if (cmd_table[cmd].tier == 1) + { + sprintf( buf, "%-12s", cmd_table[cmd].name ); + send_to_char( buf, ch ); + if ( ++col % 6 == 0 ) + send_to_char( "\n\r", ch ); + } else if ((cmd_table[cmd].tier == 2) && ((ch->pcdata->tier >= 1) + || (IS_HERO(ch)))) { sprintf( buf, "%-12s", cmd_table[cmd].name ); send_to_char( buf, ch ); if ( ++col % 6 == 0 ) send_to_char( "\n\r", ch ); - } else if (ch->class >= MAX_CLASS/2) + } else if ((cmd_table[cmd].tier == 3) && (ch->pcdata->tier == 2)) { sprintf( buf, "%-12s", cmd_table[cmd].name ); send_to_char( buf, ch ); if ( ++col % 6 == 0 ) send_to_char( "\n\r", ch ); - } else if (ch->level >= LEVEL_HERO) + } else if ((cmd_table[cmd].tier == 3) && (ch->pcdata->tier == 1) + && (IS_HERO(ch))) { sprintf( buf, "%-12s", cmd_table[cmd].name ); send_to_char( buf, ch ); @@ -872,11 +928,8 @@ } for ( cmd = 0; cmd_table[cmd].name[0] != '\0'; cmd++ ) { - if ( (cmd_table[cmd].level >= LEVEL_HERO + if ( (cmd_table[cmd].level >= LEVEL_IMMORTAL && cmd_table[cmd].level <= get_trust( ch ) - && cmd_table[cmd].show ) - || ( ( cmd_table[cmd].tier == 2 ) - && ( cmd_table[cmd].level <= get_trust( ch ) ) && cmd_table[cmd].show ) ) { --- interp.h Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/interp.h Sat Aug 14 20:31:11 1999 @@ -1,35 +1,32 @@ - /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ /* this is a listing of all the commands and command related data */ @@ -42,9 +39,9 @@ #define L4 MAX_LEVEL - 4 /* god */ #define L5 MAX_LEVEL - 5 /* immortal */ #define L6 MAX_LEVEL - 6 /* demigod */ -#define L7 MAX_LEVEL - 7 /* angel */ -#define L8 MAX_LEVEL - 8 /* avatar */ -#define IM LEVEL_IMMORTAL /* angel */ +#define L7 MAX_LEVEL - 7 /* knight */ +#define L8 MAX_LEVEL - 8 /* squire */ +#define IM LEVEL_IMMORTAL /* squire */ #define HE LEVEL_HERO /* hero */ #define COM_INGORE 1 @@ -55,13 +52,13 @@ */ struct cmd_type { - char * const name; - DO_FUN * do_fun; - sh_int position; - sh_int level; - sh_int tier; - sh_int log; - sh_int show; + char * const name; /* command entered */ + DO_FUN * do_fun; /* the do function */ + sh_int position; /* minimum required position */ + sh_int level; /* minimum required level of char */ + sh_int tier; /* which tier? 1, 2, or 3 */ + sh_int log; /* log type */ + sh_int show; /* show in commands? 1=yes 0=no */ }; /* the command table itself */ @@ -79,10 +76,13 @@ DECLARE_DO_FUN( do_allow ); DECLARE_DO_FUN( do_allpeace ); DECLARE_DO_FUN( do_answer ); +DECLARE_DO_FUN( do_aquest ); DECLARE_DO_FUN( do_areas ); +DECLARE_DO_FUN( do_arena ); DECLARE_DO_FUN( do_ask ); DECLARE_DO_FUN( do_at ); DECLARE_DO_FUN( do_auction ); +DECLARE_DO_FUN( do_authorize ); DECLARE_DO_FUN( do_autoassist ); DECLARE_DO_FUN( do_autoexit ); DECLARE_DO_FUN( do_autogold ); @@ -107,6 +107,7 @@ DECLARE_DO_FUN( do_cgossip ); DECLARE_DO_FUN( do_changes ); DECLARE_DO_FUN( do_channels ); +DECLARE_DO_FUN( do_chlevel ); DECLARE_DO_FUN( do_circle ); DECLARE_DO_FUN( do_class ); DECLARE_DO_FUN( do_clead ); @@ -123,10 +124,13 @@ DECLARE_DO_FUN( do_credits ); DECLARE_DO_FUN( do_curse ); DECLARE_DO_FUN( do_deaf ); +DECLARE_DO_FUN( do_deities ); DECLARE_DO_FUN( do_delet ); DECLARE_DO_FUN( do_delete ); DECLARE_DO_FUN( do_deny ); +DECLARE_DO_FUN( do_deposit ); DECLARE_DO_FUN( do_description ); +DECLARE_DO_FUN( do_devote ); DECLARE_DO_FUN( do_dirt ); DECLARE_DO_FUN( do_disarm ); DECLARE_DO_FUN( do_disconnect ); @@ -152,9 +156,12 @@ DECLARE_DO_FUN( do_flee ); DECLARE_DO_FUN( do_follow ); DECLARE_DO_FUN( do_force ); +DECLARE_DO_FUN( do_forcedelet ); +DECLARE_DO_FUN( do_forcedelete ); DECLARE_DO_FUN( do_forge ); DECLARE_DO_FUN( do_forget ); DECLARE_DO_FUN( do_freeze ); +DECLARE_DO_FUN( do_ftick ); DECLARE_DO_FUN( do_gain ); DECLARE_DO_FUN( do_get ); DECLARE_DO_FUN( do_ghost ); @@ -178,15 +185,19 @@ DECLARE_DO_FUN( do_clantalk ); DECLARE_DO_FUN( do_immkiss ); DECLARE_DO_FUN( do_imotd ); +DECLARE_DO_FUN( do_inscribe ); DECLARE_DO_FUN( do_inventory ); DECLARE_DO_FUN( do_invis ); DECLARE_DO_FUN( do_kick ); DECLARE_DO_FUN( do_kill ); DECLARE_DO_FUN( do_knight ); +DECLARE_DO_FUN( do_levnet ); DECLARE_DO_FUN( do_list ); DECLARE_DO_FUN( do_load ); DECLARE_DO_FUN( do_lock ); DECLARE_DO_FUN( do_log ); +DECLARE_DO_FUN( do_lone ); +DECLARE_DO_FUN( do_loner ); DECLARE_DO_FUN( do_long ); DECLARE_DO_FUN( do_look ); DECLARE_DO_FUN( do_member ); @@ -200,11 +211,13 @@ DECLARE_DO_FUN( do_motd ); DECLARE_DO_FUN( do_mpoint ); DECLARE_DO_FUN( do_mquest ); +DECLARE_DO_FUN( do_mud ); DECLARE_DO_FUN( do_murde ); DECLARE_DO_FUN( do_murder ); DECLARE_DO_FUN( do_music ); DECLARE_DO_FUN( do_newlock ); DECLARE_DO_FUN( do_news ); +DECLARE_DO_FUN( do_nocancel ); DECLARE_DO_FUN( do_nochannels ); DECLARE_DO_FUN( do_noclan ); DECLARE_DO_FUN( do_noemote ); @@ -264,6 +277,7 @@ DECLARE_DO_FUN( do_remembe ); DECLARE_DO_FUN( do_remember ); DECLARE_DO_FUN( do_remove ); +DECLARE_DO_FUN( do_rename ); DECLARE_DO_FUN( do_rent ); DECLARE_DO_FUN( do_repent ); DECLARE_DO_FUN( do_replay ); @@ -276,9 +290,11 @@ DECLARE_DO_FUN( do_restring ); DECLARE_DO_FUN( do_restore ); DECLARE_DO_FUN( do_return ); +DECLARE_DO_FUN( do_rob ); DECLARE_DO_FUN( do_rset ); DECLARE_DO_FUN( do_rstat ); DECLARE_DO_FUN( do_rules ); +DECLARE_DO_FUN( do_run ); DECLARE_DO_FUN( do_sacrifice ); DECLARE_DO_FUN( do_save ); DECLARE_DO_FUN( do_say ); @@ -314,10 +330,12 @@ DECLARE_DO_FUN( do_steal ); DECLARE_DO_FUN( do_story ); DECLARE_DO_FUN( do_string ); +DECLARE_DO_FUN( do_supplicate ); DECLARE_DO_FUN( do_switch ); DECLARE_DO_FUN( do_tell ); DECLARE_DO_FUN( do_time ); DECLARE_DO_FUN( do_title ); +DECLARE_DO_FUN( do_titlelock ); DECLARE_DO_FUN( do_track ); DECLARE_DO_FUN( do_train ); DECLARE_DO_FUN( do_transfer ); @@ -350,6 +368,7 @@ DECLARE_DO_FUN( do_whois ); DECLARE_DO_FUN( do_wimpy ); DECLARE_DO_FUN( do_wipe ); +DECLARE_DO_FUN( do_withdraw ); DECLARE_DO_FUN( do_wizhelp ); DECLARE_DO_FUN( do_wizlock ); DECLARE_DO_FUN( do_wizlist ); --- lookup.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/lookup.c Fri Aug 6 23:06:04 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -67,6 +65,20 @@ } return 0; +} + +int home_lookup(const char * name) +{ + int home; + + for (home = 0; home_table[home].name != NULL; home++) + { + if (LOWER(name[0]) == LOWER(home_table[home].name[0]) + && !str_prefix(name,home_table[home].name)) + return home; + } + + return 0; } int position_lookup (const char *name) --- lookup.h Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/lookup.h Fri Aug 6 23:06:04 1999 @@ -1,38 +1,36 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ - int clan_lookup args( (const char *name) ); +int home_lookup args( (const char *name) ); int position_lookup args( (const char *name) ); int sex_lookup args( (const char *name) ); int size_lookup args( (const char *name) ); --- magic2.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/magic2.c Fri Aug 6 23:06:04 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -44,6 +42,8 @@ #include "magic.h" #include "tables.h" +/* command procedures needed */ +DECLARE_DO_FUN(do_look ); extern char *target_name; @@ -119,6 +119,12 @@ return; } + if (global_quest && IS_NPC(victim) && victim->on_quest) + { + 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)) @@ -226,20 +232,44 @@ int newmana; int newtarget; - if ( ( new_sn = find_spell( ch,target_name ) ) < 0 - || ( !IS_NPC(ch) && (ch->level < skill_table[new_sn].skill_level[ch->class] - || ch->pcdata->learned[new_sn] == 0))) + if ( ( new_sn = find_spell( ch,target_name ) ) < 0 ) { send_to_char( "What spell do you wish to bind?\n\r", ch ); return; } + if ( !IS_NPC(ch) ) + { + if (ch->pcdata->learned[new_sn] == 0) + { + send_to_char( "What spell do you wish to bind?\n\r", ch ); + return; + } + if (ch->pcdata->tier != 2) + { + if (ch->level < skill_table[new_sn].skill_level[ch->class]) + { + send_to_char( "What spell do you wish to bind?\n\r", ch ); + return; + } + } else if ((ch->level < skill_table[new_sn].skill_level[ch->class]) + && (ch->level < skill_table[new_sn].skill_level[ch->clasb])) + { + send_to_char( "What spell do you wish to bind?\n\r", ch ); + return; + } + } name = skill_table[new_sn].name; if (!strcmp(name, "empower") ) { send_to_char( "You failed.\n\r", ch ); return; } + if (skill_table[new_sn].spell_fun == spell_null) + { + send_to_char( "That's not a spell.\n\r", ch ); + return; + } newtarget = skill_table[new_sn].target; if (ch->level + 2 == skill_table[sn].skill_level[ch->class]) mana = 50; @@ -248,6 +278,18 @@ skill_table[sn].min_mana, 100 / ( 2 + ch->level - skill_table[sn].skill_level[ch->class] ) ); + if (!IS_NPC(ch) && (ch->pcdata->tier == 2)) + { + if ((ch->level + 2 == skill_table[sn].skill_level[ch->class]) + || ( ch->level + 2 == skill_table[sn].skill_level[ch->clasb])) + mana = 50; + else + mana = UMAX( + skill_table[sn].min_mana, + 100 / ( 2 + ch->level - UMIN(skill_table[sn].skill_level[ch->class] , + skill_table[sn].skill_level[ch->clasb]) ) ); + } + if (ch->level + 2 == skill_table[new_sn].skill_level[ch->class]) newmana = 50; else @@ -255,6 +297,18 @@ skill_table[new_sn].min_mana, 100 / ( 2 + ch->level - skill_table[new_sn].skill_level[ch->class] ) ); + if (!IS_NPC(ch) && (ch->pcdata->tier == 2)) + { + if ((ch->level + 2 == skill_table[new_sn].skill_level[ch->class]) + || ( ch->level + 2 == skill_table[new_sn].skill_level[ch->clasb])) + newmana = 50; + else + newmana = UMAX( + skill_table[new_sn].min_mana, + 100 / ( 2 + ch->level - UMIN(skill_table[new_sn].skill_level[ch->class] , + skill_table[new_sn].skill_level[ch->clasb]) ) ); + } + if ( (ch->mana - mana - newmana) < 0) { send_to_char( "You do not have enough mana.\n\r", ch ); @@ -274,8 +328,12 @@ object->value[1] = new_sn; object->level = ch->level-5; + sprintf( buf, "%s %s", object->name, name); + free_string(object->name, "magic2.c/spell_empower #1"); + object->name = str_dup(buf); + sprintf( buf, "%s%s", object->short_descr, name); - free_string(object->short_descr); + free_string(object->short_descr, "magic2.c/spell_empower #2"); object->short_descr = str_dup(buf); if ((newtarget == TAR_CHAR_DEFENSIVE) || (newtarget == TAR_CHAR_SELF)) @@ -326,16 +384,16 @@ pet->comm = COMM_NOTELL|COMM_NOSHOUT|COMM_NOCHANNELS; sprintf( buf, "%s{GThe mark of %s is on it's forehead.{x.\n\r", pet->description, ch->name ); - free_string( pet->description ); + free_string( pet->description, "magic2.c/spell_resurrect #1" ); pet->description = str_dup( buf ); - free_string( pet->short_descr ); + free_string( pet->short_descr, "magic2.c/spell_resurrect #2" ); pet->short_descr = str_dup( str_replace(obj->short_descr, "corpse", "zombie") ); sprintf( buf, "%s", str_replace(obj->description, "corpse", "zombie") ); length = strlen(buf)-12; strncpy( arg, buf, length); arg[length] = '\0'; sprintf( buf, "%s standing here.\n\r", arg); - free_string( pet->long_descr ); + free_string( pet->long_descr, "magic2.c/spell_resurrect #3" ); pet->long_descr = str_dup( buf ); char_to_room( pet, ch->in_room ); add_follower( pet, ch ); @@ -343,12 +401,84 @@ ch->pet = pet; pet->alignment = ch->alignment; pet->level = UMAX(1, UMIN(109, ((ch->level/2)+(obj->level/2)))); - pet->max_hit = pet->level * 15; + pet->max_hit = dice(moblev_table[pet->level].hpdice, + moblev_table[pet->level].hpsides) + + moblev_table[pet->level].hpbonus; pet->hit = pet->max_hit; - pet->armor[0] = pet->level/6; - pet->armor[1] = pet->level/6; - pet->armor[2] = pet->level/6; - pet->armor[3] = pet->level/8; + pet->max_mana = dice(moblev_table[pet->level].hpdice, + moblev_table[pet->level].hpsides) + + moblev_table[pet->level].hpbonus; + pet->mana = pet->max_mana; + pet->damroll = moblev_table[pet->level].dambonus; + pet->damage[DICE_NUMBER] = moblev_table[pet->level].damdice; + pet->damage[DICE_TYPE] = moblev_table[pet->level].damsides; + + pet->armor[0] = moblev_table[pet->level].mobac * 10; + pet->armor[1] = moblev_table[pet->level].mobac * 10; + pet->armor[2] = moblev_table[pet->level].mobac * 10; + pet->armor[3] = (moblev_table[pet->level].mobac + 4) * 10; + { + int i; + + for (i = 0; i < MAX_STATS; i ++) + pet->perm_stat[i] = UMIN(25,11 + pet->level/4); + + if (IS_SET(pet->act,ACT_WARRIOR)) + { + pet->perm_stat[STAT_STR] += 3; + pet->perm_stat[STAT_INT] -= 1; + pet->perm_stat[STAT_CON] += 2; + } + + if (IS_SET(pet->act,ACT_THIEF)) + { + pet->perm_stat[STAT_DEX] += 3; + pet->perm_stat[STAT_INT] += 1; + pet->perm_stat[STAT_WIS] -= 1; + } + + if (IS_SET(pet->act,ACT_CLERIC)) + { + pet->perm_stat[STAT_WIS] += 3; + pet->perm_stat[STAT_DEX] -= 1; + pet->perm_stat[STAT_STR] += 1; + } + + if (IS_SET(pet->act,ACT_MAGE)) + { + pet->perm_stat[STAT_INT] += 3; + pet->perm_stat[STAT_STR] -= 1; + pet->perm_stat[STAT_DEX] += 1; + } + + if (IS_SET(pet->act,ACT_RANGER)) + { + pet->perm_stat[STAT_STR] += 3; + pet->perm_stat[STAT_CON] -= 1; + pet->perm_stat[STAT_INT] += 1; + } + + if (IS_SET(pet->act,ACT_DRUID)) + { + pet->perm_stat[STAT_WIS] += 3; + pet->perm_stat[STAT_STR] -= 1; + pet->perm_stat[STAT_DEX] += 1; + } + + if (IS_SET(pet->act,ACT_VAMPIRE)) + { + pet->perm_stat[STAT_CON] += 3; + pet->perm_stat[STAT_STR] += 1; + pet->perm_stat[STAT_WIS] -= 1; + } + + if (IS_SET(pet->off_flags,OFF_FAST)) + pet->perm_stat[STAT_DEX] += 2; + + pet->perm_stat[STAT_STR] += pet->size - SIZE_MEDIUM; + pet->perm_stat[STAT_CON] += (pet->size - SIZE_MEDIUM) / 2; + } + for ( cobj = obj->contains; cobj != NULL; cobj = obj_next ) { obj_next = cobj->next_content; @@ -409,8 +539,104 @@ pet->comm = COMM_NOTELL|COMM_NOSHOUT|COMM_NOCHANNELS; sprintf( buf, "%s{GThe mark of %s is on it's forehead.{x.\n\r", pet->description, ch->name ); - free_string( pet->description ); + free_string( pet->description, "magic2.c/spell_conjure #1" ); pet->description = str_dup( buf ); + if (!str_cmp(class_table[ch->class].name,"lich")) + { + sprintf(buf, "The skeletal warrior follows its master.\n\r{GThe mark of %s is on it's forehead.{x.\n\r", + ch->name ); + free_string( pet->description, "magic2.c/spell_conjure #2" ); + pet->description = str_dup( buf ); + sprintf(buf, "skeletal warrior undead pet"); + free_string( pet->name, "magic2.c/spell_conjure #3" ); + pet->name = str_dup( buf ); + sprintf(buf, "A demon is standing here.\n\r"); + free_string( pet->short_descr, "magic2.c/spell_conjure #4" ); + pet->short_descr = str_dup( buf ); + } + +/* Set the demon to casters level-15 and recalculate the dice rolls */ + pet->level = UMAX(0,ch->level - 15); + pet->max_hit = dice(moblev_table[pet->level].hpdice, + moblev_table[pet->level].hpsides) + + moblev_table[pet->level].hpbonus; + pet->hit = pet->max_hit; + pet->max_mana = dice(moblev_table[pet->level].hpdice, + moblev_table[pet->level].hpsides) + + moblev_table[pet->level].hpbonus; + pet->mana = pet->max_mana; + pet->damroll = moblev_table[pet->level].dambonus; + pet->damage[DICE_NUMBER] = moblev_table[pet->level].damdice; + pet->damage[DICE_TYPE] = moblev_table[pet->level].damsides; + + pet->armor[0] = moblev_table[pet->level].mobac * 10; + pet->armor[1] = moblev_table[pet->level].mobac * 10; + pet->armor[2] = moblev_table[pet->level].mobac * 10; + pet->armor[3] = (moblev_table[pet->level].mobac + 4) * 10; + +/* Now reset the demons stats */ + { + int i; + + for (i = 0; i < MAX_STATS; i ++) + pet->perm_stat[i] = UMIN(25,11 + pet->level/4); + + if (IS_SET(pet->act,ACT_WARRIOR)) + { + pet->perm_stat[STAT_STR] += 3; + pet->perm_stat[STAT_INT] -= 1; + pet->perm_stat[STAT_CON] += 2; + } + + if (IS_SET(pet->act,ACT_THIEF)) + { + pet->perm_stat[STAT_DEX] += 3; + pet->perm_stat[STAT_INT] += 1; + pet->perm_stat[STAT_WIS] -= 1; + } + + if (IS_SET(pet->act,ACT_CLERIC)) + { + pet->perm_stat[STAT_WIS] += 3; + pet->perm_stat[STAT_DEX] -= 1; + pet->perm_stat[STAT_STR] += 1; + } + + if (IS_SET(pet->act,ACT_MAGE)) + { + pet->perm_stat[STAT_INT] += 3; + pet->perm_stat[STAT_STR] -= 1; + pet->perm_stat[STAT_DEX] += 1; + } + + if (IS_SET(pet->act,ACT_RANGER)) + { + pet->perm_stat[STAT_STR] += 3; + pet->perm_stat[STAT_CON] -= 1; + pet->perm_stat[STAT_INT] += 1; + } + + if (IS_SET(pet->act,ACT_DRUID)) + { + pet->perm_stat[STAT_WIS] += 3; + pet->perm_stat[STAT_STR] -= 1; + pet->perm_stat[STAT_DEX] += 1; + } + + if (IS_SET(pet->act,ACT_VAMPIRE)) + { + pet->perm_stat[STAT_CON] += 3; + pet->perm_stat[STAT_STR] += 1; + pet->perm_stat[STAT_WIS] -= 1; + } + + if (IS_SET(pet->off_flags,OFF_FAST)) + pet->perm_stat[STAT_DEX] += 2; + + pet->perm_stat[STAT_STR] += pet->size - SIZE_MEDIUM; + pet->perm_stat[STAT_CON] += (pet->size - SIZE_MEDIUM) / 2; + + } char_to_room( pet, ch->in_room ); if (stone != NULL && stone->item_type == ITEM_DEMON_STONE) { @@ -463,18 +689,18 @@ pet->comm = COMM_NOTELL|COMM_NOSHOUT|COMM_NOCHANNELS; sprintf( buf, "%s{GIt's branded with the mark of %s.{x.\n\r", obj->description, ch->name ); - free_string( pet->description ); + free_string( pet->description, "magic2.c/spell_animate #1" ); pet->description = str_dup( buf ); - free_string( pet->short_descr ); + free_string( pet->short_descr, "magic2.c/spell_animate #2" ); pet->short_descr = str_dup( obj->short_descr ); - free_string( pet->name ); + free_string( pet->name, "magic2.c/spell_animate #3" ); pet->name = str_dup( obj->name ); sprintf( buf, "%s", obj->description); length = strlen(buf)-12; strncpy( arg, buf, length); arg[length] = '\0'; sprintf( buf, "%s floating here.\n\r", arg); - free_string( pet->long_descr ); + free_string( pet->long_descr, "magic2.c/spell_animate #4" ); pet->long_descr = str_dup( buf ); char_to_room( pet, ch->in_room ); add_follower( pet, ch ); @@ -491,6 +717,7 @@ { CHAR_DATA *victim = (CHAR_DATA *) vo; AFFECT_DATA af; + int duration; if (IS_SHIELDED(victim, SHD_ICE)) { @@ -507,22 +734,44 @@ return; } -/* - if ( (skill_table[sn].skill_level[victim->class] > LEVEL_HERO) - && (victim->level < LEVEL_IMMORTAL) ) + duration = level/6; + + if (!IS_IMMORTAL(victim)) { - 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; + bool found = TRUE; + + if (skill_table[sn].skill_level[victim->class] > LEVEL_HERO) + { + duration = level/12; + found = FALSE; + } + if (victim->pcdata->tier == 2) + { + if (skill_table[sn].skill_level[victim->clasb] > LEVEL_HERO) + { + if (found) + { + duration = level/6; + } else + { + duration = level/12; + } + } else { + if (found) + { + duration = level/3; + } else + { + duration = level/6; + } + } + } } -*/ af.where = TO_SHIELDS; af.type = sn; af.level = level; - af.duration = level/6; + af.duration = duration; af.location = APPLY_NONE; af.modifier = 0; af.bitvector = SHD_ICE; @@ -538,6 +787,7 @@ CHAR_DATA *victim = (CHAR_DATA *) vo; AFFECT_DATA af; + int duration; if (IS_SHIELDED(victim, SHD_FIRE)) { @@ -554,22 +804,44 @@ return; } -/* - if ( (skill_table[sn].skill_level[victim->class] > LEVEL_HERO) - && (victim->level < LEVEL_IMMORTAL) ) + duration = level/6; + + if (!IS_IMMORTAL(victim)) { - 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; + bool found = TRUE; + + if (skill_table[sn].skill_level[victim->class] > LEVEL_HERO) + { + duration = level/12; + found = FALSE; + } + if (victim->pcdata->tier == 2) + { + if (skill_table[sn].skill_level[victim->clasb] > LEVEL_HERO) + { + if (found) + { + duration = level/6; + } else + { + duration = level/12; + } + } else { + if (found) + { + duration = level/3; + } else + { + duration = level/6; + } + } + } } -*/ af.where = TO_SHIELDS; af.type = sn; af.level = level; - af.duration = level/6; + af.duration = duration; af.location = APPLY_NONE; af.modifier = 0; af.bitvector = SHD_FIRE; @@ -586,6 +858,7 @@ CHAR_DATA *victim = (CHAR_DATA *) vo; AFFECT_DATA af; + int duration; if (IS_SHIELDED(victim, SHD_SHOCK)) { @@ -602,22 +875,44 @@ return; } -/* - if ( (skill_table[sn].skill_level[victim->class] > LEVEL_HERO) - && (victim->level < LEVEL_IMMORTAL) ) + duration = level/6; + + if (!IS_IMMORTAL(victim)) { - 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; + bool found = TRUE; + + if (skill_table[sn].skill_level[victim->class] > LEVEL_HERO) + { + duration = level/12; + found = FALSE; + } + if (victim->pcdata->tier == 2) + { + if (skill_table[sn].skill_level[victim->clasb] > LEVEL_HERO) + { + if (found) + { + duration = level/6; + } else + { + duration = level/12; + } + } else { + if (found) + { + duration = level/3; + } else + { + duration = level/6; + } + } + } } -*/ af.where = TO_SHIELDS; af.type = sn; af.level = level; - af.duration = level/6; + af.duration = duration; af.location = APPLY_NONE; af.modifier = 0; af.bitvector = SHD_SHOCK; @@ -662,16 +957,17 @@ send_to_char("This body part is from a mobile.\n\r",ch); return; } + do_mod_favor(ch, 8); one_argument(bpart->name, name); doll = create_object(get_obj_index(OBJ_VNUM_VOODOO), 0); sprintf( buf, doll->short_descr, name ); - free_string( doll->short_descr ); + free_string( doll->short_descr, "magic2.c/spell_voodoo #1" ); doll->short_descr = str_dup( buf ); sprintf( buf, doll->description, name ); - free_string( doll->description ); + free_string( doll->description, "magic2.c/spell_voodoo #2" ); doll->description = str_dup( buf ); sprintf( buf, doll->name, name ); - free_string( doll->name ); + free_string( doll->name, "magic2.c/spell_voodoo #3" ); doll->name = str_dup( buf ); act( "$p morphs into a voodoo doll",ch,bpart,NULL,TO_CHAR); obj_from_char( bpart ); @@ -681,3 +977,70 @@ return; } +void spell_shadow( int sn, int level, CHAR_DATA *ch, void *vo,int target) +{ + CHAR_DATA *victim = (CHAR_DATA *) vo; + CHAR_DATA *gch; + + if (IS_NPC(victim)) + { + send_to_char("You can only use this on other players.\n\r",ch); + return; + } + if ( ( time_info.hour < 6 ) || ( time_info.hour > 18 ) ) + { + send_to_char( "You can only use this during the day.\n\r", ch ); + return; + } + if (victim == ch) + { + send_to_char("You move toward your shadow, but it moves away from you.\n\r",ch); + return; + } + if (IS_IMMORTAL(victim) && (victim->level > get_trust(ch))) + { + send_to_char("Spell failed.\n\r",ch); + return; + } + + if (ch->shadow || victim->shadowed) + { + send_to_char("Spell failed.\n\r",ch); + return; + } + + ch->shadow = TRUE; + ch->shadowing = victim; + victim->shadowed = TRUE; + victim->shadower = ch; + + for ( gch = ch->in_room->people; gch != NULL; gch = gch->next_in_room ) + { + if (IS_NPC(gch)) + continue; + if (gch == ch) + continue; + if (!IS_IMMORTAL(gch)) + continue; + if (gch->level < get_trust(ch)) + continue; + act( "$n slips out of the room.", ch, NULL, gch, TO_VICT ); + } + char_from_room( ch ); + char_to_room( ch, victim->in_room ); + do_look( victim, "auto" ); + for ( gch = ch->in_room->people; gch != NULL; gch = gch->next_in_room ) + { + if (IS_NPC(gch)) + continue; + if (gch == ch) + continue; + if (!IS_IMMORTAL(gch)) + continue; + if (gch->level < get_trust(ch)) + continue; + act( "$n silently slips into the room.", ch, NULL, NULL, TO_ROOM ); + } + act("You silently slip into %N's shadow.", ch, NULL, victim, TO_CHAR); + return; +} --- magic.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/magic.c Sun Aug 15 17:33:25 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -99,6 +97,10 @@ if (ch->level >= skill_table[sn].skill_level[ch->class] && ch->pcdata->learned[sn] > 0) return sn; + if (ch->pcdata->tier == 2) + if (ch->level >= skill_table[sn].skill_level[ch->clasb] + && ch->pcdata->learned[sn] > 0) + return sn; } } return found; @@ -237,12 +239,55 @@ case IS_VULNERABLE: save -= 2; break; } - if (!IS_NPC(victim) && class_table[victim->class].fMana) - save = 9 * save / 10; + if (!IS_NPC(victim)) + { + if (class_table[victim->class].fMana) + save = 9 * save / 10; + else if (victim->pcdata->tier == 2) + if (class_table[victim->clasb].fMana) + { + save -= 1; + save = 9 * save / 10; + } + } save = URANGE( 5, save, 95 ); return number_percent( ) < save; } +bool saves_dispel_magic( int level, CHAR_DATA *victim, int dam_type ) +{ + int save; + int minnum; + + save = 50 + ( victim->level - level) * 5 - victim->saving_throw * 2; + if (IS_AFFECTED(victim,AFF_BERSERK)) + save += victim->level/2; + + switch(check_immune(victim,dam_type)) + { + case IS_IMMUNE: return TRUE; + case IS_RESISTANT: save += 2; break; + case IS_VULNERABLE: save -= 2; break; + } + + if (!IS_NPC(victim)) + { + if (class_table[victim->class].fMana) + save = 9 * save / 10; + else if (victim->pcdata->tier == 2) + if (class_table[victim->clasb].fMana) + { + save -= 1; + save = 9 * save / 10; + } + } + minnum = level / 2; + minnum += ( ( level - victim->level ) / 5 ) * 2; + minnum = URANGE( 1, minnum, 75 ); + save = URANGE( minnum, save, 75 ); + return number_percent( ) < save; +} + /* RT save for dispels */ bool saves_dispel( int dis_level, int spell_level, int duration) @@ -339,20 +384,49 @@ return; } - if ( ( sn = find_spell( ch,arg1 ) ) < 0 - || ( !IS_NPC(ch) && (ch->level < skill_table[sn].skill_level[ch->class] - || ch->pcdata->learned[sn] == 0))) + if ( ( sn = find_spell( ch,arg1 ) ) < 0 + || (skill_table[sn].min_mana == 0)) { send_to_char( "You don't know any spells of that name.\n\r", ch ); return; } - + + if ( !IS_NPC(ch) ) + { + if (ch->pcdata->tier != 2) + { + if (ch->level < skill_table[sn].skill_level[ch->class]) + { + send_to_char( "You don't know any spells of that name.\n\r", ch ); + return; + } + } else + { + if ((ch->level < skill_table[sn].skill_level[ch->class]) + && (ch->level < skill_table[sn].skill_level[ch->clasb])) + { + send_to_char( "You don't know any spells of that name.\n\r", ch ); + return; + } + } + if (ch->pcdata->learned[sn] == 0) + { + send_to_char( "You don't know any spells of that name.\n\r", ch ); + return; + } + } if ( ch->position < skill_table[sn].minimum_position ) { send_to_char( "You can't concentrate enough.\n\r", ch ); return; } + if (ch->spirit) + { + send_to_char( "That's hard to do when you're dead.\n\r", ch); + return; + } + if (ch->level + 2 == skill_table[sn].skill_level[ch->class]) mana = 50; else @@ -360,6 +434,19 @@ skill_table[sn].min_mana, 100 / ( 2 + ch->level - skill_table[sn].skill_level[ch->class] ) ); + if (!IS_NPC(ch) && (ch->pcdata->tier == 2)) + { + if ((ch->level + 2 == skill_table[sn].skill_level[ch->class]) + || ( ch->level + 2 == skill_table[sn].skill_level[ch->clasb])) + mana = 50; + else + mana = UMAX( + skill_table[sn].min_mana, + 100 / ( 2 + ch->level - UMIN(skill_table[sn].skill_level[ch->class] , + skill_table[sn].skill_level[ch->clasb]) ) ); + } + + if (!strcmp(skill_table[sn].name, "restore mana") ) mana = 1; @@ -397,15 +484,6 @@ return; } } -/* - if ( ch == victim ) - { - send_to_char( "You can't do that to yourself.\n\r", ch ); - return; - } -*/ - - if ( !IS_NPC(ch) ) { @@ -438,6 +516,77 @@ target = TARGET_CHAR; break; + case TAR_CHAR_OFF_NEXTROOM: + if (IS_NPC(ch)) + return; + if ( arg2[0] == '\0' ) + { + if ( ( victim = ch->fighting ) == NULL ) + { + send_to_char( "Cast the spell on whom?\n\r", ch ); + return; + } else { + send_to_char( "They would notice that.\n\r", ch ); + return; + } + } + else + { + if ( ( victim = ch->fighting ) != NULL ) + { + send_to_char( "Not while you're fighting.\n\r", ch ); + return; + } + if ( ( victim = get_char_room( ch, target_name ) ) != NULL ) + { + send_to_char( "They would notice that.\n\r", ch ); + return; + } else { + sh_int door; + EXIT_DATA *pExit; + bool found = FALSE; + + for (door=0;door<13;door++) + { + if ((pExit = ch->in_room->exit[door]) != NULL) + { + for (victim=pExit->u1.to_room->people; victim != NULL; victim=victim->next_in_room) + { + if (!IS_NPC(victim) && victim->invis_level > get_trust(ch)) continue; + if ( get_trust(ch) < victim->ghost_level) continue; + if (!can_see(ch, victim)) continue; + if (is_name( target_name, victim->name ) ) + { + found = TRUE; + break; + } + } + if (found) + break; + } + } + if ((victim == NULL) || (!found)) + { + send_to_char( "Noone by that name around here.\n\r", ch ); + return; + } + } + } + if ( ( !IS_NPC( ch ) && !IS_NPC( victim ) ) + && ( !IS_IMMORTAL( ch ) ) + && ( !IS_IMMORTAL( victim ) ) + && ( ch != victim ) + && ( !skill_table[sn].socket ) + && ( !strcmp(ch->pcdata->socket, victim->pcdata->socket ) ) ) + { + send_to_char("Spell failed.\n\r",ch); + return; + } + + vo = (void *) victim; + target = TARGET_CHAR; + break; + case TAR_CHAR_DEFENSIVE: if ( arg2[0] == '\0' ) { @@ -634,6 +783,11 @@ act( "$N can't carry that much weight.", ch, NULL, victim, TO_CHAR ); return; } + if (victim->spirit) + { + send_to_char( "Spirits can't carry anything.\n\r", ch); + return; + } if ( !can_see_obj( victim, obj ) ) { act( "$N can't see it.", ch, NULL, victim, TO_CHAR ); @@ -650,7 +804,8 @@ return; } WAIT_STATE( ch, skill_table[sn].beats ); - if ( !can_drop_obj( ch, obj ) || IS_OBJ_STAT(obj,ITEM_QUEST) ) + if ( !can_drop_obj( ch, obj ) || IS_OBJ_STAT(obj,ITEM_QUEST) + || ( obj->item_type == ITEM_PASSBOOK ) ) { send_to_char( "It seems happy where it is.\n\r", ch); check_improve(ch,sn,FALSE,1); @@ -674,15 +829,24 @@ } else { + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } ch->mana -= mana; obj_from_char( obj ); obj_to_char( obj, victim ); + obj->got_from = 0; act( "$p glows {Ggreen{x, then disappears.", ch, obj, victim, TO_CHAR); act( "$p suddenly appears in your inventory.", ch, obj, victim, TO_VICT); act( "$p glows {Ggreen{x, then disappears from $n's inventory.", ch, obj, victim, TO_NOTVICT); check_improve(ch,sn,TRUE,1); if (IS_OBJ_STAT(obj,ITEM_FORCED) - && (victim->level <= HERO) ) { + && (victim->level <= HERO) ) + { do_wear(victim, obj->name); } } @@ -697,7 +861,16 @@ } if ( str_cmp( skill_table[sn].name, "ventriloquate" ) ) + { + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } say_spell( ch, sn ); + } WAIT_STATE( ch, skill_table[sn].beats ); @@ -709,11 +882,19 @@ } else { + if (ch->shadow) + { + ch->shadowing->shadowed = FALSE; + ch->shadowing->shadower = NULL; + ch->shadowing = NULL; + ch->shadow = FALSE; + } ch->mana -= mana; if (IS_NPC(ch) || class_table[ch->class].fMana) - /* class has spells */ (*skill_table[sn].spell_fun) ( sn, ch->level, ch, vo,target); - else + else if ((ch->pcdata->tier == 2) && (class_table[ch->clasb].fMana)) + (*skill_table[sn].spell_fun) ( sn, ch->level, ch, vo,target); + else (*skill_table[sn].spell_fun) (sn, 3 * ch->level/4, ch, vo,target); check_improve(ch,sn,TRUE,1); } @@ -810,6 +991,7 @@ case TAR_OBJ_CHAR_OFF: if ( victim == NULL && obj == NULL) + { if (ch->fighting != NULL) victim = ch->fighting; else @@ -817,12 +999,12 @@ send_to_char("You can't do that.\n\r",ch); return; } - + } if (victim != NULL) { if (is_safe_spell(ch,victim,FALSE) && ch != victim) { - send_to_char("Somehting isn't right...\n\r",ch); + send_to_char("Something isn't right...\n\r",ch); return; } @@ -905,7 +1087,9 @@ dam = dice( level, 12 ); if ( saves_spell( level, victim, DAM_ACID ) ) dam /= 2; - damage_old( ch, victim, dam, sn,DAM_ACID,TRUE); + damage( ch, victim, dam, sn,DAM_ACID,TRUE); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 8); return; } @@ -1018,6 +1202,8 @@ send_to_char( "You feel righteous.\n\r", victim ); if ( ch != victim ) act("You grant $N the favor of your god.",ch,NULL,victim,TO_CHAR); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 7); return; } @@ -1042,6 +1228,8 @@ affect_to_char( victim, &af ); send_to_char( "You are blinded!\n\r", victim ); act("$n appears to be blinded.",victim,NULL,NULL,TO_ROOM); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 8); return; } @@ -1079,7 +1267,9 @@ dam = number_range( dam_each[level] / 2, dam_each[level] * 2 ); if ( saves_spell( level, victim,DAM_FIRE) ) dam /= 2; - damage_old( ch, victim, dam, sn, DAM_FIRE,TRUE); + damage( ch, victim, dam, sn, DAM_FIRE,TRUE); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 8); return; } @@ -1125,7 +1315,7 @@ ch->attacker = TRUE; vch->attacker = FALSE; } - damage_old( ch, vch, saves_spell( level,vch,DAM_LIGHTNING) + damage( ch, vch, saves_spell( level,vch,DAM_LIGHTNING) ? dam / 2 : dam, sn,DAM_LIGHTNING,TRUE); } continue; @@ -1222,6 +1412,12 @@ return; } + if (!IS_NPC(victim) && IS_SET(victim->act,PLR_NOCANCEL)) + { + send_to_char("You failed.\n\r",ch); + return; + } + /* unlike dispel magic, the victim gets NO save */ /* begin running through the spells */ @@ -1387,7 +1583,9 @@ ch->attacker = TRUE; victim->attacker = FALSE; } - damage_old( ch, victim, dice(1, 8) + level / 3, sn,DAM_HARM,TRUE); + damage( ch, victim, dice(1, 8) + level / 3, sn,DAM_HARM,TRUE); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 8); return; } @@ -1403,7 +1601,9 @@ ch->attacker = TRUE; victim->attacker = FALSE; } - damage_old( ch, victim, dice(3, 8) + level - 6, sn,DAM_HARM,TRUE); + damage( ch, victim, dice(3, 8) + level - 6, sn,DAM_HARM,TRUE); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 8); return; } @@ -1419,7 +1619,9 @@ ch->attacker = TRUE; victim->attacker = FALSE; } - damage_old( ch, victim, dice(2, 8) + level / 2, sn,DAM_HARM,TRUE); + damage( ch, victim, dice(2, 8) + level / 2, sn,DAM_HARM,TRUE); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 7); return; } @@ -1446,10 +1648,12 @@ ch->attacker = TRUE; victim->attacker = FALSE; } + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 8); dam = dice(level,6); if (saves_spell(level,victim,DAM_LIGHTNING)) dam /= 3; - damage_old(ch,victim,dam,sn,DAM_LIGHTNING,TRUE); + damage(ch,victim,dam,sn,DAM_LIGHTNING,TRUE); last_vict = victim; level -= 4; /* decrement damage */ @@ -1471,7 +1675,7 @@ dam = dice(level,6); if (saves_spell(level,tmp_vict,DAM_LIGHTNING)) dam /= 3; - damage_old(ch,tmp_vict,dam,sn,DAM_LIGHTNING,TRUE); + damage(ch,tmp_vict,dam,sn,DAM_LIGHTNING,TRUE); level -= 4; /* decrement damage */ } } /* end target searching loop */ @@ -1495,7 +1699,7 @@ dam = dice(level,6); if (saves_spell(level,ch,DAM_LIGHTNING)) dam /= 3; - damage_old(ch,ch,dam,sn,DAM_LIGHTNING,TRUE); + damage(ch,ch,dam,sn,DAM_LIGHTNING,TRUE); level -= 4; /* decrement damage */ if (ch == NULL) return; @@ -1582,6 +1786,8 @@ act( "Isn't $n just so nice?", ch, NULL, victim, TO_VICT ); if ( ch != victim ) act("$N looks at you with adoring eyes.",ch,NULL,victim,TO_CHAR); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 8); return; } @@ -1634,7 +1840,9 @@ victim->attacker = FALSE; } - damage_old( ch, victim, dam, sn, DAM_COLD,TRUE ); + damage( ch, victim, dam, sn, DAM_COLD,TRUE ); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 8); return; } @@ -1675,7 +1883,7 @@ ch->attacker = TRUE; victim->attacker = FALSE; } - damage_old( ch, victim, dam, sn, DAM_LIGHT,TRUE ); + damage( ch, victim, dam, sn, DAM_LIGHT,TRUE ); return; } @@ -1798,7 +2006,7 @@ char buf[MAX_STRING_LENGTH]; sprintf( buf, "%s water", obj->name ); - free_string( obj->name ); + free_string( obj->name, "magic.c/spell_create_water" ); obj->name = str_dup( buf ); } act( "$p is filled.", ch, obj, NULL, TO_CHAR ); @@ -1826,6 +2034,8 @@ { send_to_char( "Your vision returns!\n\r", victim ); act("$n is no longer blinded.",victim,NULL,NULL,TO_ROOM); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 7); } else send_to_char("Spell failed.\n\r",ch); @@ -1843,7 +2053,11 @@ update_pos( victim ); send_to_char( "You feel better!\n\r", victim ); if ( ch != victim ) + { send_to_char( "Ok.\n\r", ch ); + } + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 7); return; } @@ -1865,6 +2079,8 @@ { send_to_char("Your sores vanish.\n\r",victim); act("$n looks relieved as $s sores vanish.",victim,NULL,NULL,TO_ROOM); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 7); } else send_to_char("Spell failed.\n\r",ch); @@ -1883,6 +2099,8 @@ send_to_char( "You feel better!\n\r", victim ); if ( ch != victim ) send_to_char( "Ok.\n\r", ch ); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 7); return; } @@ -1905,6 +2123,8 @@ { send_to_char("A warm feeling runs through your body.\n\r",victim); act("$n looks much better.",victim,NULL,NULL,TO_ROOM); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 7); } else send_to_char("Spell failed.\n\r",ch); @@ -1921,6 +2141,8 @@ send_to_char( "You feel better!\n\r", victim ); if ( ch != victim ) send_to_char( "Ok.\n\r", ch ); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 7); return; } @@ -1997,6 +2219,8 @@ send_to_char( "You feel unclean.\n\r", victim ); if ( ch != victim ) act("$N looks very uncomfortable.",ch,NULL,victim,TO_CHAR); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 8); return; } @@ -2035,7 +2259,7 @@ dam = dice( level, 10 ); if ( saves_spell( level, victim,DAM_NEGATIVE) ) dam /= 2; - damage_old( ch, victim, dam, sn, DAM_NEGATIVE ,TRUE); + damage( ch, victim, dam, sn, DAM_NEGATIVE ,TRUE); spell_curse(gsn_curse, 3 * level / 4, ch, (void *) victim,TARGET_CHAR); } @@ -2239,7 +2463,7 @@ ch->attacker = TRUE; victim->attacker = FALSE; } - damage_old( ch, victim, dam, sn, DAM_HOLY ,TRUE); + damage( ch, victim, dam, sn, DAM_HOLY ,TRUE); return; } @@ -2277,7 +2501,7 @@ ch->attacker = TRUE; victim->attacker = FALSE; } - damage_old( ch, victim, dam, sn, DAM_NEGATIVE ,TRUE); + damage( ch, victim, dam, sn, DAM_NEGATIVE ,TRUE); return; } @@ -2289,11 +2513,33 @@ CHAR_DATA *victim = (CHAR_DATA *) vo; bool found = FALSE; - if (saves_spell(level, victim,DAM_OTHER)) + if ((IS_NPC(ch) || IS_NPC(victim)) + && (saves_spell(level, victim,DAM_OTHER))) { send_to_char( "You feel a brief tingling sensation.\n\r",victim); send_to_char( "You failed.\n\r", ch); return; + } else if (!IS_NPC(ch) && !IS_NPC(victim)) + { + if ( is_pkill( victim ) + && !is_pkill( ch ) ) + { + send_to_char( "You feel a brief tingling sensation.\n\r",victim); + send_to_char( "You failed.\n\r", ch); + return; + } else if ( saves_dispel_magic( level, victim,DAM_OTHER ) ) + { + send_to_char( "You feel a brief tingling sensation.\n\r",victim); + send_to_char( "You failed.\n\r", ch); + return; + } else if ( is_pkill( victim ) + && !is_same_clan( ch, victim ) + && is_safe_spell( ch, victim, FALSE ) ) + { + send_to_char( "You feel a brief tingling sensation.\n\r",victim); + send_to_char( "You failed.\n\r", ch); + return; + } } /* begin running through the spells */ @@ -2349,8 +2595,6 @@ if (check_dispel(level,victim,skill_lookup("detect invis"))) found = TRUE; - found = TRUE; - if (check_dispel(level,victim,skill_lookup("detect hidden"))) found = TRUE; @@ -2470,7 +2714,21 @@ send_to_char("Ok.\n\r",ch); else send_to_char("Spell failed.\n\r",ch); - return; + + if (!IS_NPC(ch) && !IS_NPC(victim)) + { + if ( is_pkill( victim ) + && !is_same_clan( ch, victim ) ) + { + if ( ch->fighting == NULL ) + { + ch->attacker = TRUE; + victim->attacker = FALSE; + } + multi_hit( victim, ch, TYPE_UNDEFINED ); + } + } + return; } void spell_earthquake( int sn, int level, CHAR_DATA *ch, void *vo,int target ) @@ -2498,9 +2756,9 @@ vch->attacker = FALSE; } if (IS_AFFECTED(vch,AFF_FLYING)) - damage_old(ch,vch,0,sn,DAM_BASH,TRUE); + damage(ch,vch,0,sn,DAM_BASH,TRUE); else - damage_old( ch,vch,level + dice(2, 8), sn, DAM_BASH,TRUE); + damage( ch,vch,level + dice(2, 8), sn, DAM_BASH,TRUE); } continue; } @@ -2941,7 +3199,8 @@ } else { - gain_exp( victim, 0 - number_range( level/2, 3 * level / 2 ) ); + if (!IS_SET(victim->act, PLR_LQUEST)) + gain_exp( victim, 0 - number_range( level/2, 3 * level / 2 ) ); victim->mana /= 2; victim->move /= 2; dam = dice(1, level); @@ -2957,8 +3216,10 @@ send_to_char("You feel your life slipping away!\n\r",victim); send_to_char("Wow....what a rush!\n\r",ch); - damage_old( ch, victim, dam, sn, DAM_NEGATIVE ,TRUE); + damage( ch, victim, dam, sn, DAM_NEGATIVE ,TRUE); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 8); return; } @@ -2995,7 +3256,9 @@ ch->attacker = TRUE; victim->attacker = FALSE; } - damage_old( ch, victim, dam, sn, DAM_FIRE ,TRUE); + damage( ch, victim, dam, sn, DAM_FIRE ,TRUE); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 8); return; } @@ -3042,7 +3305,9 @@ dam = dice(6 + level / 2, 8); if ( saves_spell( level, victim,DAM_FIRE) ) dam /= 2; - damage_old( ch, victim, dam, sn, DAM_FIRE ,TRUE); + damage( ch, victim, dam, sn, DAM_FIRE ,TRUE); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 8); return; } @@ -3230,7 +3495,12 @@ { send_to_char( "You failed.\n\r", ch ); return; - } + } + if (global_quest && IS_NPC(victim) && victim->on_quest) + { + send_to_char( "You failed.\n\r", ch ); + return; + } if (ch->pet != NULL && ch->in_room == ch->pet->in_room) gate_pet = TRUE; else @@ -3302,7 +3572,9 @@ if ( saves_spell( level, victim,DAM_HARM) ) dam = UMIN( 50, dam / 2 ); dam = UMIN( 100, dam ); - damage_old( ch, victim, dam, sn, DAM_HARM ,TRUE); + damage( ch, victim, dam, sn, DAM_HARM ,TRUE); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 8); return; } @@ -3365,6 +3637,8 @@ send_to_char( "A warm feeling fills your body.\n\r", victim ); if ( ch != victim ) send_to_char( "Ok.\n\r", ch ); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 7); return; } @@ -3507,7 +3781,7 @@ } if (saves_spell(level,victim,DAM_FIRE)) dam = 2 * dam / 3; - damage_old(ch,victim,dam,sn,DAM_FIRE,TRUE); + damage(ch,victim,dam,sn,DAM_FIRE,TRUE); } } @@ -3554,7 +3828,7 @@ spell_curse(curse_num,level,ch,(void *) vch,TARGET_CHAR); send_to_char("You are struck down!\n\r",vch); dam = dice(level,6); - damage_old(ch,vch,dam,sn,DAM_ENERGY,TRUE); + damage(ch,vch,dam,sn,DAM_ENERGY,TRUE); } } @@ -3572,7 +3846,7 @@ spell_curse(curse_num,level/2,ch,(void *) vch,TARGET_CHAR); send_to_char("You are struck down!\n\r",vch); dam = dice(level,4); - damage_old(ch,vch,dam,sn,DAM_ENERGY,TRUE); + damage(ch,vch,dam,sn,DAM_ENERGY,TRUE); } } } @@ -3592,7 +3866,7 @@ "Object '%s' is type %s, extra flags %s.\n\rWeight is %d, value is %d, level is %d.\n\r", obj->name, - item_type_name( obj ), + item_type_name( obj->pIndexData ), extra_bit_name( obj->extra_flags ), obj->weight / 10, obj->cost, @@ -3735,10 +4009,22 @@ } if (is_class_obj(obj)) { - sprintf( buf, "This object may only be used by a %s.\n\r", - class_table[obj->class].name - ); - send_to_char( buf, ch ); + GUILD_DATA *guild; + + send_to_char( "Guild Object: ", ch); + for (guild = obj->pIndexData->guild; guild != NULL; guild = guild->next) + { + sprintf(buf, "{%s%c{%s%c%c%c%c ", + guild->guild < MAX_CLASS/2 ? "R" : "B", + class_table[guild->guild].who_name[0], + guild->guild < MAX_CLASS/2 ? "r" : "b", + class_table[guild->guild].who_name[1], + class_table[guild->guild].who_name[2], + class_table[guild->guild].who_name[3], + class_table[guild->guild].who_name[4]); + send_to_char(buf, ch); + } + send_to_char("{x\n\r", ch); } if (!obj->enchanted) for ( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) @@ -3909,6 +4195,10 @@ if ( IS_SHIELDED(victim, SHD_INVISIBLE) ) return; + if ( IS_NPC( victim ) + && IS_SET( victim->off_flags, OFF_CLAN_GUARD ) ) + return; + act( "$n fades out of existence.", victim, NULL, NULL, TO_ROOM ); af.where = TO_SHIELDS; @@ -3978,7 +4268,9 @@ ch->attacker = TRUE; victim->attacker = FALSE; } - damage_old( ch, victim, dam, sn, DAM_LIGHTNING ,TRUE); + damage( ch, victim, dam, sn, DAM_LIGHTNING ,TRUE); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 8); return; } @@ -4006,19 +4298,27 @@ || ch->level < obj->level) continue; - found = TRUE; - number++; for ( in_obj = obj; in_obj->in_obj != NULL; in_obj = in_obj->in_obj ) ; if ( in_obj->carried_by != NULL && can_see(ch,in_obj->carried_by)) { - sprintf( buf, "one is carried by %s\n\r", - PERS(in_obj->carried_by, ch) ); + if (IS_IMMORTAL(ch) || !IS_NPC(in_obj->carried_by) + || !global_quest || !in_obj->carried_by->on_quest) + { + found = TRUE; + number++; + sprintf( buf, "one is carried by %s\n\r", + PERS(in_obj->carried_by, ch) ); + buf[0] = UPPER(buf[0]); + add_buf(buffer,buf); + } } else { + found = TRUE; + number++; if (IS_IMMORTAL(ch) && in_obj->in_room != NULL) sprintf( buf, "one is in %s [Room %d]\n\r", in_obj->in_room->name, in_obj->in_room->vnum); @@ -4026,11 +4326,10 @@ sprintf( buf, "one is in %s\n\r", in_obj->in_room == NULL ? "somewhere" : in_obj->in_room->name ); + buf[0] = UPPER(buf[0]); + add_buf(buffer,buf); } - buf[0] = UPPER(buf[0]); - add_buf(buffer,buf); - if (number >= max_found) break; } @@ -4078,7 +4377,7 @@ ch->attacker = TRUE; victim->attacker = FALSE; } - damage_old( ch, victim, dam, sn, DAM_ENERGY ,TRUE); + damage( ch, victim, dam, sn, DAM_ENERGY ,TRUE); return; } @@ -4195,6 +4494,8 @@ ("You scream in agony as plague sores erupt from your skin.\n\r",victim); act("$n screams in agony as plague sores erupt from $s skin.", victim,NULL,NULL,TO_ROOM); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 8); } void spell_poison( int sn, int level, CHAR_DATA *ch, void *vo, int target ) @@ -4276,6 +4577,8 @@ affect_join( victim, &af ); send_to_char( "You feel very sick.\n\r", victim ); act("$n looks very ill.",victim,NULL,NULL,TO_ROOM); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 8); return; } @@ -4386,7 +4689,7 @@ ch->attacker = TRUE; victim->attacker = FALSE; } - damage_old( ch, victim, dam, sn, DAM_HOLY ,TRUE); + damage( ch, victim, dam, sn, DAM_HOLY ,TRUE); spell_blindness(gsn_blindness, 3 * level / 4, ch, (void *) victim,TARGET_CHAR); } @@ -4479,6 +4782,8 @@ send_to_char( "You feel less tired.\n\r", victim ); if ( ch != victim ) send_to_char( "Ok.\n\r", ch ); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 7); return; } @@ -4522,7 +4827,8 @@ send_to_char("You feel better.\n\r",victim); act("$n looks more relaxed.",victim,NULL,NULL,TO_ROOM); } - + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 7); for (obj = victim->carrying; (obj != NULL && !found); obj = obj->next_content) { if ((IS_OBJ_STAT(obj,ITEM_NODROP) || IS_OBJ_STAT(obj,ITEM_NOREMOVE)) @@ -4550,6 +4856,8 @@ send_to_char( "You feel more focused.\n\r", victim ); if ( ch != victim ) send_to_char( "Ok.\n\r", ch ); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 7); return; } @@ -4577,6 +4885,8 @@ affect_to_char( victim, &af ); act( "$n is surrounded by a white aura.", victim, NULL, NULL, TO_ROOM ); send_to_char( "You are surrounded by a white aura.\n\r", victim ); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 7); return; } @@ -4642,7 +4952,9 @@ ch->attacker = TRUE; victim->attacker = FALSE; } - damage_old( ch, victim, dam, sn, DAM_LIGHTNING ,TRUE); + damage( ch, victim, dam, sn, DAM_LIGHTNING ,TRUE); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 8); return; } @@ -4765,30 +5077,87 @@ { CHAR_DATA *victim; - if ( ( victim = get_char_world( ch, target_name ) ) == NULL - || victim == ch - || victim->in_room == NULL - || IS_SET(ch->in_room->room_flags, ROOM_SAFE) - || 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_NPC(victim) && IS_SET(victim->act,ACT_AGGRESSIVE)) - || victim->level >= level + 3 - || (is_clan(ch) && (is_clan(victim) && ((!is_same_clan(ch, victim) - && (clan_table[ch->clan].pkill) && (clan_table[victim->clan].pkill)) - || clan_table[victim->clan].independent))) - || (!IS_NPC(victim) && victim->level >= LEVEL_IMMORTAL) - || victim->fighting != NULL - || (IS_NPC(victim) && IS_SET(victim->imm_flags,IMM_SUMMON)) - || (IS_NPC(victim) && victim->pIndexData->pShop != NULL) - || (!IS_NPC(victim) && IS_SET(victim->act,PLR_NOSUMMON)) - || (IS_NPC(victim) && saves_spell( level, victim,DAM_OTHER)) ) - + if ( ( victim = get_char_world( ch, target_name ) ) == NULL ) + { + send_to_char( "You failed.\n\r", ch ); + return; + } + if ( victim == ch ) + { + send_to_char( "You failed.\n\r", ch ); + return; + } + if ( victim->in_room == NULL ) + { + send_to_char( "You failed.\n\r", ch ); + return; + } + if ( IS_SET( ch->in_room->room_flags, ROOM_SAFE ) + || IS_SET( victim->in_room->room_flags, ROOM_SAFE ) + || IS_SET( victim->in_room->room_flags, ROOM_PRIVATE ) + || IS_SET( ch->in_room->room_flags, ROOM_SOLITARY ) + || IS_SET( victim->in_room->room_flags, ROOM_SOLITARY ) + || IS_SET( ch->in_room->room_flags, ROOM_NO_RECALL ) + || IS_SET( victim->in_room->room_flags, ROOM_NO_RECALL ) ) + { + send_to_char( "You failed.\n\r", ch ); + return; + } + if ( IS_NPC( victim ) && IS_SET( victim->act, ACT_AGGRESSIVE ) ) + { + send_to_char( "You failed.\n\r", ch ); + return; + } + if ( victim->level >= level + 3 ) + { + send_to_char( "You failed.\n\r", ch ); + return; + } + if ( is_clan( ch ) + && ( is_clan( victim ) + && ( ( !is_same_clan( ch, victim ) + && ( clan_table[ch->clan].pkill ) + && ( clan_table[victim->clan].pkill ) ) + || ( clan_table[victim->clan].independent ) ) ) ) + { + send_to_char( "You failed.\n\r", ch ); + return; + } + if ( !IS_NPC( victim ) && ( victim->level >= LEVEL_IMMORTAL ) ) + { + send_to_char( "You failed.\n\r", ch ); + return; + } + if ( victim->fighting != NULL ) + { + send_to_char( "You failed.\n\r", ch ); + return; + } + if ( IS_NPC( victim ) && IS_SET( victim->imm_flags, IMM_SUMMON ) ) + { + send_to_char( "You failed.\n\r", ch ); + return; + } + if ( IS_NPC( victim ) && ( victim->pIndexData->pShop != NULL ) ) { send_to_char( "You failed.\n\r", ch ); return; } + if ( !IS_NPC( victim ) && IS_SET( victim->act, PLR_NOSUMMON ) ) + { + send_to_char( "You failed.\n\r", ch ); + return; + } + if ( IS_NPC( victim ) && saves_spell( level, victim, DAM_OTHER ) ) + { + send_to_char( "You failed.\n\r", ch ); + return; + } + if (global_quest && IS_NPC(victim) && victim->on_quest) + { + send_to_char( "You failed.\n\r", ch ); + return; + } act( "$n disappears suddenly.", victim, NULL, NULL, TO_ROOM ); char_from_room( victim ); @@ -4879,12 +5248,15 @@ affect_to_char( victim, &af ); send_to_char( "You feel your strength slip away.\n\r", victim ); act("$n looks tired and weak.",victim,NULL,NULL,TO_ROOM); + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 8); return; } /* RT recall spell is back */ +/* RW recall spell is gone again */ void spell_word_of_recall( int sn, int level, CHAR_DATA *ch,void *vo,int target) { @@ -4894,6 +5266,8 @@ if (IS_NPC(victim)) return; + return; + if ( ch->alignment < 0 ) { if ((location = get_room_index( ROOM_VNUM_TEMPLEB)) == NULL) @@ -4921,7 +5295,7 @@ if (victim->fighting != NULL) stop_fighting(victim,TRUE); - ch->move /= 2; + ch->move *= .75; act("$n disappears.",victim,NULL,NULL,TO_ROOM); char_from_room(victim); char_to_room(victim,location); @@ -4957,13 +5331,15 @@ if (saves_spell(level,victim,DAM_ACID)) { acid_effect(victim,level/2,dam/4,TARGET_CHAR); - damage_old(ch,victim,dam/2,sn,DAM_ACID,TRUE); + damage(ch,victim,dam/2,sn,DAM_ACID,TRUE); } else { acid_effect(victim,level,dam,TARGET_CHAR); - damage_old(ch,victim,dam,sn,DAM_ACID,TRUE); + damage(ch,victim,dam,sn,DAM_ACID,TRUE); } + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 8); } @@ -5007,12 +5383,12 @@ if (saves_spell(level,vch,DAM_FIRE)) { fire_effect(vch,level/2,dam/4,TARGET_CHAR); - damage_old(ch,vch,dam/2,sn,DAM_FIRE,TRUE); + damage(ch,vch,dam/2,sn,DAM_FIRE,TRUE); } else { fire_effect(vch,level,dam,TARGET_CHAR); - damage_old(ch,vch,dam,sn,DAM_FIRE,TRUE); + damage(ch,vch,dam,sn,DAM_FIRE,TRUE); } } else /* partial damage */ @@ -5020,12 +5396,12 @@ if (saves_spell(level - 2,vch,DAM_FIRE)) { fire_effect(vch,level/4,dam/8,TARGET_CHAR); - damage_old(ch,vch,dam/4,sn,DAM_FIRE,TRUE); + damage(ch,vch,dam/4,sn,DAM_FIRE,TRUE); } else { fire_effect(vch,level/2,dam/4,TARGET_CHAR); - damage_old(ch,vch,dam/2,sn,DAM_FIRE,TRUE); + damage(ch,vch,dam/2,sn,DAM_FIRE,TRUE); } } } @@ -5070,12 +5446,12 @@ if (saves_spell(level,vch,DAM_COLD)) { cold_effect(vch,level/2,dam/4,TARGET_CHAR); - damage_old(ch,vch,dam/2,sn,DAM_COLD,TRUE); + damage(ch,vch,dam/2,sn,DAM_COLD,TRUE); } else { cold_effect(vch,level,dam,TARGET_CHAR); - damage_old(ch,vch,dam,sn,DAM_COLD,TRUE); + damage(ch,vch,dam,sn,DAM_COLD,TRUE); } } else @@ -5083,12 +5459,12 @@ if (saves_spell(level - 2,vch,DAM_COLD)) { cold_effect(vch,level/4,dam/8,TARGET_CHAR); - damage_old(ch,vch,dam/4,sn,DAM_COLD,TRUE); + damage(ch,vch,dam/4,sn,DAM_COLD,TRUE); } else { cold_effect(vch,level/2,dam/4,TARGET_CHAR); - damage_old(ch,vch,dam/2,sn,DAM_COLD,TRUE); + damage(ch,vch,dam/2,sn,DAM_COLD,TRUE); } } } @@ -5130,12 +5506,12 @@ if (saves_spell(level,vch,DAM_POISON)) { poison_effect(vch,level/2,dam/4,TARGET_CHAR); - damage_old(ch,vch,dam/2,sn,DAM_POISON,TRUE); + damage(ch,vch,dam/2,sn,DAM_POISON,TRUE); } else { poison_effect(vch,level,dam,TARGET_CHAR); - damage_old(ch,vch,dam,sn,DAM_POISON,TRUE); + damage(ch,vch,dam,sn,DAM_POISON,TRUE); } } } @@ -5165,13 +5541,15 @@ if (saves_spell(level,victim,DAM_LIGHTNING)) { shock_effect(victim,level/2,dam/4,TARGET_CHAR); - damage_old(ch,victim,dam/2,sn,DAM_LIGHTNING,TRUE); + damage(ch,victim,dam/2,sn,DAM_LIGHTNING,TRUE); } else { shock_effect(victim,level,dam,TARGET_CHAR); - damage_old(ch,victim,dam,sn,DAM_LIGHTNING,TRUE); + damage(ch,victim,dam,sn,DAM_LIGHTNING,TRUE); } + if ( ch != victim && !IS_NPC(victim)) + do_mod_favor(ch, 8); } /* @@ -5192,7 +5570,7 @@ ch->attacker = TRUE; victim->attacker = FALSE; } - damage_old( ch, victim, dam, sn, DAM_PIERCE ,TRUE); + damage( ch, victim, dam, sn, DAM_PIERCE ,TRUE); return; } @@ -5211,6 +5589,6 @@ ch->attacker = TRUE; victim->attacker = FALSE; } - damage_old( ch, victim, dam, sn, DAM_PIERCE ,TRUE); + damage( ch, victim, dam, sn, DAM_PIERCE ,TRUE); return; } --- magic.h Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/magic.h Fri Aug 6 23:06:04 1999 @@ -1,37 +1,34 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ - /* * Spell functions. * Defined in magic.c. @@ -126,6 +123,7 @@ DECLARE_SPELL_FUN( spell_restore_mana ); DECLARE_SPELL_FUN( spell_resurrect ); DECLARE_SPELL_FUN( spell_sanctuary ); +DECLARE_SPELL_FUN( spell_shadow ); DECLARE_SPELL_FUN( spell_shocking_grasp ); DECLARE_SPELL_FUN( spell_shockshield ); DECLARE_SPELL_FUN( spell_shield ); --- Makefile Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/Makefile Sun Aug 8 18:25:35 1999 @@ -1,20 +1,27 @@ CC = gcc PROF = -O -g NOCRYPT = +LIBS = -lcrypt C_FLAGS = -Wall $(PROF) $(NOCRYPT) -L_FLAGS = $(PROF) +L_FLAGS = $(PROF) $(LIBS) +RM = rm -f +RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut ROT_FILES = act_comm.o act_enter.o act_info.o act_move.o act_obj.o act_wiz.o \ - alias.o ban.o clans.o comm.o const.o curse.o db.o db2.o effects.o \ - fight.o finger.o flags.o forget.o handler.o healer.o interp.o note.o \ - lookup.o magic.o magic2.o music.o recycle.o repent.o save.o scan.o \ - sign.o skills.o special.o tables.o update.o wizlist.o + alias.o ban.o banks.o clans.o comm.o const.o curse.o db.o db2.o \ + deity.o effects.o fight.o finger.o flags.o forget.o handler.o \ + healer.o interp.o lookup.o magic.o magic2.o music.o note.o \ + quest.o recycle.o repent.o save.o scan.o sign.o skills.o special.o \ + tables.o update.o wizlist.o all:: rot rot: $(ROT_FILES) rm -f rot - $(CC) $(L_FLAGS) -o rot $(ROT_FILES) + $(CC) $(L_FLAGS) -o rot $(ROT_FILES) .c.o: merc.h $(CC) -c $(C_FLAGS) $< + +clean:: + $(RM_CMD) \#* --- merc.h Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/merc.h Mon Jul 31 22:35:25 2000 @@ -1,36 +1,42 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ +/* + * Uncomment the following line if compiling on a Solaris 2.5.1+ system. + */ +#define solaris + +#if defined(solaris) +#undef SYSV +#endif /* * Accommodate old non-Ansi compilers. @@ -137,6 +143,7 @@ typedef struct wiz_data WIZ_DATA; typedef struct cln_data CLN_DATA; typedef struct mbr_data MBR_DATA; +typedef struct bank_data BANK_DATA; typedef struct buf_type BUFFER; typedef struct char_data CHAR_DATA; typedef struct descriptor_data DESCRIPTOR_DATA; @@ -147,15 +154,23 @@ typedef struct mem_data MEM_DATA; typedef struct mob_index_data MOB_INDEX_DATA; typedef struct note_data NOTE_DATA; +typedef struct mud_data MUD_DATA; typedef struct obj_data OBJ_DATA; typedef struct obj_index_data OBJ_INDEX_DATA; +typedef struct drm_index_data DRM_INDEX_DATA; +typedef struct dream_act_data DREAM_ACT_DATA; +typedef struct dream_change_data DREAM_CHANGE_DATA; +typedef struct dream_object_data DREAM_OBJECT_DATA; typedef struct pc_data PC_DATA; typedef struct gen_data GEN_DATA; typedef struct reset_data RESET_DATA; +typedef struct guild_data GUILD_DATA; +typedef struct race_data RACE_DATA; typedef struct room_index_data ROOM_INDEX_DATA; typedef struct shop_data SHOP_DATA; typedef struct time_info_data TIME_INFO_DATA; typedef struct weather_data WEATHER_DATA; +typedef struct deity_data DEITY_DATA; @@ -185,7 +200,7 @@ * Adjust the pulse numbers to suit yourself. */ #define MAX_SOCIALS 255 -#define MAX_SKILL 170 +#define MAX_SKILL 172 #define MAX_GROUP 48 #define MAX_IN_GROUP 20 #define MAX_TRACK 20 @@ -193,18 +208,19 @@ #define MAX_DAMAGE_MESSAGE 40 #define MAX_ALIAS 5 #define MAX_FORGET 5 -#define MAX_DUPES 7 +#define MAX_DUPES 10 #define MAX_CLASS 14 #define MAX_PC_RACE 20 #define MAX_CLAN 15 +#define MAX_BANKS 5 #define MAX_LEVEL 110 #define LEVEL_HERO (MAX_LEVEL - 9) #define LEVEL_IMMORTAL (MAX_LEVEL - 8) #define PULSE_PER_SECOND 4 -#define PULSE_VIOLENCE ( 3 * PULSE_PER_SECOND) -#define PULSE_MOBILE ( 4 * PULSE_PER_SECOND) -#define PULSE_MUSIC ( 6 * PULSE_PER_SECOND) +#define PULSE_VIOLENCE ( 4 * PULSE_PER_SECOND) +#define PULSE_MOBILE ( 6 * PULSE_PER_SECOND) +#define PULSE_MUSIC (15 * PULSE_PER_SECOND) #define PULSE_TICK (60 * PULSE_PER_SECOND) #define PULSE_AREA (120 * PULSE_PER_SECOND) @@ -223,6 +239,45 @@ #define VALUE_GOLD 1 #define VALUE_PLATINUM 2 +/* + * Diety data structure. + */ + +struct deity_data +{ + DEITY_DATA * next; + DEITY_DATA * prev; + char * filename; + char * name; + char * desc; + long vuln; + long resist; + long immune; + long affected_by; + long shielded_by; + sh_int death; + sh_int sex; + sh_int class; + sh_int race; + sh_int worshippers; + sh_int vnum_obj; + sh_int vnum_avatar; + sh_int cost_obj; + sh_int cost_avatar; + sh_int cost_corpse; + sh_int cost_recall; + sh_int alignment; + sh_int steal; + sh_int backstab; + sh_int flee; + sh_int aid; + sh_int sacrifice; + sh_int pkill; + sh_int spell_aid; + sh_int spell_harm; + sh_int kill_race; +}; + /* * Site ban structure. @@ -269,6 +324,18 @@ char * name; }; +struct bank_data +{ + BANK_DATA * next; + bool valid; + sh_int bank; + char * name; + sh_int amount; + sh_int type; + sh_int passwd; + time_t date; +}; + struct buf_type { BUFFER * next; @@ -330,6 +397,15 @@ #define CON_READ_IMOTD 13 #define CON_READ_MOTD 14 #define CON_BREAK_CONNECT 15 +#define CON_GET_HOMETOWN 16 +#define CON_MUD_GET_NAME 17 +#define CON_MUD_GET_BASE 18 +#define CON_MUD_GET_ADDRESS 19 +#define CON_MUD_GET_PORT 20 +#define CON_MUD_GET_WWW 21 +#define CON_MUD_SAVE 22 +#define CON_GET_SECOND_CLASS 23 +#define CON_REROLL 24 @@ -440,8 +516,8 @@ * Per-class stuff. */ -#define MAX_GUILD 3 #define MAX_STATS 5 +#define MAX_HOME 5 #define STAT_STR 0 #define STAT_INT 1 #define STAT_WIS 2 @@ -450,11 +526,11 @@ struct class_type { - char * name; /* the full name of the class */ - char who_name [4]; /* Three-letter name for 'who' */ + char * name; /* the full name of the class */ + char who_name [6]; /* Five-letter name for 'who' */ + char swho_name [3]; /* Two-letter name for 'who' */ sh_int attr_prime; /* Prime attribute */ sh_int weapon; /* First weapon */ - sh_int guild[MAX_GUILD]; /* Vnum of guild rooms */ sh_int skill_adept; /* Maximum skill level */ sh_int thac0_00; /* Thac0 for level 0 */ sh_int thac0_32; /* Thac0 for level 32 */ @@ -471,6 +547,14 @@ char * name; }; +struct bank_type +{ + char * name; + sh_int vnum; + sh_int open; + sh_int close; +}; + struct weapon_type { char * name; @@ -493,6 +577,17 @@ int damage; /* damage class */ }; +struct moblev_type +{ + int hpdice; + int hpsides; + int hpbonus; + int damdice; + int damsides; + int dambonus; + int mobac; +}; + struct race_type { char * name; /* call name of the race */ @@ -516,6 +611,8 @@ sh_int points; /* cost in points of the race */ sh_int class_mult[MAX_CLASS]; /* exp multiplier for class, * 100 */ char * skills[5]; /* bonus skills for the race */ + char * home[MAX_HOME]; /* home towns for the race */ + bool home_active; /* home towns active for the race */ sh_int stats[MAX_STATS]; /* starting stats */ sh_int max_stats[MAX_STATS]; /* maximum stats */ sh_int size; /* aff bits for the race */ @@ -554,7 +651,19 @@ time_t date_stamp; }; - +struct mud_data +{ + MUD_DATA * next; + bool valid; + char * sender; + char * date; + char * name; + char * base; + char * address; + int port; + char * www; + time_t date_stamp; +}; /* * An affect. @@ -611,12 +720,12 @@ #define MOB_VNUM_CORPSE 3174 #define MOB_VNUM_ANIMATE 3175 #define MOB_VNUM_DEMON 3181 -#define MOB_VNUM_CLAYTON 10009 #define GROUP_VNUM_TROLLS 2100 #define GROUP_VNUM_OGRES 2101 /* RT ASCII conversions -- used so we can have letters in this file */ +/* #define A 1 #define B 2 @@ -647,10 +756,50 @@ #define Y 16777216 #define Z 33554432 -#define aa 67108864 /* doubled due to conflicts */ +#define aa 67108864 #define bb 134217728 #define cc 268435456 #define dd 536870912 +#define ee 1073741824 + + */ + + +/* + * RT ASCII conversions -- Bits converted to hex by DAC. + */ +#define A 0x1 +#define B 0x2 +#define C 0x4 +#define D 0x8 +#define E 0x10 +#define F 0x20 +#define G 0x40 +#define H 0x80 +#define I 0x100 +#define J 0x200 +#define K 0x400 +#define L 0x800 +#define M 0x1000 +#define N 0x2000 +#define O 0x4000 +#define P 0x8000 +#define Q 0x10000 +#define R 0x20000 +#define S 0x40000 +#define T 0x80000 +#define U 0x100000 +#define V 0x200000 +#define W 0x400000 +#define X 0x800000 +#define Y 0x1000000 +#define Z 0x2000000 +#define aa 0x4000000 +#define bb 0x8000000 +#define cc 0x10000000 +#define dd 0x20000000 +#define ee 0x40000000 +#define ff 0x80000000 /* * ACT bits for mobs. @@ -685,7 +834,8 @@ #define ACT_IS_HEALER (aa) #define ACT_GAIN (bb) #define ACT_UPDATE_ALWAYS (cc) -#define ACT_IS_CHANGER (dd) +#define ACT_IS_BANKER (dd) +#define ACT_QUESTMASTER (ee) /* damage classes */ #define DAM_NONE 0 @@ -732,6 +882,7 @@ #define ASSIST_GUARD (T) #define ASSIST_VNUM (U) #define OFF_FEED (V) +#define OFF_CLAN_GUARD (W) /* return values for check_imm */ #define IS_NORMAL 0 @@ -974,14 +1125,20 @@ #define OBJ_VNUM_SPRING 22 #define OBJ_VNUM_DISC 23 #define OBJ_VNUM_PORTAL 25 +#define OBJ_VNUM_QUESTPILL 50 #define OBJ_VNUM_VOODOO 51 #define OBJ_VNUM_EXIT 52 #define OBJ_VNUM_CHAIN 53 #define OBJ_VNUM_BAG 54 +#define OBJ_VNUM_PASSBOOK 55 +#define OBJ_VNUM_LADDER 56 +#define OBJ_VNUM_QPOUCH 57 #define OBJ_VNUM_ROSE 1001 #define OBJ_VNUM_PIT 3010 +#define OBJ_VNUM_PIT_SCHOOL 3723 +#define OBJ_VNUM_PIT_NT 9603 #define OBJ_VNUM_SCHOOL_MACE 3700 #define OBJ_VNUM_SCHOOL_DAGGER 3701 @@ -1011,6 +1168,7 @@ #define OBJ_VNUM_DPOUCH 3383 #define OBJ_VNUM_CPOUCH 3387 #define OBJ_VNUM_DIAMOND 3377 +#define OBJ_VNUM_QUESTSCROLL 1204 #define OBJ_VNUM_SURVIVAL_PACK 1203 #define OBJ_VNUM_SURVIVAL_A 1304 @@ -1076,6 +1234,7 @@ #define ITEM_DEMON_STONE 35 #define ITEM_EXIT 36 #define ITEM_PIT 37 +#define ITEM_PASSBOOK 38 @@ -1111,6 +1270,7 @@ #define ITEM_QUEST (aa) #define ITEM_FORCED (bb) #define ITEM_QUESTPOINT (cc) +#define ITEM_LQUEST (dd) /* @@ -1238,33 +1398,54 @@ #define ROOM_VNUM_LIMBO 2 #define ROOM_VNUM_CORNER 3 #define ROOM_VNUM_CHAT 1200 +#define ROOM_VNUM_MIDGAARD 2900 +#define ROOM_VNUM_MORGUE 3000 #define ROOM_VNUM_TEMPLE 3001 #define ROOM_VNUM_TEMPLEB 3365 +#define ROOM_VNUM_QUEST_RECALL 3014 #define ROOM_VNUM_PIT 3367 #define ROOM_VNUM_ALTAR 3054 #define ROOM_VNUM_ALTARB 3366 #define ROOM_VNUM_SCHOOL 3700 +#define ROOM_VNUM_MORGUE_SCHOOL 3762 #define ROOM_VNUM_BALANCE 4500 #define ROOM_VNUM_CIRCLE 4400 #define ROOM_VNUM_DEMISE 4201 #define ROOM_VNUM_HONOR 4300 #define ROOM_VNUM_CHAIN 7914 +#define ROOM_VNUM_LADDER 9828 #define ROOM_VNUM_CLANS 20000 +#define ROOM_VNUM_GOOD_NT 9609 +#define ROOM_VNUM_EVIL_NT 9800 +#define ROOM_VNUM_MORG_NT 9802 + /* * Clan Rooms */ -#define ROOM_VNUM_EXAMPLE 20050 +#define ROOM_VNUM_GUARDIANS 20050 +#define ROOM_VNUM_DARKMIST 20150 +#define ROOM_VNUM_MIDNIGHT 20300 +#define ROOM_VNUM_JUDGES 20350 +#define ROOM_VNUM_ANGELS 20450 /* * Clan Room Entrances */ -#define ENT_VNUM_EXAMPLE 20051 +#define ENT_VNUM_GUARDIANS 20051 +#define ENT_VNUM_DARKMIST 20151 +#define ENT_VNUM_MIDNIGHT 20301 +#define ENT_VNUM_JUDGES 20351 +#define ENT_VNUM_ANGELS 20451 /* * Clan Pits */ -#define OBJ_PIT_EXAMPLE 20099 +#define OBJ_PIT_GUARDIANS 20099 +#define OBJ_PIT_DARKMIST 20199 +#define OBJ_PIT_MIDNIGHT 20349 +#define OBJ_PIT_JUDGES 20399 +#define OBJ_PIT_ANGELS 20499 /* @@ -1286,6 +1467,8 @@ #define ROOM_NEWBIES_ONLY (R) #define ROOM_LAW (S) #define ROOM_NOWHERE (T) +#define ROOM_CLAN_ENT (U) +#define ROOM_ARENA (V) #define ROOM_LOCKED (X) @@ -1317,7 +1500,10 @@ #define EX_INFURIATING (J) #define EX_NOCLOSE (K) #define EX_NOLOCK (L) - +#define EX_INVIS (M) +#define EX_FLY (N) +#define EX_SWIM (O) +#define EX_MAGIC (P) /* @@ -1422,6 +1608,7 @@ /* RT personal flags */ #define PLR_NOTRAN (I) #define PLR_AUTOPEEK (J) +#define PLR_NOCANCEL (K) #define PLR_NORESTORE (L) #define PLR_NOTITLE (M) #define PLR_HOLYLIGHT (N) @@ -1436,9 +1623,11 @@ #define PLR_DENY (X) #define PLR_FREEZE (Y) #define PLR_TWIT (Z) +#define PLR_LQUEST (aa) #define PLR_KEY (bb) #define PLR_NOCLAN (cc) -#define PLR_REROLL (dd) +#define PLR_SECOND (dd) +#define PLR_THIRD (ee) /* RT comm flags -- may be used on both mobs and chars */ @@ -1475,6 +1664,7 @@ #define COMM_LONG (aa) #define COMM_STORE (bb) #define COMM_NOQGOSSIP (cc) +#define COMM_TITLE_LOCK (dd) /* WIZnet flags */ #define WIZ_ON (A) @@ -1535,6 +1725,7 @@ sh_int default_pos; sh_int sex; sh_int race; + sh_int clan; long wealth; long form; long parts; @@ -1544,8 +1735,6 @@ char * say_descr; }; - - /* memory settings */ #define MEM_CUSTOMER A #define MEM_SELLER B @@ -1575,12 +1764,15 @@ CHAR_DATA * fighting; CHAR_DATA * reply; CHAR_DATA * pet; + CHAR_DATA * shadowing; + CHAR_DATA * shadower; MEM_DATA * memory; SPEC_FUN * spec_fun; MOB_INDEX_DATA * pIndexData; DESCRIPTOR_DATA * desc; AFFECT_DATA * affected; NOTE_DATA * pnote; + MUD_DATA * pmud; OBJ_DATA * carrying; OBJ_DATA * on; ROOM_INDEX_DATA * in_room; @@ -1593,6 +1785,10 @@ bool attacker; bool on_quest; bool wedpost; + bool shadow; + bool shadowed; + bool running; + sh_int newbie; char * name; long id; sh_int version; @@ -1609,9 +1805,13 @@ sh_int invited; sh_int sex; sh_int class; + sh_int clasb; sh_int race; sh_int level; sh_int trust; + sh_int home; + sh_int home_none; + int clock; int color; int color_auc; int color_cgo; @@ -1638,6 +1838,7 @@ int played; int lines; /* for the pager */ int stunned; + int spirit; time_t llogoff; time_t logon; sh_int timer; @@ -1649,9 +1850,11 @@ sh_int max_mana; sh_int move; sh_int max_move; + sh_int can_aquest; long platinum; long gold; long silver; + long balance[5]; long exp; int qps; int tells; @@ -1706,31 +1909,47 @@ PC_DATA * next; BUFFER * buffer; bool valid; + bool is_aquest; char * pwd; char * bamfin; char * bamfout; char * title; char * who_descr; char * socket; + char * lquest_obj; + char * lquest_mob; + char * lquest_are; + sh_int quest_obj; + sh_int quest_mob; + char * deity_name; + DEITY_DATA * deity; + int favor; time_t last_note; time_t last_idea; time_t last_penalty; time_t last_news; time_t last_changes; time_t last_weddings; + time_t last_mud; sh_int perm_hit; sh_int perm_mana; sh_int perm_move; sh_int true_sex; + sh_int pkills; + sh_int pdeath; + sh_int aflee; + sh_int dflee; int last_level; int recall; int tier; + int advanced; sh_int condition [4]; sh_int learned [MAX_SKILL]; bool group_known [MAX_GROUP]; sh_int points; bool confirm_delete; bool confirm_reroll; + bool confirm_loner; char * forget[MAX_FORGET]; char * dupes[MAX_DUPES]; char * alias[MAX_ALIAS]; @@ -1775,6 +1994,52 @@ }; +/* + * Prototype for a dream. + */ +struct drm_index_data +{ + DRM_INDEX_DATA * next; + DREAM_ACT_DATA * act; + DREAM_CHANGE_DATA * change; + DREAM_OBJECT_DATA * object; + char * description; + sh_int vnum; + sh_int move; +}; + +/* + * Act data for a dream. + */ +struct dream_act_data +{ + DREAM_ACT_DATA * next; + char * string; +}; + +/* + * Change data for a dream. + */ +struct dream_change_data +{ + DREAM_CHANGE_DATA * next; + char * keyword; + char * value; +}; + +/* + * Object data for a dream. + */ +struct dream_object_data +{ + DREAM_OBJECT_DATA * next; + char * roomchar; + sh_int vnum; + int variable; + int t_min; + int t_max; +}; + /* * Prototype for an object. @@ -1784,6 +2049,7 @@ OBJ_INDEX_DATA * next; EXTRA_DESCR_DATA * extra_descr; AFFECT_DATA * affected; + GUILD_DATA * guild; bool new_format; char * name; char * short_descr; @@ -1801,7 +2067,6 @@ int cost; int value[5]; sh_int clan; - sh_int class; }; @@ -1829,18 +2094,40 @@ char * short_descr; char * description; sh_int item_type; + sh_int got_from; int extra_flags; int wear_flags; sh_int wear_loc; sh_int weight; int cost; + int quest; + bool inscribed; + char * spell_name; + int spell_count; sh_int level; sh_int condition; char * material; sh_int timer; int value [5]; sh_int clan; - sh_int class; +}; + +/* + * Guild Rooms. + */ +struct guild_data +{ + GUILD_DATA * next; + sh_int guild; +}; + +/* + * Race Rooms. + */ +struct race_data +{ + RACE_DATA * next; + sh_int race; }; @@ -1855,7 +2142,7 @@ ROOM_INDEX_DATA * to_room; sh_int vnum; } u1; - sh_int exit_info; + long exit_info; sh_int key; char * keyword; char * description; @@ -1923,14 +2210,20 @@ AREA_DATA * area; EXIT_DATA * exit [12]; EXIT_DATA * old_exit[12]; + EXIT_DATA * fall; + EXIT_DATA * transfer; + GUILD_DATA * guild; + RACE_DATA * race; char * name; char * description; char * owner; + char * warn; sh_int vnum; int room_flags; sh_int light; sh_int sector_type; sh_int heal_rate; + bool heal_neg; sh_int mana_rate; sh_int clan; }; @@ -1958,6 +2251,7 @@ #define TAR_OBJ_CHAR_DEF 5 #define TAR_OBJ_CHAR_OFF 6 #define TAR_OBJ_TRAN 7 +#define TAR_CHAR_OFF_NEXTROOM 8 #define TARGET_CHAR 0 #define TARGET_OBJ 1 @@ -1996,6 +2290,7 @@ extern int chain; +extern int ladder; /* * These are skill_lookup return values for common skills and spells. @@ -2064,6 +2359,7 @@ extern sh_int gsn_track; extern sh_int gsn_gouge; extern sh_int gsn_grip; +extern sh_int gsn_inscribe; @@ -2117,7 +2413,7 @@ #define WAIT_STATE(ch, npulse) ((ch)->wait = UMAX((ch)->wait, (npulse))) #define DAZE_STATE(ch, npulse) ((ch)->daze = UMAX((ch)->daze, (npulse))) #define get_carry_weight(ch) ((ch)->carry_weight + ((ch)->silver/10) + \ - ((ch)->gold * 2 / 5) + ((ch)->platinum / 100)) + ((ch)->gold * 2 / 5) + ((ch)->platinum * 3 / 5)) @@ -2168,9 +2464,12 @@ extern const struct class_type class_table [MAX_CLASS]; extern const struct weapon_type weapon_table []; +extern const struct bank_type bank_table []; extern const struct item_type item_table []; extern const struct wiznet_type wiznet_table []; +extern const struct wiznet_type levnet_table []; extern const struct attack_type attack_table []; +extern const struct moblev_type moblev_table [MAX_LEVEL+1]; extern const struct race_type race_table []; extern const struct pc_race_type pc_race_table []; extern const struct spec_type spec_table []; @@ -2212,6 +2511,9 @@ extern bool global_quest; +extern DEITY_DATA * first_deity; +extern DEITY_DATA * last_deity; + /* * OS-dependent declarations. * These are all very standard library functions, @@ -2271,12 +2573,14 @@ char * crypt args( ( const char *key, const char *salt ) ); int fclose args( ( FILE *stream ) ); int fprintf args( ( FILE *stream, const char *format, ... ) ); +/* #if defined(SYSV) siz_t fread args( ( void *ptr, size_t size, size_t n, FILE *stream) ); #else int fread args( ( void *ptr, int size, int n, FILE *stream ) ); #endif +*/ int fseek args( ( FILE *stream, long offset, int ptrname ) ); void perror args( ( const char *s ) ); int ungetc args( ( int c, FILE *stream ) ); @@ -2326,6 +2630,7 @@ #if defined(unix) #define PLAYER_DIR "../player/" /* Player files */ #define GOD_DIR "../gods/" /* list of gods */ +#define DEITY_DIR "../deity/" /* dir for deity files */ #define TEMP_FILE "../player/romtmp" #define NULL_FILE "/dev/null" /* To reserve one stream */ #endif @@ -2339,10 +2644,13 @@ #define NEWS_FILE "news.not" #define CHANGES_FILE "chang.not" #define WEDDINGS_FILE "wedds.not" +#define MUD_FILE "muds.not" #define SHUTDOWN_FILE "shutdown.txt"/* For 'shutdown'*/ #define BAN_FILE "ban.txt" #define WIZ_FILE "wizlist.txt" #define MUSIC_FILE "music.txt" +#define BANK_FILE "banks.txt" +#define DEITY_FILE "deity.lst" @@ -2355,8 +2663,10 @@ #define OD OBJ_DATA #define OID OBJ_INDEX_DATA #define RID ROOM_INDEX_DATA +#define DID DRM_INDEX_DATA #define SF SPEC_FUN #define AD AFFECT_DATA +#define DE DEITY_DATA /* act_comm.c */ void check_sex args( ( CHAR_DATA *ch) ); @@ -2372,9 +2682,11 @@ /* act_info.c */ void set_title args( ( CHAR_DATA *ch, char *title ) ); +void show_warning args( ( CHAR_DATA *ch ) ); /* act_move.c */ void move_char args( ( CHAR_DATA *ch, int door, bool follow, bool quiet ) ); +void move_char_transfer args( ( CHAR_DATA *ch, bool quiet ) ); /* act_obj.c */ bool can_loot args( (CHAR_DATA *ch, OBJ_DATA *obj) ); @@ -2396,6 +2708,7 @@ /* clans.c */ void update_clanlist args( ( CHAR_DATA *ch, int clannum, bool add, bool clead ) ); +void modify_clanlist args( ( CHAR_DATA *ch, int clannum, char *argument ) ); /* comm.c */ void show_string args( ( struct descriptor_data *d, char *input) ); @@ -2425,6 +2738,7 @@ MID * get_mob_index args( ( int vnum ) ); OID * get_obj_index args( ( int vnum ) ); RID * get_room_index args( ( int vnum ) ); +DID * get_drm_index args( ( int vnum ) ); char fread_letter args( ( FILE *fp ) ); int fread_number args( ( FILE *fp ) ); long fread_flag args( ( FILE *fp ) ); @@ -2435,9 +2749,9 @@ long flag_convert args( ( char letter) ); void * alloc_mem args( ( int sMem ) ); void * alloc_perm args( ( int sMem ) ); -void free_mem args( ( void *pMem, int sMem ) ); +void free_mem args( ( void *pMem, int sMem, char *instring ) ); char * str_dup args( ( const char *str ) ); -void free_string args( ( char *pstr ) ); +void free_string args( ( char *pstr, char *instring ) ); int number_fuzzy args( ( int number ) ); int number_range args( ( int from, int to ) ); int number_percent args( ( void ) ); @@ -2506,6 +2820,7 @@ int attack_lookup args( ( const char *name) ); int race_lookup args( ( const char *name) ); long wiznet_lookup args( ( const char *name) ); +long levnet_lookup args( ( const char *name) ); int class_lookup args( ( const char *name) ); bool is_clan args( (CHAR_DATA *ch) ); bool is_clead args( (CHAR_DATA *ch) ); @@ -2516,6 +2831,8 @@ bool is_class_obj args( (OBJ_DATA *obj) ); bool class_can_use args( (CHAR_DATA *ch, OBJ_DATA *obj)); bool is_old_mob args ( (CHAR_DATA *ch) ); +int pk_range args( (CHAR_DATA *ch, CHAR_DATA *victim)); +bool pk_rangerev args( (CHAR_DATA *ch, CHAR_DATA *victim)); int get_skill args( ( CHAR_DATA *ch, int sn ) ); int get_weapon_sn args( ( CHAR_DATA *ch ) ); int get_weapon_skill args(( CHAR_DATA *ch, int sn ) ); @@ -2553,6 +2870,7 @@ void extract_char args( ( CHAR_DATA *ch, bool fPull ) ); CD * get_char_room args( ( CHAR_DATA *ch, char *argument ) ); CD * get_char_world args( ( CHAR_DATA *ch, char *argument ) ); +CD * get_exact_world args( ( CHAR_DATA *ch, char *argument ) ); CD * get_char_mortal args( ( CHAR_DATA *ch, char *argument ) ); OD * get_obj_type args( ( OBJ_INDEX_DATA *pObjIndexData ) ); OD * get_obj_list args( ( CHAR_DATA *ch, char *argument, @@ -2572,9 +2890,10 @@ bool room_is_private args( ( CHAR_DATA *ch, ROOM_INDEX_DATA *pRoomIndex) ); bool can_see args( ( CHAR_DATA *ch, CHAR_DATA *victim ) ); bool can_see_obj args( ( CHAR_DATA *ch, OBJ_DATA *obj ) ); -bool can_see_room args( ( CHAR_DATA *ch, ROOM_INDEX_DATA *pRoomIndex) ); +bool can_see_room args( ( CHAR_DATA *ch, ROOM_INDEX_DATA *pRoomIndex ) ); +bool can_see_door args( ( CHAR_DATA *ch, long exit_info ) ); bool can_drop_obj args( ( CHAR_DATA *ch, OBJ_DATA *obj ) ); -char * item_type_name args( ( OBJ_DATA *obj ) ); +char * item_type_name args( ( OBJ_INDEX_DATA *obj ) ); char * affect_loc_name args( ( int location ) ); char * affect_bit_name args( ( int vector ) ); char * shield_loc_name args( ( int location ) ); @@ -2610,10 +2929,12 @@ /* note.c */ void expire_notes args( ( void ) ); +void append_mud args( ( MUD_DATA *pmud ) ); /* save.c */ void save_char_obj args( ( CHAR_DATA *ch ) ); bool load_char_obj args( ( DESCRIPTOR_DATA *d, char *name ) ); +bool check_char_exist args( ( char *name ) ); bool load_char_reroll args( ( DESCRIPTOR_DATA *d, char *name ) ); /* skills.c */ @@ -2629,6 +2950,8 @@ void group_add args( ( CHAR_DATA *ch, const char *name, bool deduct) ); void group_remove args( ( CHAR_DATA *ch, const char *name) ); int spell_avail args( ( CHAR_DATA *ch, const char *name) ); +int spell_avail_class args( ( CHAR_DATA *ch, const char *name) ); +int spell_avail_clasb args( ( CHAR_DATA *ch, const char *name) ); /* special.c */ SF * spec_lookup args( ( const char *name ) ); @@ -2638,20 +2961,38 @@ RID * room_by_name args( ( char *target, int level, bool error) ); /* update.c */ -void advance_level args( ( CHAR_DATA *ch ) ); -void advance_level_quiet args( ( CHAR_DATA *ch ) ); +void change_level args( ( CHAR_DATA *ch ) ); +void change_level_quiet args( ( CHAR_DATA *ch ) ); void gain_exp args( ( CHAR_DATA *ch, int gain ) ); void gain_condition args( ( CHAR_DATA *ch, int iCond, int value ) ); -void update_handler args( ( void ) ); +void update_handler args( ( bool forced ) ); /* wizlist.c */ void update_wizlist args( ( CHAR_DATA *ch, int level ) ); +/* banks.c */ +bool is_compromised args( ( CHAR_DATA *ch, int bank ) ); +bool is_banklist args( ( CHAR_DATA *ch ) ); +bool is_othcomp args( ( int bank, int pass, char *argument ) ); +void change_banklist args( ( CHAR_DATA *ch, bool add, int bank, int amount, int pwd, char *argument ) ); +void check_robbed args( ( CHAR_DATA *ch ) ); +void expire_banks args( ( void ) ); + +/* deity.c */ +DE* get_deity args( ( char *name ) ); +void do_mod_favor args( ( CHAR_DATA *ch, int mod_type ) ); +void fread_deity args( ( DEITY_DATA * deity, FILE *fp ) ); +bool load_deity args( ( char *deity_file ) ); +void boot_deities args( ( void ) ); +void save_deity args( ( DEITY_DATA *deity ) ); +void strip_tilde args( ( char *str ) ); #undef CD #undef MID #undef OD #undef OID #undef RID +#undef DID #undef SF -#undef AD +#undef AD +#undef DE --- music.c Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/music.c Fri Aug 6 23:06:04 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) --- music.h Mon Aug 25 13:51:09 1997 +++ ../../Rot20/src/music.h Fri Aug 6 23:06:04 1999 @@ -1,35 +1,32 @@ - /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #define MAX_SONGS 20 --- note.c Mon Aug 25 13:51:10 1997 +++ ../../Rot20/src/note.c Sat Aug 14 20:31:11 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -56,8 +54,11 @@ /* local procedures */ void load_thread(char *name, NOTE_DATA **list, int type, time_t free_time); +void load_mudlist(char *name, MUD_DATA **list); void parse_note(CHAR_DATA *ch, char *argument, int type); +void parse_mud(CHAR_DATA *ch, char *argument); bool hide_note(CHAR_DATA *ch, NOTE_DATA *pnote); +bool hide_mud(CHAR_DATA *ch, MUD_DATA *pmud); NOTE_DATA *note_list; NOTE_DATA *idea_list; @@ -65,6 +66,7 @@ NOTE_DATA *news_list; NOTE_DATA *changes_list; NOTE_DATA *weddings_list; +MUD_DATA *mud_list; int count_spool(CHAR_DATA *ch, NOTE_DATA *spool) { @@ -78,6 +80,18 @@ return count; } +int count_spoolml(CHAR_DATA *ch, MUD_DATA *spool) +{ + int count = 0; + MUD_DATA *pmud; + + for (pmud = spool; pmud != NULL; pmud = pmud->next) + if (!hide_mud(ch,pmud)) + count++; + + return count; +} + void do_unread(CHAR_DATA *ch) { char buf[MAX_STRING_LENGTH]; @@ -129,6 +143,13 @@ count, count > 1 ? "penalties have" : "penalty has"); send_to_char(buf,ch); } + if ((count = count_spoolml(ch,mud_list)) > 0) + { + found = TRUE; + sprintf(buf,"There %s %d mud ad%s waiting to be read.\n\r", + count > 1 ? "are" : "is", count, count > 1 ? "s" : ""); + send_to_char(buf,ch); + } if (!found) send_to_char("You have no unread notes.\n\r",ch); @@ -164,6 +185,11 @@ parse_note(ch,argument,NOTE_CHANGES); } +void do_mud(CHAR_DATA *ch,char *argument) +{ + parse_mud(ch,argument); +} + void save_notes(int type) { FILE *fp; @@ -221,6 +247,40 @@ return; } } + +void save_muds(void) +{ + FILE *fp; + char *name; + MUD_DATA *pmud; + + name = MUD_FILE; + pmud = mud_list; + + fclose( fpReserve ); + if ( ( fp = fopen( name, "w" ) ) == NULL ) + { + perror( name ); + } + else + { + for ( ; pmud != NULL; pmud = pmud->next ) + { + fprintf( fp, "Sender %s~\n", pmud->sender); + fprintf( fp, "Date %s~\n", pmud->date); + fprintf( fp, "Stamp %ld\n", pmud->date_stamp); + fprintf( fp, "Name %s~\n", pmud->name); + fprintf( fp, "Base %s~\n", pmud->base); + fprintf( fp, "Address %s~\n", pmud->address); + fprintf( fp, "Port %d\n", pmud->port); + fprintf( fp, "WWW %s~\n", pmud->www); + } + fclose( fp ); + fpReserve = fopen( NULL_FILE, "r" ); + return; + } +} + void load_notes(void) { load_thread(NOTE_FILE,¬e_list, NOTE_NOTE, 14*24*60*60); @@ -234,6 +294,7 @@ load_thread(WEDDINGS_FILE,&weddings_list, NOTE_WEDDINGS, 0); strcat(boot_buf,"nger of th"); load_thread(CHANGES_FILE,&changes_list,NOTE_CHANGES, 0); + load_mudlist(MUD_FILE,&mud_list); } void load_thread(char *name, NOTE_DATA **list, int type, time_t free_time) @@ -311,6 +372,81 @@ return; } +void load_mudlist(char *name, MUD_DATA **list) +{ + FILE *fp; + MUD_DATA *pmudlast; + + if ( ( fp = fopen( name, "r" ) ) == NULL ) + return; + + pmudlast = NULL; + for ( ; ; ) + { + MUD_DATA *pmud; + char letter; + + do + { + letter = getc( fp ); + if ( feof(fp) ) + { + fclose( fp ); + return; + } + } + while ( isspace(letter) ); + ungetc( letter, fp ); + + pmud = alloc_perm( sizeof(*pmud) ); + + if ( str_cmp( fread_word( fp ), "sender" ) ) + break; + pmud->sender = fread_string( fp ); + + if ( str_cmp( fread_word( fp ), "date" ) ) + break; + pmud->date = fread_string( fp ); + + if ( str_cmp( fread_word( fp ), "stamp" ) ) + break; + pmud->date_stamp = fread_number(fp); + + if ( str_cmp( fread_word( fp ), "name" ) ) + break; + pmud->name = fread_string( fp ); + + if ( str_cmp( fread_word( fp ), "base" ) ) + break; + pmud->base = fread_string( fp ); + + if ( str_cmp( fread_word( fp ), "address" ) ) + break; + pmud->address = fread_string( fp ); + + if ( str_cmp( fread_word( fp ), "port" ) ) + break; + pmud->port = fread_number(fp); + + if ( str_cmp( fread_word( fp ), "www" ) ) + break; + pmud->www = fread_string( fp ); + + if (*list == NULL) + *list = pmud; + else + pmudlast->next = pmud; + + pmudlast = pmud; + } + + strcpy( strArea, MUD_FILE ); + fpArea = fp; + bug( "Load_mudlist: bad key word.", 0 ); + exit( 1 ); + return; +} + void append_note(NOTE_DATA *pnote) { FILE *fp; @@ -374,6 +510,45 @@ fpReserve = fopen( NULL_FILE, "r" ); } +void append_mud(MUD_DATA *pmud) +{ + FILE *fp; + char *name; + MUD_DATA **list; + MUD_DATA *last; + + name = MUD_FILE; + list = &mud_list; + + if (*list == NULL) + *list = pmud; + else + { + for ( last = *list; last->next != NULL; last = last->next); + last->next = pmud; + } + + fclose(fpReserve); + if ( ( fp = fopen(name, "a" ) ) == NULL ) + { + perror(name); + } + else + { + fprintf( fp, "Sender %s~\n", pmud->sender); + fprintf( fp, "Date %s~\n", pmud->date); + fprintf( fp, "Stamp %ld\n", pmud->date_stamp); + fprintf( fp, "Name %s~\n", pmud->name); + fprintf( fp, "Base %s~\n", pmud->base); + fprintf( fp, "Address %s~\n", pmud->address); + fprintf( fp, "Port %d\n", pmud->port); + fprintf( fp, "WWW %s~\n", pmud->www); + fclose( fp ); + } + fpReserve = fopen( NULL_FILE, "r" ); +} + + bool is_note_to( CHAR_DATA *ch, NOTE_DATA *pnote ) { if ( !str_cmp( ch->name, pnote->sender ) ) @@ -443,7 +618,7 @@ /* Just a simple recipient removal? */ if ( str_cmp( ch->name, pnote->sender ) && to_new[0] != '\0' ) { - free_string( pnote->to_list ); + free_string( pnote->to_list, "note.c/note_remove" ); pnote->to_list = str_dup( to_new + 1 ); return; } @@ -503,6 +678,50 @@ return; } +void mud_remove( CHAR_DATA *ch, MUD_DATA *pmud) +{ + MUD_DATA *prev; + MUD_DATA **list; + + if ((get_trust(ch) < MAX_LEVEL - 4) + && (str_cmp( ch->name, pmud->sender ))) + { + send_to_char("You did not post that mud ad.\n\r",ch); + return; + } + + list = &mud_list; + /* + * Remove mud from linked list. + */ + if ( pmud == *list ) + { + *list = pmud->next; + } + else + { + for ( prev = *list; prev != NULL; prev = prev->next ) + { + if ( prev->next == pmud ) + break; + } + + if ( prev == NULL ) + { + bug( "Mud_remove: pmud not found.", 0 ); + return; + } + + prev->next = pmud->next; + } + + save_muds(); + free_mud(pmud); + send_to_char("Ok.\n\r",ch); + return; +} + + bool hide_note (CHAR_DATA *ch, NOTE_DATA *pnote) { time_t last_read; @@ -546,6 +765,18 @@ return FALSE; } +void update_readml(CHAR_DATA *ch, MUD_DATA *pmud) +{ + time_t stamp; + + if (IS_NPC(ch)) + return; + + stamp = pmud->date_stamp; + + ch->pcdata->last_mud = UMAX(ch->pcdata->last_mud,stamp); +} + void update_read(CHAR_DATA *ch, NOTE_DATA *pnote) { time_t stamp; @@ -632,7 +863,6 @@ } argument = one_argument( argument, arg ); - smash_tilde( argument ); if ( arg[0] == '\0' || !str_prefix( arg, "read" ) ) { @@ -777,7 +1007,7 @@ return; } - if ( !str_prefix( arg, "delete" ) && get_trust(ch) >= MAX_LEVEL - 1) + if ( !str_prefix( arg, "delete" ) && get_trust(ch) >= MAX_LEVEL - 4) { if ( !is_number( argument ) ) { @@ -858,8 +1088,8 @@ add_buf(buffer,ch->pnote->text); add_buf(buffer,argument); - add_buf(buffer,"\n\r"); - free_string( ch->pnote->text ); + add_buf(buffer,"{x\n\r"); + free_string( ch->pnote->text, "note.c/parse_note #1" ); ch->pnote->text = str_dup( buf_string(buffer) ); free_buf(buffer); send_to_char( "Ok.\n\r", ch ); @@ -900,14 +1130,14 @@ else /* found the second one */ { buf[len + 1] = '\0'; - free_string(ch->pnote->text); + free_string(ch->pnote->text, "note.c/parse_note #2"); ch->pnote->text = str_dup(buf); return; } } } buf[0] = '\0'; - free_string(ch->pnote->text); + free_string(ch->pnote->text, "note.c/parse_note #3"); ch->pnote->text = str_dup(buf); return; } @@ -922,8 +1152,10 @@ return; } - free_string( ch->pnote->subject ); - ch->pnote->subject = str_dup( argument ); + sprintf(buf, "%s{x", argument); + free_string( ch->pnote->subject, "note.c/parse_note #4" ); + ch->pnote->subject = str_dup( buf ); + buf[0] = '\0'; send_to_char( "Ok.\n\r", ch ); return; } @@ -937,7 +1169,7 @@ "You already have a different note in progress.\n\r",ch); return; } - free_string( ch->pnote->to_list ); + free_string( ch->pnote->to_list, "note.c/parse_note #5" ); ch->pnote->to_list = str_dup( argument ); send_to_char( "Ok.\n\r", ch ); return; @@ -1024,6 +1256,258 @@ return; } +void parse_mud( CHAR_DATA *ch, char *argument ) +{ + char buf[MAX_STRING_LENGTH]; + char arg[MAX_INPUT_LENGTH]; + MUD_DATA *pmud; + MUD_DATA **list; + char *list_name; + int vnum; + int anum; + + if ( IS_NPC(ch) ) + return; + + if ((ch->in_room->vnum == ROOM_VNUM_CORNER) + && (!IS_IMMORTAL(ch))) + { + send_to_char("Just keep your nose in the corner like a good little player.\n\r",ch); + return; + } + + list = &mud_list; + list_name = "mud ads"; + + argument = one_argument( argument, arg ); + + if ( arg[0] == '\0' || !str_prefix( arg, "read" ) ) + { + bool fAll; + + if ( !str_cmp( argument, "all" ) ) + { + fAll = TRUE; + anum = 0; + } + + else if ( argument[0] == '\0' || !str_prefix(argument, "next")) + /* read next unread note */ + { + vnum = 0; + for ( pmud = *list; pmud != NULL; pmud = pmud->next) + { + if (!hide_mud(ch,pmud)) + { + sprintf( buf, "[%3d] %s: %s\n\r\n\r", + vnum, pmud->sender, pmud->date); + send_to_char( buf, ch ); + sprintf( buf, "{G Name:{x %s\n\r", pmud->name); + send_to_char( buf, ch ); + sprintf( buf, "{GCode Base:{x %s\n\r", pmud->base); + send_to_char( buf, ch ); + sprintf( buf, "{G Address:{x %s {GPort{x %d\n\r", + pmud->address, pmud->port); + send_to_char( buf, ch ); + sprintf( buf, "{G WWW:{x %s\n\r\n\r", pmud->www); + str_replace(buf, "[-]", "~"); + send_to_char( buf, ch ); + update_readml(ch,pmud); + return; + } else { + vnum++; + } + } + sprintf(buf,"You have no unread %s.\n\r",list_name); + send_to_char(buf,ch); + return; + } + else if ( is_number( argument ) ) + { + fAll = FALSE; + anum = atoi( argument ); + } + else + { + send_to_char( "Read which number?\n\r", ch ); + return; + } + + vnum = 0; + for ( pmud = *list; pmud != NULL; pmud = pmud->next ) + { + if ( ( vnum++ == anum || fAll ) ) + { + sprintf( buf, "[%3d] %s: %s\n\r\n\r", + vnum, pmud->sender, pmud->date); + send_to_char( buf, ch ); + sprintf( buf, "{G Name:{x %s\n\r", pmud->name); + send_to_char( buf, ch ); + sprintf( buf, "{GCode Base:{x %s\n\r", pmud->base); + send_to_char( buf, ch ); + sprintf( buf, "{G Address:{x %s {GPort{x %d\n\r", + pmud->address, pmud->port); + send_to_char( buf, ch ); + sprintf( buf, "{G WWW:{x %s\n\r\n\r", pmud->www); + str_replace(buf, "[-]", "~"); + send_to_char( buf, ch ); + update_readml(ch,pmud); + return; + } + } + + sprintf(buf,"There aren't that many %s.\n\r",list_name); + send_to_char(buf,ch); + return; + } + + if ( !str_prefix( arg, "list" ) ) + { + BUFFER *output; + vnum = 0; + output = new_buf(); + for ( pmud = *list; pmud != NULL; pmud = pmud->next ) + { + sprintf( buf, "[%3d%s] %s: %s\n\r", + vnum, hide_mud(ch,pmud) ? " " : "N", + pmud->sender, pmud->name ); + add_buf(output,buf); + vnum++; + } + if (!vnum) + { + sprintf( buf, "There are no %s to list.\n\r",list_name); + add_buf(output,buf); + } + page_to_char( buf_string(output), ch ); + free_buf(output); + return; + } + + if ( !str_prefix( arg, "delete" ) || !str_prefix( arg, "remove" ) ) + { + if ( !is_number( argument ) ) + { + send_to_char( "Mud delete which number?\n\r", ch ); + return; + } + + anum = atoi( argument ); + vnum = 0; + for ( pmud = *list; pmud != NULL; pmud = pmud->next ) + { + if ( vnum++ == anum ) + { + mud_remove( ch, pmud ); + return; + } + } + + sprintf(buf,"There aren't that many %s.",list_name); + send_to_char(buf,ch); + return; + } + + if (!str_prefix(arg,"catchup")) + { + ch->pcdata->last_mud = current_time; + return; + } + + if ( !str_prefix( arg, "post" ) || !str_prefix(arg, "add")) + { + DESCRIPTOR_DATA *d; + bool found = FALSE; + + if ( ( ch->class < MAX_CLASS/2 ) && ch->level < 10 ) + { + sprintf(buf,"You aren't authorized to write %s.",list_name); + send_to_char(buf,ch); + return; + } + + if ( ch->position == POS_FIGHTING ) + { + send_to_char( "No way! You are fighting.\n\r", ch ); + return; + } + + if ( ch->position < POS_STUNNED ) + { + send_to_char( "You're not DEAD yet.\n\r", ch ); + return; + } + + for ( d = descriptor_list; d != NULL; d = d->next ) + { + if ( d->connected == CON_PLAYING && + d->character == ch) + { + found = TRUE; + break; + } + } + if (!found) + { + send_to_char( "Can't find your descriptor, aborted\n\r",ch); + return; + } + send_to_char( "\n\r{REnter {zONLY{x{R the asked for information in the fields, if I had wanted{x\n\r",ch); + send_to_char( "{Rmessages in the ads, I would have made a field for them.{x\n\r\n\r", ch); + send_to_char( "{GEnter the name of the mud{x\n\r\n\r",ch); + send_to_char( "{Gie: {RRealms of Thoth{x\n\r\n\r",ch ); + send_to_char( " {YName:{x ", ch); + ch->was_in_room = ch->in_room; + char_from_room( ch ); + if ( ch == char_list ) + { + char_list = ch->next; + } + else + { + CHAR_DATA *prev; + + for ( prev = char_list; prev != NULL; prev = prev->next ) + { + if ( prev->next == ch ) + { + prev->next = ch->next; + break; + } + } + + if ( prev == NULL ) + { + bug( "Extract_char: char not found.", 0 ); + return; + } + } + + d->connected = CON_MUD_GET_NAME; + return; + } + send_to_char( "You can't do that.\n\r", ch ); + return; +} + +bool hide_mud (CHAR_DATA *ch, MUD_DATA *pmud) +{ + time_t last_read; + + if (IS_NPC(ch)) + return TRUE; + + last_read = ch->pcdata->last_mud; + + if (pmud->date_stamp <= last_read) + return TRUE; + + if (!str_cmp(ch->name,pmud->sender)) + return TRUE; + + return FALSE; +} + void note_remove_quiet( NOTE_DATA *pnote) { NOTE_DATA *prev; --- recycle.c Mon Aug 25 13:51:10 1997 +++ ../../Rot20/src/recycle.c Sat Aug 14 20:31:11 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -67,17 +65,52 @@ if (!IS_VALID(note)) return; - free_string( note->text ); - free_string( note->subject ); - free_string( note->to_list ); - free_string( note->date ); - free_string( note->sender ); + free_string( note->text, "recycle.c/free_note #1"); + free_string( note->subject, "recycle.c/free_note #2"); + free_string( note->to_list, "recycle.c/free_note #3"); + free_string( note->date, "recycle.c/free_note #4"); + free_string( note->sender, "recycle.c/free_note #5"); INVALIDATE(note); note->next = note_free; note_free = note; } +/* stuff for recyling mudlist */ +MUD_DATA *mud_free; + +MUD_DATA *new_mud() +{ + MUD_DATA *mud; + + if (mud_free == NULL) + mud = alloc_perm(sizeof(*mud)); + else + { + mud = mud_free; + mud_free = mud_free->next; + } + VALIDATE(mud); + return mud; +} + +void free_mud(MUD_DATA *mud) +{ + if (!IS_VALID(mud)) + return; + + free_string( mud->address, "recycle.c/free_mud #1"); + free_string( mud->base, "recycle.c/free_mud #2"); + free_string( mud->name, "recycle.c/free_mud #3"); + free_string( mud->www, "recycle.c/free_mud #4"); + free_string( mud->date, "recycle.c/free_mud #5"); + free_string( mud->sender, "recycle.c/free_mud #6"); + INVALIDATE(mud); + + mud->next = mud_free; + mud_free = mud; +} + /* stuff for recycling ban structures */ BAN_DATA *ban_free; @@ -106,7 +139,7 @@ if (!IS_VALID(ban)) return; - free_string(ban->name); + free_string(ban->name, "recycle.c/free_ban"); INVALIDATE(ban); ban->next = ban_free; @@ -140,13 +173,47 @@ if (!IS_VALID(wiz)) return; - free_string(wiz->name); + free_string(wiz->name, "recycle.c/free_wiz"); INVALIDATE(wiz); wiz->next = wiz_free; wiz_free = wiz; } +/* stuff for recycling banklist structures */ +BANK_DATA *bank_free; + +BANK_DATA *new_bank(void) +{ + static BANK_DATA bank_zero; + BANK_DATA *bank; + + if (bank_free == NULL) + bank = alloc_perm(sizeof(*bank)); + else + { + bank = bank_free; + bank_free = bank_free->next; + } + + *bank = bank_zero; + VALIDATE(bank); + bank->name = &str_empty[0]; + return bank; +} + +void free_bank(BANK_DATA *bank) +{ + if (!IS_VALID(bank)) + return; + + free_string(bank->name, "recycle.c/free_bank"); + INVALIDATE(bank); + + bank->next = bank_free; + bank_free = bank; +} + /* stuff for recycling clanlist structures */ CLN_DATA *cln_free; @@ -195,7 +262,7 @@ if (!IS_VALID(mbr)) return; - free_string(mbr->name); + free_string(mbr->name, "recycle.c/free_mbr"); INVALIDATE(mbr); mbr->next = mbr_free; @@ -228,8 +295,8 @@ if (!IS_VALID(d)) return; - free_string( d->host ); - free_mem( d->outbuf, d->outsize ); + free_string( d->host, "recycle.c/free_descriptor"); + free_mem( d->outbuf, d->outsize, "recycle.c/free_descriptor" ); INVALIDATE(d); d->next = descriptor_free; descriptor_free = d; @@ -292,8 +359,8 @@ if (!IS_VALID(ed)) return; - free_string(ed->keyword); - free_string(ed->description); + free_string(ed->keyword, "recycle.c/free_extra_descr #1"); + free_string(ed->description, "recycle.c/free_extra_descr #2"); INVALIDATE(ed); ed->next = extra_descr_free; @@ -351,6 +418,9 @@ } *obj = obj_zero; VALIDATE(obj); + obj->inscribed = FALSE; + obj->spell_name = ""; + obj->spell_count = 0; return obj; } @@ -377,11 +447,13 @@ } obj->extra_descr = NULL; - free_string( obj->name ); - free_string( obj->description ); - free_string( obj->short_descr ); - free_string( obj->owner ); - free_string( obj->killer ); + free_string( obj->name, "recycle.c/free_obj #1"); + free_string( obj->description, "recycle.c/free_obj #2"); + free_string( obj->short_descr, "recycle.c/free_obj #3"); + free_string( obj->owner, "recycle.c/free_obj #4"); + free_string( obj->killer, "recycle.c/free_obj #5"); + if ( obj->spell_name[0] != '\0') + free_string( obj->spell_name, "recycle.c/free_obj #6"); INVALIDATE(obj); obj->next = obj_free; @@ -418,6 +490,7 @@ ch->say_descr = &str_empty[0]; ch->logon = current_time; ch->lines = PAGELEN; + ch->running = FALSE; for (i = 0; i < 4; i++) ch->armor[i] = 100; ch->position = POS_STANDING; @@ -427,6 +500,7 @@ ch->max_mana = 100; ch->move = 100; ch->max_move = 100; + ch->color = 0; for (i = 0; i < MAX_STATS; i ++) { ch->perm_stat[i] = 13; @@ -462,19 +536,18 @@ affect_remove(ch,paf); } - free_string(ch->name); - free_string(ch->short_descr); - free_string(ch->long_descr); - free_string(ch->description); - free_string(ch->prompt); - free_string(ch->prefix); + free_string(ch->name, "recycle.c/free_char #1"); + free_string(ch->short_descr, "recycle.c/free_char #1"); + free_string(ch->long_descr, "recycle.c/free_char #3"); + free_string(ch->description, "recycle.c/free_char #4"); + free_string(ch->prompt, "recycle.c/free_char #5"); + free_string(ch->prefix, "recycle.c/free_char #6"); + free_note(ch->pnote); if ( ch->die_descr[0] != '\0') - free_string(ch->die_descr); + free_string(ch->die_descr, "recycle.c/free_char #7"); if ( ch->say_descr[0] != '\0') - free_string(ch->say_descr); - - if (ch->pcdata != NULL) - free_pcdata(ch->pcdata); + free_string(ch->say_descr, "recycle.c/free_char #8"); + free_pcdata(ch->pcdata); ch->next = char_free; char_free = ch; @@ -530,25 +603,28 @@ if (!IS_VALID(pcdata)) return; - free_string(pcdata->pwd); - free_string(pcdata->bamfin); - free_string(pcdata->bamfout); - free_string(pcdata->who_descr); - free_string(pcdata->title); + free_string(pcdata->pwd, "recycle.c/free_pcdata #1"); + free_string(pcdata->bamfin, "recycle.c/free_pcdata #2"); + free_string(pcdata->bamfout, "recycle.c/free_pcdata #3"); + free_string(pcdata->who_descr, "recycle.c/free_pcdata #4"); + free_string(pcdata->title, "recycle.c/free_pcdata #5"); + free_string(pcdata->lquest_obj, "recycle.c/free_pcdata #6"); + free_string(pcdata->lquest_mob, "recycle.c/free_pcdata #7"); + free_string(pcdata->lquest_are, "recycle.c/free_pcdata #8"); free_buf(pcdata->buffer); - + for (alias = 0; alias < MAX_ALIAS; alias++) { - free_string(pcdata->alias[alias]); - free_string(pcdata->alias_sub[alias]); + free_string(pcdata->alias[alias], "recycle.c/free_pcdata #9"); + free_string(pcdata->alias_sub[alias], "recycle.c/free_pcdata #10"); } for (alias = 0; alias < MAX_FORGET; alias++) { - free_string(pcdata->forget[alias]); + free_string(pcdata->forget[alias], "recycle.c/free_pcdata #11"); } for (alias = 0; alias < MAX_DUPES; alias++) { - free_string(pcdata->dupes[alias]); + free_string(pcdata->dupes[alias], "recycle.c/free_pcdata #12"); } INVALIDATE(pcdata); pcdata->next = pcdata_free; @@ -616,8 +692,6 @@ INVALIDATE(memory); } - - /* buffer sizes */ const int buf_size[MAX_BUF_LIST] = { @@ -628,14 +702,50 @@ /* -1 indicates out-of-boundary error */ int get_size (int val) { - int i; +/* int bfs; */ - for (i = 0; i < MAX_BUF_LIST; i++) - if (buf_size[i] >= val) + if (buf_size[0] >= val) + return buf_size[0]; + else if (buf_size[1] >= val) + return buf_size[1]; + else if (buf_size[2] >= val) + return buf_size[2]; + else if (buf_size[3] >= val) + return buf_size[3]; + else if (buf_size[4] >= val) + return buf_size[4]; + else if (buf_size[5] >= val) + return buf_size[5]; + else if (buf_size[6] >= val) + return buf_size[6]; + else if (buf_size[7] >= val) + return buf_size[7]; + else if (buf_size[8] >= val) + return buf_size[8]; + else if (buf_size[9] >= val) + return buf_size[9]; + else if (buf_size[10] >= val) + return buf_size[10]; + else if (buf_size[11] >= val) + return buf_size[11]; + else + return -1; + +/* + + for (bfs = 0; bfs < MAX_BUF_LIST; bfs++) + { + if (buf_size[bfs] >= val) + { + return buf_size[bfs]; + } + if (bfs >= MAX_BUF_LIST) { - return buf_size[i]; + return -1; } + } +*/ return -1; } @@ -695,7 +805,7 @@ if (!IS_VALID(buffer)) return; - free_mem(buffer->string,buffer->size); + free_mem(buffer->string,buffer->size, "recycle.c/free_buf" ); buffer->string = NULL; buffer->size = 0; buffer->state = BUFFER_FREED; @@ -720,11 +830,45 @@ len = strlen(buffer->string) + strlen(string) + 1; - while (len >= buffer->size) /* increase the buffer size */ + if (buf_size[0] >= len) + buffer->size = buf_size[0]; + else if (buf_size[1] >= len) + buffer->size = buf_size[1]; + else if (buf_size[2] >= len) + buffer->size = buf_size[2]; + else if (buf_size[3] >= len) + buffer->size = buf_size[3]; + else if (buf_size[4] >= len) + buffer->size = buf_size[4]; + else if (buf_size[5] >= len) + buffer->size = buf_size[5]; + else if (buf_size[6] >= len) + buffer->size = buf_size[6]; + else if (buf_size[7] >= len) + buffer->size = buf_size[7]; + else if (buf_size[8] >= len) + buffer->size = buf_size[8]; + else if (buf_size[9] >= len) + buffer->size = buf_size[9]; + else if (buf_size[10] >= len) + buffer->size = buf_size[10]; + else if (buf_size[11] >= len) + buffer->size = buf_size[11]; + else + { + buffer->size = -1; + buffer->size = oldsize; + buffer->state = BUFFER_OVERFLOW; + bug("BUG: add_buf: buffer overflow past size %d",buffer->size); + return FALSE; + } + +/* + while (len >= buffer->size) { buffer->size = get_size(buffer->size + 1); { - if (buffer->size == -1) /* overflow */ + if (buffer->size == -1) { buffer->size = oldsize; buffer->state = BUFFER_OVERFLOW; @@ -733,13 +877,14 @@ } } } +*/ if (buffer->size != oldsize) { buffer->string = alloc_mem(buffer->size); strcpy(buffer->string,oldstr); - free_mem(oldstr,oldsize); + free_mem(oldstr,oldsize, "recycle.c/add.buf" ); } strcat(buffer->string,string); --- recycle.h Mon Aug 25 13:51:10 1997 +++ ../../Rot20/src/recycle.h Fri Aug 6 23:06:04 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ /* externs */ @@ -52,6 +50,12 @@ void free_note args( (NOTE_DATA *note) ); #undef ND +/* mudlist recycling */ +#define MD MUD_DATA +MD *new_mud args( (void) ); +void free_mud args( (MUD_DATA *mud) ); +#undef MD + /* ban data recycling */ #define BD BAN_DATA BD *new_ban args( (void) ); @@ -61,9 +65,15 @@ /* wizlist data recycling */ #define WD WIZ_DATA WD *new_wiz args( (void) ); -void free_wiz args( (WIZ_DATA *ban) ); +void free_wiz args( (WIZ_DATA *wiz) ); #undef WD +/* banklist data recycling */ +#define KD BANK_DATA +KD *new_bank args( (void) ); +void free_bank args( (BANK_DATA *bank) ); +#undef KD + /* clan data recycling */ #define CL CLN_DATA CL *new_cln args( (void) ); --- repent.c Mon Aug 25 13:51:10 1997 +++ ../../Rot20/src/repent.c Fri Aug 6 23:06:04 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -120,11 +118,12 @@ if (cost > ((ch->platinum * 10000) + (ch->gold * 100) + ch->silver)) { - act("$N says '{aYou do not have enough gold for my services.{x'", - ch,NULL,mob,TO_CHAR); - return; + act("$N says '{aYou do not have enough money for my services.{x'", + ch,NULL,mob,TO_CHAR); + return; } + if (spell != NULL && ch->alignment < 0) { act("$N says '{aThoth does not protect the evil at heart!{x'", --- save.c Mon Aug 25 13:51:10 1997 +++ ../../Rot20/src/save.c Sat Aug 14 20:31:11 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -186,13 +184,27 @@ fprintf( fp, "Desc %s~\n", ch->description ); if (ch->prompt != NULL || !str_cmp(ch->prompt,"<%hhp %mm %vmv> ")) fprintf( fp, "Prom %s~\n", ch->prompt ); - fprintf( fp, "Race %s~\n", pc_race_table[ch->race].name ); + fprintf( fp, "Race %s~\n", race_table[ch->race].name ); if (ch->clan) { fprintf( fp, "Clan %s~\n",clan_table[ch->clan].name); if (ch->clead) fprintf( fp, "Clead %s~\n",clan_table[ch->clan].name); } + if (ch->clock) + fprintf( fp, "Clck %d\n", ch->clock); + if (!IS_NPC(ch)) + { + if ( ch->pcdata->deity ) + { + fprintf( fp, "Deity %s~\n", ch->pcdata->deity_name); + fprintf( fp, "Favor %d\n", ch->pcdata->favor ); + } + if (ch->pcdata->advanced != 0) + fprintf( fp, "Advan 1\n"); + } + if (ch->spirit != 0) + fprintf( fp, "Spirit 1\n"); if (ch->color != 0) fprintf( fp, "Color %d\n", ch->color); if (ch->color_auc != 0) @@ -239,17 +251,42 @@ fprintf( fp, "Cowit %d\n", ch->color_wit); if (ch->color_wiz != 0) fprintf( fp, "Cowiz %d\n", ch->color_wiz); + if (ch->home != 0) + fprintf( fp, "Home %s~\n", home_table[ch->home].name ); + if (ch->home_none != 0) + fprintf( fp, "Homn %d\n", ch->home_none); + if (!IS_NPC(ch) && (ch->can_aquest == 2)) + { + fprintf( fp, "Qon 2\n"); + fprintf( fp, "Qob %s~\n", ch->pcdata->lquest_obj); + fprintf( fp, "Qmo %s~\n", ch->pcdata->lquest_mob); + fprintf( fp, "Qar %s~\n", ch->pcdata->lquest_are); + fprintf( fp, "Qvn %d\n", ch->pcdata->quest_mob); + } + if (!IS_NPC(ch) && (ch->can_aquest == 1)) + { + fprintf( fp, "Qon 1\n"); + } fprintf( fp, "Sex %d\n", ch->sex ); fprintf( fp, "Clas %s~\n", class_table[ch->class].name ); + if (!IS_NPC(ch)) + if (ch->pcdata->tier == 2) + fprintf( fp, "Clab %s~\n", class_table[ch->clasb].name ); fprintf( fp, "Levl %d\n", ch->level ); - if (ch->class < MAX_CLASS/2) + if(!IS_NPC(ch)) + fprintf( fp, "Tier %d\n", ch->pcdata->tier ); if (ch->trust != 0) fprintf( fp, "Tru %d\n", ch->trust ); fprintf( fp, "Plyd %d\n", ch->played + (int) (current_time - ch->logon) ); - fprintf( fp, "Notb %ld %ld %ld %ld %ld %ld\n", + if (ch->newbie != 0) + fprintf( fp, "New 1\n"); + if(!IS_NPC(ch)) + fprintf( fp, "Notb %ld %ld %ld %ld %ld %ld\n", ch->pcdata->last_note,ch->pcdata->last_idea,ch->pcdata->last_penalty, ch->pcdata->last_news,ch->pcdata->last_changes,ch->pcdata->last_weddings); + if(!IS_NPC(ch)) + fprintf( fp, "Mudl %ld\n", ch->pcdata->last_mud ); fprintf( fp, "Scro %d\n", ch->lines ); fprintf( fp, "Room %d\n", ( ch->in_room == get_room_index( ROOM_VNUM_LIMBO ) @@ -260,17 +297,23 @@ fprintf( fp, "HMV %d %d %d %d %d %d\n", ch->hit, ch->max_hit, ch->mana, ch->max_mana, ch->move, ch->max_move ); if (ch->platinum > 0) - fprintf( fp, "Plat %ld\n", ch->platinum ); + fprintf( fp, "Plat %ld\n", ch->platinum ); else fprintf( fp, "Plat %d\n", 0 ); if (ch->gold > 0) - fprintf( fp, "Gold %ld\n", ch->gold ); + fprintf( fp, "Gold %ld\n", ch->gold ); else fprintf( fp, "Gold %d\n", 0 ); if (ch->silver > 0) fprintf( fp, "Silv %ld\n",ch->silver ); else fprintf( fp, "Silv %d\n",0 ); + fprintf( fp, "Bala %ld %ld %ld %ld %ld\n", + ch->balance[0] > 0 ? ch->balance[0] : 0, + ch->balance[1] > 0 ? ch->balance[1] : 0, + ch->balance[2] > 0 ? ch->balance[2] : 0, + ch->balance[3] > 0 ? ch->balance[3] : 0, + ch->balance[4] > 0 ? ch->balance[4] : 0); fprintf( fp, "Exp %ld\n", ch->exp ); if (ch->qps != 0) fprintf( fp, "Qps %d\n", ch->qps ); @@ -336,6 +379,10 @@ fprintf( fp, "Titl %s~\n", ch->pcdata->title ); fprintf( fp, "Pnts %d\n", ch->pcdata->points ); fprintf( fp, "TSex %d\n", ch->pcdata->true_sex ); + fprintf( fp, "Pkil %d\n", ch->pcdata->pkills ); + fprintf( fp, "Pdea %d\n", ch->pcdata->pdeath ); + fprintf( fp, "Afle %d\n", ch->pcdata->aflee ); + fprintf( fp, "Dfle %d\n", ch->pcdata->dflee ); fprintf( fp, "LLev %d\n", ch->pcdata->last_level ); fprintf( fp, "Reca %d\n", ch->pcdata->recall ); fprintf( fp, "HMVP %d %d %d\n", ch->pcdata->perm_hit, @@ -522,6 +569,12 @@ fprintf( fp, "Oldstyle\n"); if (obj->enchanted) fprintf( fp,"Enchanted\n"); + if (obj->inscribed) + { + fprintf( fp,"Inscribed\n"); + fprintf( fp,"Inspname %s~\n", obj->spell_name); + fprintf( fp,"Inspcount %d\n", obj->spell_count); + } fprintf( fp, "Nest %d\n", iNest ); /* these data are only used if they do not match the defaults */ @@ -547,9 +600,11 @@ fprintf( fp, "Wear %d\n", obj->wear_loc ); if (obj->level != obj->pIndexData->level) - fprintf( fp, "Lev %d\n", obj->level ); + fprintf( fp, "Lev %d\n", obj->level ); if (obj->timer != 0) fprintf( fp, "Time %d\n", obj->timer ); + if (obj->quest != 0) + fprintf( fp, "Quest %d\n", obj->quest ); fprintf( fp, "Cost %d\n", obj->cost ); if (obj->value[0] != obj->pIndexData->value[0] || obj->value[1] != obj->pIndexData->value[1] @@ -659,6 +714,14 @@ ch->pcdata->who_descr = str_dup( "" ); ch->pcdata->title = str_dup( "" ); ch->pcdata->tier = 0; + ch->pcdata->advanced = 0; + ch->pcdata->is_aquest = FALSE; + ch->can_aquest = 0; + ch->pcdata->lquest_obj = str_dup( "" ); + ch->pcdata->lquest_mob = str_dup( "" ); + ch->pcdata->lquest_are = str_dup( "" ); + ch->pcdata->quest_mob = 0; + ch->pcdata->quest_obj = 0; for (stat =0; stat < MAX_STATS; stat++) ch->perm_stat[stat] = 13; ch->pcdata->condition[COND_THIRST] = 48; @@ -757,8 +820,14 @@ { group_add(ch,"rom basics",FALSE); group_add(ch,class_table[ch->class].base_group,FALSE); + if (ch->pcdata->tier == 2) + group_add(ch,class_table[ch->clasb].base_group,FALSE); group_add(ch,class_table[ch->class].default_group,TRUE); + if (ch->pcdata->tier == 2) + group_add(ch,class_table[ch->clasb].default_group,TRUE); ch->pcdata->learned[gsn_recall] = 50; + if (ch->pcdata->tier == 2) + ch->pcdata->learned[gsn_recall] = 75; } /* fix levels */ @@ -766,23 +835,29 @@ { switch (ch->level) { - case(40) : ch->level = 60; break; /* imp -> imp */ - case(39) : ch->level = 58; break; /* god -> supreme */ - case(38) : ch->level = 56; break; /* deity -> god */ - case(37) : ch->level = 53; break; /* angel -> demigod */ + case(40) : ch->level = 110; break; /* imp -> imp */ + case(39) : ch->level = 109; break; /* god -> creator */ + case(38) : ch->level = 108; break; /* deity -> god */ + case(37) : ch->level = 107; break; /* angel -> demigod */ } switch (ch->trust) { - case(40) : ch->trust = 60; break; /* imp -> imp */ - case(39) : ch->trust = 58; break; /* god -> supreme */ - case(38) : ch->trust = 56; break; /* deity -> god */ - case(37) : ch->trust = 53; break; /* angel -> demigod */ - case(36) : ch->trust = 51; break; /* hero -> hero */ + case(40) : ch->trust = 110; break; /* imp -> imp */ + case(39) : ch->trust = 109; break; /* god -> creator */ + case(38) : ch->trust = 108; break; /* deity -> god */ + case(37) : ch->trust = 107; break; /* angel -> demigod */ + case(36) : ch->trust = 101; break; /* hero -> hero */ } } - /* ream gold */ + /* no first tier clan leaders less than level 70 */ + if (is_clead(ch) && (ch->class < MAX_CLASS/2) && (ch->level < 70)) + { + update_clanlist(ch, ch->clan, FALSE, TRUE); + } + + /* ream gold from old pfile type */ if (found && ch->version < 4) { ch->gold /= 100; @@ -791,6 +866,135 @@ } +/* + * Check a player name for duplicate + */ +bool check_char_exist( char *name ) +{ + char strsave[MAX_INPUT_LENGTH]; + char buf[100]; + FILE *fp; + bool found; + int e; + + found = FALSE; + fclose( fpReserve ); + + #if defined(unix) + /* decompress if .gz file exists */ + sprintf( strsave, "%s%s%s", PLAYER_DIR, capitalize(name),".gz"); + if ( ( fp = fopen( strsave, "r" ) ) != NULL ) + { + fclose(fp); + sprintf(buf,"gzip -dfq %s",strsave); + system(buf); + } + #endif + + sprintf( strsave, "%s%s", PLAYER_DIR, capitalize( name ) ); + if ( ( fp = fopen( strsave, "r" ) ) != NULL ) + { + fclose(fp); + found = TRUE; + } + if ( is_name( name, + "all auto immortal immortals self someone something the you demise balance circle loner honor") ) + { + found = TRUE; + } + for ( e = 1; e < MAX_CLAN; e++) + { + if (!str_prefix(clan_table[e].name, name)) + { + found = TRUE; + } + } + if (!str_infix("immortal",name)) + found = TRUE; + if (!str_infix(" ", name)) + found = TRUE; + if (!str_infix("fuck",name)) + found = TRUE; + if (!str_infix("shit",name)) + found = TRUE; + if (!str_infix("asshole",name)) + found = TRUE; + if (!str_infix("pussy",name)) + found = TRUE; + /* + * Length restrictions. + */ + + if ( strlen(name) < 2 ) + found = TRUE; + +#if defined(MSDOS) + if ( strlen(name) > 8 ) + found = TRUE; +#endif + +#if defined(macintosh) || defined(unix) + if ( strlen(name) > 12 ) + found = TRUE; +#endif + + { + char *pc; + bool fIll,adjcaps = FALSE,cleancaps = FALSE; + int total_caps = 0; + + fIll = TRUE; + for ( pc = name; *pc != '\0'; pc++ ) + { + if ( !isalpha(*pc) ) + found = TRUE; + + if ( isupper(*pc)) /* ugly anti-caps hack */ + { + if (adjcaps) + cleancaps = TRUE; + total_caps++; + adjcaps = TRUE; + } + else + adjcaps = FALSE; + + if ( LOWER(*pc) != 'i' && LOWER(*pc) != 'l' ) + fIll = FALSE; + } + + if ( fIll ) + found = TRUE; + + if (cleancaps || (total_caps > (strlen(name)) / 2 && strlen(name) < 3)) + found = TRUE; + } + + /* + * Prevent players from being named after mobs. + */ + { + extern MOB_INDEX_DATA *mob_index_hash[MAX_KEY_HASH]; + MOB_INDEX_DATA *pMobIndex; + int iHash; + + for ( iHash = 0; iHash < MAX_KEY_HASH; iHash++ ) + { + for ( pMobIndex = mob_index_hash[iHash]; + pMobIndex != NULL; + pMobIndex = pMobIndex->next ) + { + if ( is_name( name, pMobIndex->player_name ) ) + found = TRUE; + } + } + } + + + fpReserve = fopen( NULL_FILE, "r" ); + return found; +} + bool load_char_reroll( DESCRIPTOR_DATA *d, char *name ) { CHAR_DATA *ch; @@ -816,7 +1020,15 @@ ch->pcdata->bamfout = str_dup( "" ); ch->pcdata->who_descr = str_dup( "" ); ch->pcdata->title = str_dup( "" ); - ch->pcdata->tier = 1; + ch->pcdata->tier = 0; + ch->pcdata->advanced = 0; + ch->pcdata->is_aquest = FALSE; + ch->can_aquest = 0; + ch->pcdata->lquest_obj = str_dup( "" ); + ch->pcdata->lquest_mob = str_dup( "" ); + ch->pcdata->lquest_are = str_dup( "" ); + ch->pcdata->quest_mob = 0; + ch->pcdata->quest_obj = 0; for (stat =0; stat < MAX_STATS; stat++) ch->perm_stat[stat] = 13; ch->pcdata->condition[COND_THIRST] = 48; @@ -824,7 +1036,6 @@ ch->pcdata->condition[COND_HUNGER] = 48; found = FALSE; - fclose( fpReserve ); return found; } @@ -875,8 +1086,10 @@ case 'A': KEY( "Act", ch->act, fread_flag( fp ) ); + KEY( "Advan", ch->pcdata->advanced, fread_number( fp ) ); KEY( "AffectedBy", ch->affected_by, fread_flag( fp ) ); KEY( "AfBy", ch->affected_by, fread_flag( fp ) ); + KEY( "Afle", ch->pcdata->aflee, fread_number( fp ) ); KEY( "Alignment", ch->alignment, fread_number( fp ) ); KEY( "Alig", ch->alignment, fread_number( fp ) ); @@ -1003,15 +1216,37 @@ KEY( "Bamfout", ch->pcdata->bamfout, fread_string( fp ) ); KEY( "Bin", ch->pcdata->bamfin, fread_string( fp ) ); KEY( "Bout", ch->pcdata->bamfout, fread_string( fp ) ); + if ( !str_cmp( word, "Bal" ) ) + { + ch->balance[0] = fread_number(fp); + ch->balance[1] = fread_number(fp); + ch->balance[2] = fread_number(fp); + ch->balance[3] = fread_number(fp); + fMatch = TRUE; + break; + } + if ( !str_cmp( word, "Bala" ) ) + { + ch->balance[0] = fread_number(fp); + ch->balance[1] = fread_number(fp); + ch->balance[2] = fread_number(fp); + ch->balance[3] = fread_number(fp); + ch->balance[4] = fread_number(fp); + fMatch = TRUE; + break; + } break; case 'C': KEY( "Clas", ch->class, class_lookup(fread_string( fp )) ); + KEY( "Clab", ch->clasb, + class_lookup(fread_string( fp )) ); KEY( "Class", ch->class, fread_number( fp ) ); KEY( "Cla", ch->class, fread_number( fp ) ); KEY( "Clan", ch->clan, clan_lookup(fread_string(fp))); KEY( "Clead", ch->clead, clan_lookup(fread_string(fp))); + KEY( "Clck", ch->clock, fread_number( fp ) ); KEY( "Color", ch->color, fread_number( fp ) ); KEY( "Coauc", ch->color_auc, fread_number( fp ) ); KEY( "Cocgo", ch->color_cgo, fread_number( fp ) ); @@ -1060,8 +1295,10 @@ case 'D': KEY( "Damroll", ch->damroll, fread_number( fp ) ); KEY( "Dam", ch->damroll, fread_number( fp ) ); + KEY( "Deity", ch->pcdata->deity_name, fread_string( fp ) ); KEY( "Description", ch->description, fread_string( fp ) ); KEY( "Desc", ch->description, fread_string( fp ) ); + KEY( "Dfle", ch->pcdata->dflee, fread_number( fp ) ); if (!str_cmp( word, "Dupes")) { if (dcount >= MAX_DUPES) @@ -1098,6 +1335,7 @@ break; case 'F': + KEY( "Favor", ch->pcdata->favor, fread_number( fp ) ); if (!str_cmp( word, "Forge")) { if (fcount >= MAX_FORGET) @@ -1138,6 +1376,9 @@ case 'H': KEY( "Hitroll", ch->hitroll, fread_number( fp ) ); KEY( "Hit", ch->hitroll, fread_number( fp ) ); + KEY( "Home", ch->home, + home_lookup(fread_string( fp )) ); + KEY( "Homn", ch->home_none, fread_number( fp ) ); if ( !str_cmp( word, "HpManaMove" ) || !str_cmp(word,"HMV")) { @@ -1186,8 +1427,13 @@ KEY( "LnD", ch->long_descr, fread_string( fp ) ); break; + case 'M': + KEY( "Mudl", ch->pcdata->last_mud, fread_number( fp ) ); + break; + case 'N': KEY( "Name", ch->name, fread_string( fp ) ); + KEY( "New", ch->newbie, fread_number( fp ) ); KEY( "Note", ch->pcdata->last_note, fread_number( fp ) ); if (!str_cmp(word,"Not")) { @@ -1226,10 +1472,17 @@ KEY( "Prac", ch->practice, fread_number( fp ) ); KEY( "Prompt", ch->prompt, fread_string( fp ) ); KEY( "Prom", ch->prompt, fread_string( fp ) ); + KEY( "Pkil", ch->pcdata->pkills, fread_number( fp ) ); + KEY( "Pdea", ch->pcdata->pdeath, fread_number( fp ) ); break; case 'Q': KEY( "Qps", ch->qps, fread_number( fp ) ); + KEY( "Qon", ch->can_aquest, fread_number( fp ) ); + KEY( "Qob", ch->pcdata->lquest_obj, fread_string( fp ) ); + KEY( "Qmo", ch->pcdata->lquest_mob, fread_string( fp ) ); + KEY( "Qar", ch->pcdata->lquest_are, fread_string( fp ) ); + KEY( "Qvn", ch->pcdata->quest_mob, fread_number( fp ) ); case 'R': KEY( "Race", ch->race, @@ -1257,6 +1510,7 @@ KEY( "ShortDescr", ch->short_descr, fread_string( fp ) ); KEY( "ShD", ch->short_descr, fread_string( fp ) ); KEY( "Silv", ch->silver, fread_number( fp ) ); + KEY( "Spirit", ch->spirit, fread_number( fp ) ); if ( !str_cmp( word, "Skill" ) || !str_cmp(word,"Sk")) @@ -1296,7 +1550,7 @@ && ch->pcdata->title[0] != '!' && ch->pcdata->title[0] != '?') { sprintf( buf, " %s", ch->pcdata->title ); - free_string( ch->pcdata->title ); + free_string( ch->pcdata->title, "save.c/fread_char" ); ch->pcdata->title = str_dup( buf ); } fMatch = TRUE; @@ -1330,6 +1584,8 @@ fread_to_eol( fp ); } } + if( ch->pcdata->deity_name != NULL ) + ch->pcdata->deity = get_deity( ch->pcdata->deity_name ); } /* load a pet from the forgotten reaches */ @@ -1750,6 +2006,14 @@ break; case 'I': + if ( !str_cmp( word, "Inscribed")) + { + obj->inscribed = TRUE; + fMatch = TRUE; + break; + } + KEY( "Inspname", obj->spell_name, fread_string( fp ) ); + KEY( "Inspcount", obj->spell_count, fread_number( fp ) ); KEY( "ItemType", obj->item_type, fread_number( fp ) ); KEY( "Ityp", obj->item_type, fread_number( fp ) ); break; @@ -1787,6 +2051,9 @@ } break; + case 'Q': + KEY( "Quest", obj->quest, fread_number( fp ) ); + break; case 'S': KEY( "ShortDescr", obj->short_descr, fread_string( fp ) ); @@ -1881,5 +2148,19 @@ { ch->platinum++; extract_obj( obj ); + return; + } + if (IS_OBJ_STAT(obj,ITEM_QUEST) && !IS_IMMORTAL(ch)) + { + if (!global_quest) + { + REMOVE_BIT(obj->extra_flags,ITEM_QUEST); + obj->quest = 1; + } + } + if (obj->pIndexData->vnum == OBJ_VNUM_PASSBOOK) + { + if (!is_othcomp(obj->value[0], obj->value[1], obj->name)) + extract_obj( obj ); } } --- scan.c Mon Aug 25 13:51:10 1997 +++ ../../Rot20/src/scan.c Sat Aug 14 20:31:11 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -77,9 +75,9 @@ { outlet = door; if ( ( ch->alignment < 0 ) - && (pExit = ch ->in_room->exit[door+6]) != NULL) + && (pExit = ch->in_room->exit[door+6]) != NULL) outlet += 6; - if ((pExit = ch ->in_room->exit[outlet]) != NULL) + if ((pExit = ch->in_room->exit[outlet]) != NULL) scan_list(pExit->u1.to_room, ch, 1, outlet); } return; @@ -100,19 +98,28 @@ for (depth = 1; depth < 4; depth++) { - outlet = door; - if (scan_room == NULL) return; - if ( ( ch->alignment < 0 ) - && ((pExit = scan_room->exit[outlet+6]) != NULL)) - { - scan_room = pExit->u1.to_room; - scan_list(pExit->u1.to_room, ch, depth, outlet+6); - } - else if ((pExit = scan_room->exit[outlet]) != NULL) - { - scan_room = pExit->u1.to_room; - scan_list(pExit->u1.to_room, ch, depth, outlet); - } + outlet = door; + if (scan_room == NULL || !can_see_room(ch, scan_room)) + return; + if ( ( ch->alignment < 0 ) + && ((pExit = scan_room->exit[outlet+6]) != NULL)) + { + if (!can_see_room(ch,pExit->u1.to_room) + || !can_see_door(ch,pExit->exit_info)) + return; + scan_room = pExit->u1.to_room; + scan_list(pExit->u1.to_room, ch, depth, outlet+6); + } + else if ((pExit = scan_room->exit[outlet]) != NULL) + { + if (!can_see_room(ch,pExit->u1.to_room) + || !can_see_door(ch,pExit->exit_info)) + return; + scan_room = pExit->u1.to_room; + scan_list(pExit->u1.to_room, ch, depth, outlet); + } else { + return; + } } return; } --- sign.c Mon Aug 25 13:51:10 1997 +++ ../../Rot20/src/sign.c Sat Aug 14 20:31:11 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -86,7 +84,6 @@ return; argument = one_argument( argument, arg ); - smash_tilde( argument ); if ( arg[0] == '\0' ) { @@ -114,7 +111,7 @@ add_buf(buffer,ch->pnote->text); add_buf(buffer,argument); add_buf(buffer,"\n\r"); - free_string( ch->pnote->text ); + free_string( ch->pnote->text, "sign.c/parse_sign #1" ); ch->pnote->text = str_dup( buf_string(buffer) ); free_buf(buffer); send_to_char( "Ok.\n\r", ch ); @@ -155,14 +152,14 @@ else /* found the second one */ { buf[len + 1] = '\0'; - free_string(ch->pnote->text); + free_string(ch->pnote->text, "sign.c/parse_sign #2"); ch->pnote->text = str_dup(buf); return; } } } buf[0] = '\0'; - free_string(ch->pnote->text); + free_string(ch->pnote->text, "sign.c/parse_sign #3"); ch->pnote->text = str_dup(buf); return; } @@ -176,8 +173,8 @@ "You already have a different note in progress.\n\r",ch); return; } - free_string( ch->pnote->to_list ); - free_string( ch->pnote->subject ); + free_string( ch->pnote->to_list, "sign.c/parse_sign #4" ); + free_string( ch->pnote->subject, "sign.c/parse_sign #5" ); send_to_char( "Ok.\n\r", ch ); return; } --- skills.c Mon Aug 25 13:51:10 1997 +++ ../../Rot20/src/skills.c Fri Aug 6 23:06:04 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -74,11 +72,24 @@ return; } + if (ch->spirit) + { + send_to_char( "Spirits cannot gain.\n\r", ch); + return; + } + one_argument(argument,arg); if (arg[0] == '\0') { do_say(trainer,"{aPardon me?{x"); + send_to_char("{aI offer the following gain options:{x\n\r",ch); + send_to_char("{R list {aList the groups and skills you can gain.{x\n\r", ch); + send_to_char("{R convert {aConverts 6 practices to 1 train.{x\n\r", ch); + send_to_char("{R study {aConverts 1 train to 6 practices.{x\n\r", ch); + send_to_char("{R quest {aConverts 3 quest points to 1 train.{x\n\r", ch); + send_to_char("{R points {aGain creation points.{x\n\r", ch); + send_to_char("{R <{rname{R> {aGain skill or group {x\n\r\n\r", ch); return; } @@ -94,14 +105,36 @@ for (gn = 0; gn < MAX_GROUP; gn++) { + bool nfound = FALSE; + int tmpskill = 999; + if (group_table[gn].name == NULL) break; if (!ch->pcdata->group_known[gn] && group_table[gn].rating[ch->class] > 0) { - sprintf(buf,"%-18s %-5d ", + nfound = TRUE; + sprintf(buf,"{R%-18s %-5d {x", group_table[gn].name,group_table[gn].rating[ch->class]); + tmpskill = group_table[gn].rating[ch->class]; + } + if ( (ch->pcdata->tier == 2) + && !ch->pcdata->group_known[gn] + && group_table[gn].rating[ch->clasb] > 0) + { + sprintf(buf,"{B%-18s %-5d {x", + group_table[gn].name,group_table[gn].rating[ch->clasb]); + if (nfound) + { + sprintf(buf,"{G%-18s %-5d {x", + group_table[gn].name, + UMIN(tmpskill, group_table[gn].rating[ch->clasb]) ); + } + nfound = TRUE; + } + if (nfound) + { send_to_char(buf,ch); if (++col % 3 == 0) send_to_char("\n\r",ch); @@ -114,12 +147,15 @@ col = 0; - sprintf(buf, "%-18s %-5s %-18s %-5s %-18s %-5s\n\r", + sprintf(buf, "{M%-18s {Y%-5s {M%-18s {Y%-5s {M%-18s {Y%-5s{x\n\r", "skill","cost","skill","cost","skill","cost"); send_to_char(buf,ch); for (sn = 0; sn < MAX_SKILL; sn++) { + bool nfound = FALSE; + int tmpskill = 999; + if (skill_table[sn].name == NULL) break; @@ -127,12 +163,32 @@ && skill_table[sn].rating[ch->class] > 0 && skill_table[sn].spell_fun == spell_null) { - sprintf(buf,"%-18s %-5d ", + nfound = TRUE; + sprintf(buf,"{R%-18s %-5d {x", skill_table[sn].name,skill_table[sn].rating[ch->class]); + tmpskill = skill_table[sn].rating[ch->class]; + } + if ( (ch->pcdata->tier == 2) + && !ch->pcdata->learned[sn] + && skill_table[sn].rating[ch->clasb] > 0 + && skill_table[sn].spell_fun == spell_null) + { + sprintf(buf,"{B%-18s %-5d {x", + skill_table[sn].name,skill_table[sn].rating[ch->clasb]); + if (nfound) + { + sprintf(buf,"{G%-18s %-5d {x", + skill_table[sn].name, + UMIN(tmpskill, skill_table[sn].rating[ch->clasb]) ); + } + nfound = TRUE; + } + if (nfound) + { send_to_char(buf,ch); if (++col % 3 == 0) send_to_char("\n\r",ch); - } + } } if (col % 3 != 0) send_to_char("\n\r",ch); @@ -171,8 +227,32 @@ return; } + if (!str_prefix(arg,"quest")) + { + if (ch->qps < 3) + { + act("$N tells you '{aYou are not yet ready.{x'", + ch,NULL,trainer,TO_CHAR); + return; + } + + act("$N helps you apply your quest points to training", + ch,NULL,trainer,TO_CHAR); + ch->qps -= 3; + ch->train += 1; + return; + } + if (!str_prefix(arg,"points")) { + + if (!IS_NPC(ch) && IS_SET(ch->act, PLR_LQUEST)) + { + act("$N tells you '{aYou may not gain points while on a level quest.{x'", + ch,NULL,trainer,TO_CHAR); + return; + } + if (ch->train < 2) { act("$N tells you '{aYou are not yet ready.{x'", @@ -208,25 +288,55 @@ return; } - if (group_table[gn].rating[ch->class] <= 0) + if (ch->pcdata->tier != 2) { - act("$N tells you '{aThat group is beyond your powers.{x'", - ch,NULL,trainer,TO_CHAR); - return; - } + if (group_table[gn].rating[ch->class] <= 0) + { + act("$N tells you '{aThat group is beyond your powers.{x'", + ch,NULL,trainer,TO_CHAR); + return; + } - if (ch->train < group_table[gn].rating[ch->class]) - { - act("$N tells you '{aYou are not yet ready for that group.{x'", - ch,NULL,trainer,TO_CHAR); - return; + if (ch->train < group_table[gn].rating[ch->class]) + { + act("$N tells you '{aYou are not yet ready for that group.{x'", + ch,NULL,trainer,TO_CHAR); + return; + } + } else { + if ( ( group_table[gn].rating[ch->class] <= 0 ) + && ( group_table[gn].rating[ch->clasb] <= 0 ) ) + { + act("$N tells you '{aThat group is beyond your powers.{x'", + ch,NULL,trainer,TO_CHAR); + return; + } + + if ( ( ch->train < group_table[gn].rating[ch->class] ) + && ( ch->train < group_table[gn].rating[ch->clasb] ) ) + { + act("$N tells you '{aYou are not yet ready for that group.{x'", + ch,NULL,trainer,TO_CHAR); + return; + } } /* add the group */ gn_add(ch,gn); act("$N trains you in the art of $t", ch,group_table[gn].name,trainer,TO_CHAR); - ch->train -= group_table[gn].rating[ch->class]; + if (ch->pcdata->tier != 2) + { + ch->train -= group_table[gn].rating[ch->class]; + } else { + int tmptrain = 999; + + if (group_table[gn].rating[ch->class] > 0) + tmptrain = group_table[gn].rating[ch->class]; + if (group_table[gn].rating[ch->clasb] > 0) + tmptrain = UMIN(tmptrain, group_table[gn].rating[ch->clasb]); + ch->train -= tmptrain; + } return; } @@ -239,7 +349,6 @@ ch,NULL,trainer,TO_CHAR); return; } - if (ch->pcdata->learned[sn]) { @@ -248,25 +357,57 @@ return; } - if (skill_table[sn].rating[ch->class] <= 0) - { - act("$N tells you '{aThat skill is beyond your powers.{x'", - ch,NULL,trainer,TO_CHAR); - return; - } + if (ch->pcdata->tier != 2) + { + if (skill_table[sn].rating[ch->class] <= 0) + { + act("$N tells you '{aThat skill is beyond your powers.{x'", + ch,NULL,trainer,TO_CHAR); + return; + } - if (ch->train < skill_table[sn].rating[ch->class]) - { - act("$N tells you '{aYou are not yet ready for that skill.{x'", - ch,NULL,trainer,TO_CHAR); - return; - } + if (ch->train < skill_table[sn].rating[ch->class]) + { + act("$N tells you '{aYou are not yet ready for that skill.{x'", + ch,NULL,trainer,TO_CHAR); + return; + } + } else { + if ( ( skill_table[sn].rating[ch->class] <= 0 ) + && ( skill_table[sn].rating[ch->clasb] <= 0 ) ) + { + act("$N tells you '{aThat skill is beyond your powers.{x'", + ch,NULL,trainer,TO_CHAR); + return; + } + + if ( ( ch->train < skill_table[sn].rating[ch->class] ) + && ( ch->train < skill_table[sn].rating[ch->clasb] ) ) + { + act("$N tells you '{aYou are not yet ready for that skill.{x'", + ch,NULL,trainer,TO_CHAR); + return; + } + } /* add the skill */ ch->pcdata->learned[sn] = 1; act("$N trains you in the art of $t", ch,skill_table[sn].name,trainer,TO_CHAR); - ch->train -= skill_table[sn].rating[ch->class]; + + if (ch->pcdata->tier != 2) + { + ch->train -= skill_table[sn].rating[ch->class]; + } else { + int tmptrain = 999;; + + if (skill_table[sn].rating[ch->class] > 0) + tmptrain = skill_table[sn].rating[ch->class]; + if (skill_table[sn].rating[ch->clasb] > 0) + tmptrain = UMIN(tmptrain, skill_table[sn].rating[ch->clasb]); + ch->train -= tmptrain; + } + return; } @@ -284,6 +425,7 @@ char spell_columns[LEVEL_HERO]; int sn,lev,mana; bool found = FALSE; + bool nfound = FALSE; char buf[MAX_STRING_LENGTH]; if (IS_NPC(ch)) @@ -301,23 +443,76 @@ if (skill_table[sn].name == NULL) break; + nfound = FALSE; + if (skill_table[sn].skill_level[ch->class] < LEVEL_HERO && skill_table[sn].spell_fun != spell_null && ch->pcdata->learned[sn] > 0) { + nfound = TRUE; found = TRUE; lev = skill_table[sn].skill_level[ch->class]; if (ch->level < lev) - sprintf(buf,"%-18s n/a ", skill_table[sn].name); + sprintf(buf,"{R%-18s n/a {x", skill_table[sn].name); else { mana = UMAX(skill_table[sn].min_mana, 100/(2 + ch->level - lev)); - sprintf(buf,"%-18s %3d mana ",skill_table[sn].name,mana); + sprintf(buf,"{R%-18s %3d mana {x",skill_table[sn].name,mana); } - + } + if (ch->pcdata->tier == 2) + { + if (skill_table[sn].skill_level[ch->clasb] < LEVEL_HERO + && skill_table[sn].spell_fun != spell_null + && ch->pcdata->learned[sn] > 0) + { + int nlev; + + if (!nfound) + lev = 999; + found = TRUE; + nlev = skill_table[sn].skill_level[ch->clasb]; + if (ch->level < nlev) + { + if (nlev < lev) + { + sprintf(buf,"{B%-18s n/a {x", skill_table[sn].name); + } + } else { + if (nlev < lev) + { + mana = UMAX(skill_table[sn].min_mana, + 100/(2 + ch->level - lev)); + sprintf(buf,"{B%-18s %3d mana {x",skill_table[sn].name,mana); + } + } + if (nfound) + { + if (ch->level < nlev) + { + if (nlev < lev) + { + sprintf(buf,"{G%-18s n/a {x", skill_table[sn].name); + } + } else { + if (nlev < lev) + { + mana = UMAX(skill_table[sn].min_mana, + 100/(2 + ch->level - lev)); + sprintf(buf,"{G%-18s %3d mana {x",skill_table[sn].name,mana); + } + } + } + if (nlev < lev) + lev = nlev; + nfound = TRUE; + } + } + if (nfound) + { if (spell_list[lev][0] == '\0') - sprintf(spell_list[lev],"\n\rLevel %2d: %s",lev,buf); + sprintf(spell_list[lev],"\n\r{MLevel %2d: {x%s",lev,buf); else /* append */ { if ( ++spell_columns[lev] % 2 == 0) @@ -347,6 +542,7 @@ char skill_columns[LEVEL_HERO]; int sn,lev; bool found = FALSE; + bool nfound = FALSE; char buf[MAX_STRING_LENGTH]; if (IS_NPC(ch)) @@ -364,21 +560,60 @@ if (skill_table[sn].name == NULL ) break; + nfound = FALSE; if (skill_table[sn].skill_level[ch->class] < LEVEL_HERO && skill_table[sn].spell_fun == spell_null && ch->pcdata->learned[sn] > 0) { found = TRUE; - lev = skill_table[sn].skill_level[ch->class]; + nfound = TRUE; + lev = skill_table[sn].skill_level[ch->class]; if (ch->level < lev) - sprintf(buf,"%-18s n/a ", skill_table[sn].name); + sprintf(buf,"{R%-18s n/a {x", skill_table[sn].name); else - sprintf(buf,"%-18s %3d%% ",skill_table[sn].name, + sprintf(buf,"{R%-18s %3d%% {x",skill_table[sn].name, ch->pcdata->learned[sn]); - + } + + if (ch->pcdata->tier == 2) + { + if (skill_table[sn].skill_level[ch->clasb] < LEVEL_HERO && + skill_table[sn].spell_fun == spell_null && + ch->pcdata->learned[sn] > 0) + { + int nlev; + + if (!nfound) + lev = 999; + found = TRUE; + nlev = skill_table[sn].skill_level[ch->clasb]; + if (ch->level < nlev) + { + sprintf(buf,"{B%-18s n/a {x", skill_table[sn].name); + } else { + sprintf(buf,"{B%-18s %3d%% {x",skill_table[sn].name, + ch->pcdata->learned[sn]); + } + if (nlev < lev) + lev = nlev; + if (nfound) + { + if (ch->level < lev) + { + sprintf(buf,"{G%-18s n/a {x", skill_table[sn].name); + } else { + sprintf(buf,"{G%-18s %3d%% {x",skill_table[sn].name, + ch->pcdata->learned[sn]); + } + } + nfound = TRUE; + } + } + if (nfound) + { if (skill_list[lev][0] == '\0') - sprintf(skill_list[lev],"\n\rLevel %2d: %s",lev,buf); + sprintf(skill_list[lev],"\n\r{MLevel %2d: {x%s",lev,buf); else /* append */ { if ( ++skill_columns[lev] % 2 == 0) @@ -414,11 +649,15 @@ col = 0; - sprintf(buf,"%-18s %-5s %-18s %-5s %-18s %-5s\n\r","group","cp","group","cp","group","cp"); + sprintf(buf,"{M%-18s {Y%-5s {M%-18s {Y%-5s {M%-18s {Y%-5s{x\n\r", + "group","cp","group","cp","group","cp"); send_to_char(buf,ch); for (gn = 0; gn < MAX_GROUP; gn++) { + bool found = FALSE; + int tmpcost = 999; + if (group_table[gn].name == NULL) break; @@ -426,8 +665,33 @@ && !ch->pcdata->group_known[gn] && group_table[gn].rating[ch->class] > 0) { - sprintf(buf,"%-18s %-5d ",group_table[gn].name, - group_table[gn].rating[ch->class]); + found = TRUE; + sprintf(buf,"{R%-18s %-5d {x",group_table[gn].name, + group_table[gn].rating[ch->class]); + tmpcost = group_table[gn].rating[ch->class]; + } + if (ch->pcdata->tier == 2) + { + if (!ch->gen_data->group_chosen[gn] + && !ch->pcdata->group_known[gn] + && group_table[gn].rating[ch->clasb] > 0) + { + sprintf(buf,"{B%-18s %-5d {x",group_table[gn].name, + group_table[gn].rating[ch->clasb]); + if (group_table[gn].rating[ch->clasb] < tmpcost) + { + tmpcost = group_table[gn].rating[ch->clasb]; + } + if (found) + { + sprintf(buf,"{G%-18s %-5d {x",group_table[gn].name, + tmpcost); + } + found = TRUE; + } + } + if (found) + { send_to_char(buf,ch); if (++col % 3 == 0) send_to_char("\n\r",ch); @@ -439,11 +703,15 @@ col = 0; - sprintf(buf,"%-18s %-5s %-18s %-5s %-18s %-5s\n\r","skill","cp","skill","cp","skill","cp"); + sprintf(buf,"{M%-18s {Y%-5s {M%-18s {Y%-5s {M%-18s {Y%-5s{x\n\r", + "skill","cp","skill","cp","skill","cp"); send_to_char(buf,ch); for (sn = 0; sn < MAX_SKILL; sn++) { + bool found = FALSE; + int tmpcost = 999; + if (skill_table[sn].name == NULL) break; @@ -452,8 +720,34 @@ && skill_table[sn].spell_fun == spell_null && skill_table[sn].rating[ch->class] > 0) { - sprintf(buf,"%-18s %-5d ",skill_table[sn].name, + found = TRUE; + sprintf(buf,"{R%-18s %-5d {x",skill_table[sn].name, skill_table[sn].rating[ch->class]); + tmpcost = skill_table[sn].rating[ch->class]; + } + if (ch->pcdata->tier == 2) + { + if (!ch->gen_data->skill_chosen[sn] + && ch->pcdata->learned[sn] == 0 + && skill_table[sn].spell_fun == spell_null + && skill_table[sn].rating[ch->clasb] > 0) + { + sprintf(buf,"{B%-18s %-5d {x",skill_table[sn].name, + skill_table[sn].rating[ch->clasb]); + if (skill_table[sn].rating[ch->clasb] < tmpcost) + { + tmpcost = skill_table[sn].rating[ch->clasb]; + } + if (found) + { + sprintf(buf,"{G%-18s %-5d {x",skill_table[sn].name, + tmpcost); + } + found = TRUE; + } + } + if (found) + { send_to_char(buf,ch); if (++col % 3 == 0) send_to_char("\n\r",ch); @@ -482,23 +776,46 @@ col = 0; - sprintf(buf,"%-18s %-5s %-18s %-5s %-18s %-5s","group","cp","group","cp","group","cp\n\r"); + sprintf(buf,"{M%-18s {Y%-5s {M%-18s {Y%-5s {M%-18s {Y%-5s{x\n\r", + "group","cp","group","cp","group","cp"); send_to_char(buf,ch); for (gn = 0; gn < MAX_GROUP; gn++) { + bool found = FALSE; + if (group_table[gn].name == NULL) break; if (ch->gen_data->group_chosen[gn] && group_table[gn].rating[ch->class] > 0) { - sprintf(buf,"%-18s %-5d ",group_table[gn].name, + found = TRUE; + sprintf(buf,"{R%-18s %-5d {x",group_table[gn].name, group_table[gn].rating[ch->class]); + } + if (ch->pcdata->tier == 2) + { + if (ch->gen_data->group_chosen[gn] + && group_table[gn].rating[ch->clasb] > 0) + { + sprintf(buf,"{B%-18s %-5d {x",group_table[gn].name, + group_table[gn].rating[ch->clasb]); + if (found) + { + sprintf(buf,"{G%-18s %-5d {x",group_table[gn].name, + UMIN(group_table[gn].rating[ch->class], group_table[gn].rating[ch->clasb])); + } + found = TRUE; + } + } + if (found) + { send_to_char(buf,ch); if (++col % 3 == 0) send_to_char("\n\r",ch); } + } if ( col % 3 != 0 ) send_to_char( "\n\r", ch ); @@ -506,19 +823,41 @@ col = 0; - sprintf(buf,"%-18s %-5s %-18s %-5s %-18s %-5s","skill","cp","skill","cp","skill","cp\n\r"); + sprintf(buf,"{M%-18s {Y%-5s {M%-18s {Y%-5s {M%-18s {Y%-5s{x\n\r", + "skill","cp","skill","cp","skill","cp"); send_to_char(buf,ch); for (sn = 0; sn < MAX_SKILL; sn++) { + bool found = FALSE; + if (skill_table[sn].name == NULL) break; if (ch->gen_data->skill_chosen[sn] && skill_table[sn].rating[ch->class] > 0) { - sprintf(buf,"%-18s %-5d ",skill_table[sn].name, + found = TRUE; + sprintf(buf,"{R%-18s %-5d {x",skill_table[sn].name, skill_table[sn].rating[ch->class]); + } + if (ch->pcdata->tier == 2) + { + if (ch->gen_data->skill_chosen[sn] + && skill_table[sn].rating[ch->clasb] > 0) + { + sprintf(buf,"{B%-18s %-5d {x",skill_table[sn].name, + skill_table[sn].rating[ch->clasb]); + } + if (found) + { + sprintf(buf,"{G%-18s %-5d {x",skill_table[sn].name, + skill_table[sn].rating[ch->clasb]); + } + found = TRUE; + } + if (found) + { send_to_char(buf,ch); if (++col % 3 == 0) send_to_char("\n\r",ch); @@ -528,9 +867,9 @@ send_to_char( "\n\r", ch ); send_to_char("\n\r",ch); - sprintf(buf,"Creation points: %d\n\r",ch->gen_data->points_chosen); + sprintf(buf,"{MCreation points: {C%d{x\n\r",ch->gen_data->points_chosen); send_to_char(buf,ch); - sprintf(buf,"Experience per level: %ld\n\r", + sprintf(buf,"{MExperience per level: {C%ld{x\n\r", exp_per_level(ch,ch->gen_data->points_chosen)); send_to_char(buf,ch); return; @@ -547,7 +886,20 @@ inc = 500; if (points < 40) - return 1000 * pc_race_table[ch->race].class_mult[ch->class]/100; + { + if (ch->pcdata->tier != 2) + { + return 1000 * pc_race_table[ch->race].class_mult[ch->class]/100; + } else { + long rpoint; + + rpoint = ( ( ( 1000 * pc_race_table[ch->race].class_mult[ch->class]/100 ) + + ( 1000 * pc_race_table[ch->race].class_mult[ch->class]/100 ) + + ( 1000 * pc_race_table[ch->race].class_mult[ch->clasb]/100 ) ) + / 3 ); + return (long)rpoint; + } + } /* processing */ points -= 40; @@ -566,7 +918,18 @@ expl += (long)points * (long)inc / 10; - return (long)expl * (long)pc_race_table[ch->race].class_mult[ch->class]/100; + if (ch->pcdata->tier != 2) + { + return (long)expl * (long)pc_race_table[ch->race].class_mult[ch->class]/100; + } else { + long rpoint; + + rpoint = ( ( ( (long)expl * (long)pc_race_table[ch->race].class_mult[ch->class]/100 ) + + ( (long)expl * (long)pc_race_table[ch->race].class_mult[ch->class]/100 ) + + ( (long)expl * (long)pc_race_table[ch->race].class_mult[ch->clasb]/100 ) ) + / 3 ); + return (long)rpoint; + } } /* this procedure handles the input parsing for the skill generator */ @@ -579,6 +942,9 @@ if (argument[0] == '\0') return FALSE; + if (IS_NPC(ch)) + return FALSE; + argument = one_argument(argument,arg); if (!str_prefix(arg,"help")) @@ -604,6 +970,8 @@ gn = group_lookup(argument); if (gn != -1) { + bool found = FALSE; + if (ch->gen_data->group_chosen[gn] || ch->pcdata->group_known[gn]) { @@ -613,11 +981,28 @@ if (group_table[gn].rating[ch->class] < 1) { + found = TRUE; + } + if (ch->pcdata->tier == 2) + if (group_table[gn].rating[ch->clasb] > 0) + found = FALSE; + if (found) + { send_to_char("That group is not available.\n\r",ch); return TRUE; } + found = FALSE; if (exp_per_level(ch,ch->gen_data->points_chosen+group_table[gn].rating[ch->class]) > 500000) { + found = TRUE; + send_to_char("That will take you over the Exp/Level limit.\n\r",ch); + return TRUE; + } + if (ch->pcdata->tier == 2) + if (exp_per_level(ch,ch->gen_data->points_chosen+group_table[gn].rating[ch->clasb]) <= 500000) + found = FALSE; + if (found) + { send_to_char("That will take you over the Exp/Level limit.\n\r",ch); return TRUE; } @@ -625,15 +1010,47 @@ sprintf(buf,"%s group added\n\r",group_table[gn].name); send_to_char(buf,ch); ch->gen_data->group_chosen[gn] = TRUE; - ch->gen_data->points_chosen += group_table[gn].rating[ch->class]; + if (ch->pcdata->tier != 2) + { + ch->gen_data->points_chosen += group_table[gn].rating[ch->class]; + } else { + if (group_table[gn].rating[ch->class] < 1) + { + ch->gen_data->points_chosen += group_table[gn].rating[ch->clasb]; + } else if (group_table[gn].rating[ch->clasb] < 1) + { + ch->gen_data->points_chosen += group_table[gn].rating[ch->class]; + } else { + ch->gen_data->points_chosen += UMIN( + group_table[gn].rating[ch->class], + group_table[gn].rating[ch->clasb]); + } + } gn_add(ch,gn); - ch->pcdata->points += group_table[gn].rating[ch->class]; + if (ch->pcdata->tier != 2) + { + ch->pcdata->points += group_table[gn].rating[ch->class]; + } else { + if (group_table[gn].rating[ch->class] < 1) + { + ch->pcdata->points += group_table[gn].rating[ch->clasb]; + } else if (group_table[gn].rating[ch->clasb] < 1) + { + ch->pcdata->points += group_table[gn].rating[ch->class]; + } else { + ch->pcdata->points += UMIN( + group_table[gn].rating[ch->class], + group_table[gn].rating[ch->clasb]); + } + } return TRUE; } sn = skill_lookup(argument); if (sn != -1) { + bool found = FALSE; + if (ch->gen_data->skill_chosen[sn] || ch->pcdata->learned[sn] > 0) { @@ -641,18 +1058,55 @@ return TRUE; } - if (skill_table[sn].rating[ch->class] < 1 - || skill_table[sn].spell_fun != spell_null) + if (skill_table[sn].rating[ch->class] < 1) + found = TRUE; + if (ch->pcdata->tier == 2) + if (skill_table[sn].rating[ch->class] > 0) + found = FALSE; + if (skill_table[sn].spell_fun != spell_null) + found = TRUE; + if (found) { send_to_char("That skill is not available.\n\r",ch); return TRUE; } + sprintf(buf, "%s skill added\n\r",skill_table[sn].name); send_to_char(buf,ch); ch->gen_data->skill_chosen[sn] = TRUE; - ch->gen_data->points_chosen += skill_table[sn].rating[ch->class]; + if (ch->pcdata->tier != 2) + { + ch->gen_data->points_chosen += skill_table[sn].rating[ch->class]; + } else { + if (skill_table[sn].rating[ch->class] < 1) + { + ch->gen_data->points_chosen += skill_table[sn].rating[ch->clasb]; + } else if (skill_table[sn].rating[ch->clasb] < 1) + { + ch->gen_data->points_chosen += skill_table[sn].rating[ch->class]; + } else { + ch->gen_data->points_chosen += UMIN( + skill_table[sn].rating[ch->class], + skill_table[sn].rating[ch->clasb]); + } + } ch->pcdata->learned[sn] = 1; - ch->pcdata->points += skill_table[sn].rating[ch->class]; + if (ch->pcdata->tier != 2) + { + ch->pcdata->points += skill_table[sn].rating[ch->class]; + } else { + if (skill_table[sn].rating[ch->class] < 1) + { + ch->pcdata->points += skill_table[sn].rating[ch->clasb]; + } else if (skill_table[sn].rating[ch->clasb] < 1) + { + ch->pcdata->points += skill_table[sn].rating[ch->class]; + } else { + ch->pcdata->points += UMIN( + skill_table[sn].rating[ch->class], + skill_table[sn].rating[ch->clasb]); + } + } return TRUE; } @@ -673,14 +1127,44 @@ { send_to_char("Group dropped.\n\r",ch); ch->gen_data->group_chosen[gn] = FALSE; - ch->gen_data->points_chosen -= group_table[gn].rating[ch->class]; + if (ch->pcdata->tier != 2) + { + ch->gen_data->points_chosen -= group_table[gn].rating[ch->class]; + } else { + if (group_table[gn].rating[ch->class] < 1) + { + ch->gen_data->points_chosen -= group_table[gn].rating[ch->clasb]; + } else if (group_table[gn].rating[ch->clasb] < 1) + { + ch->gen_data->points_chosen -= group_table[gn].rating[ch->class]; + } else { + ch->gen_data->points_chosen -= UMIN( + group_table[gn].rating[ch->class], + group_table[gn].rating[ch->clasb]); + } + } gn_remove(ch,gn); for (i = 0; i < MAX_GROUP; i++) { if (ch->gen_data->group_chosen[gn]) gn_add(ch,gn); } - ch->pcdata->points -= group_table[gn].rating[ch->class]; + if (ch->pcdata->tier != 2) + { + ch->pcdata->points -= group_table[gn].rating[ch->class]; + } else { + if (group_table[gn].rating[ch->class] < 1) + { + ch->pcdata->points -= group_table[gn].rating[ch->clasb]; + } else if (group_table[gn].rating[ch->clasb] < 1) + { + ch->pcdata->points -= group_table[gn].rating[ch->class]; + } else { + ch->pcdata->points -= UMIN( + group_table[gn].rating[ch->class], + group_table[gn].rating[ch->clasb]); + } + } return TRUE; } @@ -689,9 +1173,39 @@ { send_to_char("Skill dropped.\n\r",ch); ch->gen_data->skill_chosen[sn] = FALSE; - ch->gen_data->points_chosen -= skill_table[sn].rating[ch->class]; + if (ch->pcdata->tier != 2) + { + ch->gen_data->points_chosen -= skill_table[sn].rating[ch->class]; + } else { + if (skill_table[sn].rating[ch->class] < 1) + { + ch->gen_data->points_chosen -= skill_table[sn].rating[ch->clasb]; + } else if (skill_table[sn].rating[ch->clasb] < 1) + { + ch->gen_data->points_chosen -= skill_table[sn].rating[ch->class]; + } else { + ch->gen_data->points_chosen -= UMIN( + skill_table[sn].rating[ch->class], + skill_table[sn].rating[ch->clasb]); + } + } ch->pcdata->learned[sn] = 0; - ch->pcdata->points -= skill_table[sn].rating[ch->class]; + if (ch->pcdata->tier != 2) + { + ch->pcdata->points -= skill_table[sn].rating[ch->class]; + } else { + if (skill_table[sn].rating[ch->class] < 1) + { + ch->pcdata->points -= skill_table[sn].rating[ch->clasb]; + } else if (skill_table[sn].rating[ch->clasb] < 1) + { + ch->pcdata->points -= skill_table[sn].rating[ch->class]; + } else { + ch->pcdata->points -= UMIN( + skill_table[sn].rating[ch->class], + skill_table[sn].rating[ch->clasb]); + } + } return TRUE; } @@ -806,15 +1320,22 @@ /* shows all groups, or the sub-members of a group available to your class*/ void do_class(CHAR_DATA *ch, char *argument) { - char buf[100]; - int gn,sn,tn,col; + char arg[MAX_INPUT_LENGTH]; + char buf[MAX_STRING_LENGTH]; + int gn,sn,tn,col,class,clasb; + bool found = FALSE; if (IS_NPC(ch)) return; col = 0; + argument = one_argument(argument,arg); + class = class_lookup(arg); + if (class != -1) + argument = one_argument(argument,arg); - if (argument[0] == '\0') + clasb = -1; + if (arg[0] == '\0') { /* show all groups */ send_to_char( "Groups you currently have:\n\r", ch ); @@ -835,20 +1356,47 @@ send_to_char( "\n\r", ch ); sprintf(buf,"Creation points: %d\n\r",ch->pcdata->points); send_to_char(buf,ch); + buf[0] = '\0'; return; } - if (!str_cmp(argument,"all")) /* show all groups */ + if (!str_cmp(arg,"all")) /* show all groups */ { - send_to_char( "Groups available to your class:\n\r", ch ); - send_to_char( "-------------------------------\n\r", ch ); + if (class == -1) + { + send_to_char( "{MGroups available to your character:{x\n\r", ch ); + class = ch->class; + if (ch->pcdata->tier == 2) + clasb = ch->clasb; + } + else + send_to_char( "{M Groups available to this class:{x\n\r", ch ); + send_to_char( "-----------------------------------\n\r", ch ); for (gn = 0; gn < MAX_GROUP; gn++) { + found = FALSE; + if (group_table[gn].name == NULL) break; - if (group_table[gn].rating[ch->class] > 0) + if (group_table[gn].rating[class] > 0) + { + found = TRUE; + sprintf(buf,"{R%-20s {x",group_table[gn].name); + } + if ( ( ch->pcdata->tier == 2 ) && ( clasb != -1 ) ) + { + if (group_table[gn].rating[clasb] > 0) + { + sprintf(buf,"{B%-20s {x",group_table[gn].name); + if (found) + { + sprintf(buf,"{G%-20s {x",group_table[gn].name); + } + found = TRUE; + } + } + if (found) { - sprintf(buf,"%-20s ",group_table[gn].name); send_to_char(buf,ch); if (++col % 3 == 0) send_to_char("\n\r",ch); @@ -856,43 +1404,156 @@ } if ( col % 3 != 0 ) send_to_char( "\n\r", ch ); + buf[0] = '\0'; return; } - - + + if (!str_cmp(arg,"skill")) /* show all skills */ + { + if (class == -1) + { + send_to_char( "{MSkills available to your character:{x\n\r", ch ); + class = ch->class; + if (ch->pcdata->tier == 2) + clasb = ch->clasb; + } + else + send_to_char( "{M Skills available to this class:{x\n\r", ch ); + send_to_char( "-----------------------------------\n\r", ch ); + send_to_char( "{MLevel{x-{YSkill{x--------------- {YLevel{x-{YSkill{x---------------\n\r", ch ); + for (sn = 0; sn < MAX_SKILL; sn++) + { + found = FALSE; + + if (skill_table[sn].name == NULL) + break; + + if (skill_table[sn].rating[class] > 0) + { + found = TRUE; + sprintf(buf,"{R%-5d %-20s {x", + skill_table[sn].skill_level[class],skill_table[sn].name); + } + if ( ( ch->pcdata->tier == 2 ) && ( clasb != -1 ) ) + { + if (skill_table[sn].rating[clasb] > 0 ) + { + sprintf(buf,"{B%-5d %-20s {x", + skill_table[sn].skill_level[clasb],skill_table[sn].name); + if (found) + { + sprintf(buf,"{G%-5d %-20s {x", + UMIN(skill_table[sn].skill_level[class], + skill_table[sn].skill_level[clasb]), + skill_table[sn].name); + } + found = TRUE; + } + } + if (skill_table[sn].spell_fun != spell_null) + found = FALSE; + if (found) + { + send_to_char(buf,ch); + if (++col % 2 == 0) + send_to_char("\n\r",ch); + } + } + if (col % 2 != 0) + send_to_char("\n\r",ch); + buf[0] = '\0'; + return; + } + /* show the sub-members of a group */ - gn = group_lookup(argument); + gn = group_lookup(arg); if (gn == -1) { - send_to_char("No group of that name exist.\n\r",ch); - send_to_char( - "Type 'class all' for a full listing.\n\r",ch); + send_to_char("No group of that name exists.\n\r",ch); + send_to_char("Type 'class all' for a full listing.\n\r",ch); return; } + if ( (ch->pcdata->tier != 2) || (class != -1) ) + { + if (class == -1) + class = ch->class; + if (group_table[gn].rating[class] < 1) + { + send_to_char("This class does not get that group.\n\r",ch); + send_to_char("Type 'class all' for a full listing.\n\r",ch); + return; + } + } else if (class != -1) + { + if (group_table[gn].rating[class] < 1) + { + send_to_char("This class does not get that group.\n\r",ch); + send_to_char("Type 'class all' for a full listing.\n\r",ch); + return; + } + } else { + class = ch->class; + clasb = ch->clasb; + if ( ( group_table[gn].rating[class] < 1 ) + && ( group_table[gn].rating[clasb] < 1 ) ) + { + send_to_char("This character does not get that group.\n\r",ch); + send_to_char("Type 'class all' for a full listing.\n\r",ch); + return; + } + } - send_to_char( "Spells available in this group:\n\r", ch ); + send_to_char( "{MSpells available in this group:{x\n\r", ch ); send_to_char( "-------------------------------\n\r", ch ); - send_to_char( "{BLevel{x-{GSpell{x--------------- {BLevel{x-{GSpell{x---------------\n\r", ch ); + send_to_char( "{MLevel{x-{YSpell{x--------------- {MLevel{x-{YSpell{x---------------\n\r", ch ); + if (class == -1) + { + class = ch->class; + if (ch->pcdata->tier == 2) + clasb = ch->clasb; + } for (sn = 0; sn < MAX_IN_GROUP; sn++) { + found = FALSE; if (group_table[gn].spells[sn] == NULL) break; - if ( ( tn = spell_avail( ch, group_table[gn].spells[sn] ) ) >= 0) + if ( ( tn = spell_avail_class( ch, group_table[gn].spells[sn] ) ) >= 0) + { + found = TRUE; + sprintf(buf,"{R%-5d %-20s {x", + skill_table[tn].skill_level[class], group_table[gn].spells[sn]); + } + if (ch->pcdata->tier == 2) + { + if ( ( tn = spell_avail_clasb( ch, group_table[gn].spells[sn] ) ) >= 0) + { + sprintf(buf,"{B%-5d %-20s {x", + skill_table[tn].skill_level[clasb], group_table[gn].spells[sn]); + } + if (found) + { + sprintf(buf,"{G%-5d %-20s {x", + UMIN(skill_table[tn].skill_level[class], + skill_table[tn].skill_level[clasb]), + group_table[gn].spells[sn]); + } + found = TRUE; + } + if (found) { - sprintf(buf,"{B%-5d {G%-20s ", - skill_table[tn].skill_level[ch->class], group_table[gn].spells[sn]); send_to_char(buf,ch); if (++col % 2 == 0) - send_to_char("{x\n\r",ch); + send_to_char("\n\r",ch); } } + buf[0] = '\0'; if ( col % 2 != 0 ) - send_to_char( "{x\n\r", ch ); + send_to_char( "\n\r", ch ); } int spell_avail( CHAR_DATA *ch, const char *name ) { - /* checks to see if a spell is available to a class */ + /* checks to see if a spell is available to either class */ int sn, found = -1; if (IS_NPC(ch)) @@ -907,6 +1568,56 @@ { if (skill_table[sn].skill_level[ch->class] <= LEVEL_HERO) return sn; + if (ch->pcdata->tier == 2) + { + if (skill_table[sn].skill_level[ch->clasb] <= LEVEL_HERO) + return sn; + } + } + } + return found; +} +int spell_avail_class( CHAR_DATA *ch, const char *name ) +{ + /* checks to see if a spell is available to a primary class */ + int sn, found = -1; + + if (IS_NPC(ch)) + return skill_lookup(name); + + for ( sn = 0; sn < MAX_SKILL; sn++ ) + { + if (skill_table[sn].name == NULL) + break; + if (LOWER(name[0]) == LOWER(skill_table[sn].name[0]) + && !str_prefix(name,skill_table[sn].name)) + { + if (skill_table[sn].skill_level[ch->class] <= LEVEL_HERO) + return sn; + } + } + return found; +} +int spell_avail_clasb( CHAR_DATA *ch, const char *name ) +{ + /* checks to see if a spell is available to a secondary class */ + int sn, found = -1; + + if (IS_NPC(ch)) + return skill_lookup(name); + + if (ch->pcdata->tier != 2) + return found; + + for ( sn = 0; sn < MAX_SKILL; sn++ ) + { + if (skill_table[sn].name == NULL) + break; + if (LOWER(name[0]) == LOWER(skill_table[sn].name[0]) + && !str_prefix(name,skill_table[sn].name)) + { + if (skill_table[sn].skill_level[ch->clasb] <= LEVEL_HERO) + return sn; } } return found; @@ -917,6 +1628,7 @@ { int chance; char buf[100]; + bool found = FALSE; if (IS_NPC(ch)) return; @@ -925,13 +1637,49 @@ || skill_table[sn].rating[ch->class] == 0 || ch->pcdata->learned[sn] == 0 || ch->pcdata->learned[sn] == 100) - return; /* skill is not known */ + { + found = TRUE; + } + if (ch->pcdata->tier != 2) + { + if (found) + return; /* skill is not known */ + } else if (found) { + if (ch->level < skill_table[sn].skill_level[ch->clasb] + || skill_table[sn].rating[ch->clasb] == 0 + || ch->pcdata->learned[sn] == 0 + || ch->pcdata->learned[sn] == 100) + { + return; /* skill is not known */ + } + } /* check to see if the character has a chance to learn */ chance = 10 * int_app[get_curr_stat(ch,STAT_INT)].learn; - chance /= ( multiplier - * skill_table[sn].rating[ch->class] - * 4); + if (ch->pcdata->tier != 2) + { + chance /= ( multiplier + * skill_table[sn].rating[ch->class] + * 4); + } else { + if (skill_table[sn].rating[ch->clasb] < 1) + { + chance /= ( multiplier + * skill_table[sn].rating[ch->class] + * 4); + } else if (skill_table[sn].rating[ch->class] < 1) + { + chance /= ( multiplier + * skill_table[sn].rating[ch->clasb] + * 4); + } else + { + chance /= ( multiplier + * UMIN(skill_table[sn].rating[ch->class], + skill_table[sn].rating[ch->clasb]) + * 4); + } + } chance += ch->level; if (number_range(1,1000) > chance) @@ -948,7 +1696,26 @@ skill_table[sn].name); send_to_char(buf,ch); ch->pcdata->learned[sn]++; - gain_exp(ch,2 * skill_table[sn].rating[ch->class]); + if (!IS_SET(ch->act, PLR_LQUEST)) + { + if (ch->pcdata->tier != 2) + { + gain_exp(ch,2 * skill_table[sn].rating[ch->class]); + } else + { + if (skill_table[sn].rating[ch->clasb] < 1) + { + gain_exp(ch,2 * skill_table[sn].rating[ch->class]); + } else if (skill_table[sn].rating[ch->class] < 1) + { + gain_exp(ch,2 * skill_table[sn].rating[ch->clasb]); + } else + { + gain_exp(ch,2 * UMIN(skill_table[sn].rating[ch->class], + skill_table[sn].rating[ch->clasb])); + } + } + } } } @@ -963,7 +1730,26 @@ send_to_char(buf,ch); ch->pcdata->learned[sn] += number_range(1,3); ch->pcdata->learned[sn] = UMIN(ch->pcdata->learned[sn],100); - gain_exp(ch,2 * skill_table[sn].rating[ch->class]); + if (!IS_SET(ch->act, PLR_LQUEST)) + { + if (ch->pcdata->tier != 2) + { + gain_exp(ch,2 * skill_table[sn].rating[ch->class]); + } else + { + if (skill_table[sn].rating[ch->clasb] < 1) + { + gain_exp(ch,2 * skill_table[sn].rating[ch->class]); + } else if (skill_table[sn].rating[ch->class] < 1) + { + gain_exp(ch,2 * skill_table[sn].rating[ch->clasb]); + } else + { + gain_exp(ch,2 * UMIN(skill_table[sn].rating[ch->class], + skill_table[sn].rating[ch->clasb])); + } + } + } } } } @@ -1030,7 +1816,26 @@ { ch->pcdata->learned[sn] = 1; if (deduct) - ch->pcdata->points += skill_table[sn].rating[ch->class]; + { + if (ch->pcdata->tier != 2) + { + ch->pcdata->points += skill_table[sn].rating[ch->class]; + } else + { + if (skill_table[sn].rating[ch->clasb] < 1) + { + ch->pcdata->points += skill_table[sn].rating[ch->class]; + } else if (skill_table[sn].rating[ch->class] < 1) + { + ch->pcdata->points += skill_table[sn].rating[ch->clasb]; + } else + { + ch->pcdata->points += UMIN(skill_table[sn].rating[ch->class], + skill_table[sn].rating[ch->clasb]); + } + } + } + } return; } @@ -1045,7 +1850,25 @@ { ch->pcdata->group_known[gn] = TRUE; if (deduct) - ch->pcdata->points += group_table[gn].rating[ch->class]; + { + if (ch->pcdata->tier != 2) + { + ch->pcdata->points += group_table[gn].rating[ch->class]; + } else + { + if (group_table[gn].rating[ch->clasb] < 1) + { + ch->pcdata->points += group_table[gn].rating[ch->class]; + } else if (group_table[gn].rating[ch->class] < 1) + { + ch->pcdata->points += group_table[gn].rating[ch->clasb]; + } else + { + ch->pcdata->points += UMIN(group_table[gn].rating[ch->class], + group_table[gn].rating[ch->clasb]); + } + } + } } gn_add(ch,gn); /* make sure all skills in the group are known */ } --- special.c Mon Aug 25 13:51:10 1997 +++ ../../Rot20/src/special.c Fri Aug 6 23:06:04 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -57,7 +55,6 @@ /* * The following special functions are available for mobiles. */ -DECLARE_SPEC_FUN( spec_boaz ); DECLARE_SPEC_FUN( spec_breath_any ); DECLARE_SPEC_FUN( spec_breath_acid ); DECLARE_SPEC_FUN( spec_breath_fire ); @@ -86,7 +83,6 @@ /* the function table */ const struct spec_type spec_table[] = { - { "spec_boaz", spec_boaz }, { "spec_breath_any", spec_breath_any }, { "spec_breath_acid", spec_breath_acid }, { "spec_breath_fire", spec_breath_fire }, @@ -262,137 +258,6 @@ return TRUE; } -bool spec_boaz( CHAR_DATA *ch) -{ - CHAR_DATA *vch, *victim = NULL; - int count = 0; - char *message; - bool found = FALSE; - - if (!IS_AWAKE(ch) || IS_AFFECTED(ch,AFF_CALM) || ch->in_room == NULL - || IS_AFFECTED(ch,AFF_CHARM) || ch->fighting != NULL) - return FALSE; - - /* find clayton */ - for (vch = ch->in_room->people; vch != NULL; vch = vch->next_in_room) - { - if (!IS_NPC(vch)) - found = TRUE; - - if (!IS_NPC(vch) || ch == vch) - continue; - - if (vch->pIndexData->vnum == MOB_VNUM_CLAYTON) - { - if (number_range(0,count) == 0) - victim = vch; - - count++; - } - } - - if (!found) - return FALSE; - - if (victim == NULL) - return FALSE; - - switch (number_range(0,9)) - { - default: message = NULL; break; - case 0: message = NULL; break; - case 1: message = NULL; break; - case 2: message = "blank"; - break; - case 3: message = NULL; break; - case 4: message = NULL; break; - case 5: message = "blank"; - break; - case 6: message = NULL; break; - case 7: message = NULL; break; - case 8: message = NULL; break; - case 9: message = NULL; break; - } - - if (message == NULL) - return FALSE; - - /* say something, then raise hell */ - switch (number_range(0,9)) - { - default: message = NULL; break; - case 0: message = "$n yells '{aLeave me alone!{x'"; - break; - case 1: message = "With a scream of rage, $n attacks $N."; - break; - case 2: message = "$n shouts '{aStop that! Stop that!{x' and attacks."; - break; - case 3: message = NULL; break; - case 4: message = "$n snorts a line of cocaine."; - break; - case 5: message = "$n yells '{aGet out!{x'"; - break; - case 6: message = "$n shouts '{aLeave mommy alone, you little shit!{x'"; - break; - case 7: message = "$n lights up another cigarette."; - break; - case 8: message = NULL; break; - case 9: message = NULL; break; - } - - if (message != NULL) - { - act(message,ch,NULL,victim,TO_ALL); - switch (number_range(0,8)) - { - default: message = NULL; break; - case 0: message = "$n yanks $N up by the arm and throws him through the door."; - break; - case 1: message = "$n slaps $N across the face."; - break; - case 2: message = NULL; break; - case 3: message = "$n throws $N onto the couch."; - break; - case 4: message = NULL; break; - case 5: message = "$n spanks $N."; - break; - case 6: message = "$n sits down and ignores $N."; - break; - case 7: message = NULL; break; - case 8: message = NULL; break; - } - if (message != NULL) - { - act(message,ch,NULL,victim,TO_ALL); - } - } - switch (number_range(0,6)) - { - default: message = NULL; break; - case 0: message = "$N screams at $n."; - break; - case 1: message = "$N screams in pain."; - break; - case 2: message = "$N lies down and cries."; - break; - case 3: message = "$N steals his mommy's cigarettes."; - break; - case 4: message = "$N screams in agony!"; - break; - case 5: message = "$N starts wailing at the top of his lungs."; - break; - case 6: message = "$N runs to you to get away from his mommy."; - break; - } - - if (message != NULL) - { - act(message,ch,NULL,victim,TO_ALL); - } - - return TRUE; -} - bool spec_patrolman(CHAR_DATA *ch) { CHAR_DATA *vch,*victim = NULL; --- tables.c Mon Aug 25 13:51:10 1997 +++ ../../Rot20/src/tables.c Fri Aug 6 23:06:04 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer, * - * Michael Seifert, Hans Henrik Strfeldt, 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -42,6 +40,41 @@ #include "tables.h" +const struct home_type home_table[] = +{ +/* + { + "short_name", "Long Name", + good_recall_vnum, evil_recall_vnum, + pit_vnum, morgue_vnum + } +*/ + + { + "none", "None", + ROOM_VNUM_TEMPLE, ROOM_VNUM_TEMPLEB, + OBJ_VNUM_PIT, ROOM_VNUM_MORGUE + }, + + { + "midgaard", "Midgaard", + ROOM_VNUM_TEMPLE, ROOM_VNUM_TEMPLEB, + OBJ_VNUM_PIT, ROOM_VNUM_MORGUE + }, + + { + "newthalos", "New Thalos", + ROOM_VNUM_GOOD_NT, ROOM_VNUM_EVIL_NT, + OBJ_VNUM_PIT_NT, ROOM_VNUM_MORG_NT + }, + + { + NULL, NULL, + 0, 0, + 0, 0 + } +}; + /* for position */ const struct position_type position_table[] = { @@ -111,7 +144,8 @@ { "healer", aa, TRUE }, { "gain", bb, TRUE }, { "update_always", cc, TRUE }, - { "changer", dd, TRUE }, + { "banker", dd, TRUE }, + { "questmaster", ee, TRUE }, { NULL, 0, FALSE } }; @@ -270,6 +304,7 @@ { "quest", aa, TRUE }, { "forced", bb, TRUE }, { "questpoint", cc, TRUE }, + { "levelquest", dd, FALSE }, { NULL, 0, 0 } }; --- tables.h Mon Aug 25 13:51:10 1997 +++ ../../Rot20/src/tables.h Fri Aug 6 23:06:04 1999 @@ -1,39 +1,37 @@ - /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ /* game tables */ extern const struct clan_type clan_table[MAX_CLAN]; +extern const struct home_type home_table[]; extern const struct position_type position_table[]; extern const struct sex_type sex_table[]; extern const struct size_type size_table[]; @@ -79,6 +77,16 @@ char *exname; }; +struct home_type +{ + char *name; + char *who_name; + sh_int good_recall; + sh_int evil_recall; + sh_int pit; + sh_int morgue; +}; + struct position_type { char *name; --- update.c Mon Aug 25 13:51:10 1997 +++ ../../Rot20/src/update.c Sat Aug 14 20:31:11 1999 @@ -1,34 +1,32 @@ /*************************************************************************** - * 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. * - ***************************************************************************/ - +* 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh) @@ -44,6 +42,7 @@ /* command procedures needed */ DECLARE_DO_FUN(do_quit ); +DECLARE_DO_FUN(do_wake ); /* @@ -67,7 +66,7 @@ /* * Advancement stuff. */ -void advance_level( CHAR_DATA *ch ) +void change_level( CHAR_DATA *ch ) { char buf[MAX_STRING_LENGTH]; int loc, i; @@ -77,24 +76,47 @@ int add_prac; OBJ_DATA *obj; + if (IS_NPC(ch)) + return; + ch->pcdata->last_level = ( ch->played + (int) (current_time - ch->logon) ) / 3600; sprintf( buf, "the %s", title_table [ch->class] [ch->level] [ch->sex == SEX_FEMALE ? 1 : 0] ); - set_title( ch, buf ); - add_hp = con_app[get_curr_stat(ch,STAT_CON)].hitp + number_range( - class_table[ch->class].hp_min, - class_table[ch->class].hp_max ); - add_mana = number_range(4,(4*get_curr_stat(ch,STAT_INT) + if (!IS_SET(ch->comm,COMM_TITLE_LOCK)) + set_title( ch, buf ); + + if (IS_SET(ch->act, PLR_LQUEST)) + REMOVE_BIT(ch->act, PLR_LQUEST); + + if (ch->pcdata->tier != 2) + { + add_hp = con_app[get_curr_stat(ch,STAT_CON)].hitp + + number_range(class_table[ch->class].hp_min, + class_table[ch->class].hp_max ); + add_mana = number_range(4,(4*get_curr_stat(ch,STAT_INT) + + get_curr_stat(ch,STAT_WIS))/2); + if (!class_table[ch->class].fMana) + add_mana /= 3; + } else { + add_hp = con_app[get_curr_stat(ch,STAT_CON)].hitp + UMAX( + number_range(class_table[ch->class].hp_min, + class_table[ch->class].hp_max ), + number_range(class_table[ch->clasb].hp_min, + class_table[ch->clasb].hp_max )); + add_mana = number_range(4,(4*get_curr_stat(ch,STAT_INT) + get_curr_stat(ch,STAT_WIS))/2); - if (!class_table[ch->class].fMana) - add_mana /= 3; + if ((!class_table[ch->class].fMana)&&(!class_table[ch->clasb].fMana)) + add_mana /= 3; + } + add_move = number_range( 1, (get_curr_stat(ch,STAT_CON) + get_curr_stat(ch,STAT_DEX))/5 ); add_prac = wis_app[get_curr_stat(ch,STAT_WIS)].practice; + ch->can_aquest = 0; add_hp = add_hp * 9/10; add_hp = add_hp * 7/4; add_mana = add_mana * 9/10; @@ -138,10 +160,27 @@ } } } + if ((ch->level > 9) && (ch->newbie != 0)) + { + ch->newbie = 0; + send_to_char("{RYou now have full channel permissions.{x\n\r",ch); + } + if (IS_IMMORTAL(ch) && ch->clock) + ch->clock = 0; + if (ch->clock) + { + if (ch->clock <= ch->level) + { + ch->clock = 0; + send_to_char("{RYou are now authorized to change your clan status again.{x\n\r",ch); + } + } + if (IS_HERO(ch)) + ch->pcdata->advanced = 0; return; } -void advance_level_quiet( CHAR_DATA *ch ) +void change_level_quiet( CHAR_DATA *ch ) { char buf[MAX_STRING_LENGTH]; int loc, i; @@ -151,24 +190,46 @@ int add_prac; OBJ_DATA *obj; + if (IS_NPC(ch)) + return; + ch->pcdata->last_level = ( ch->played + (int) (current_time - ch->logon) ) / 3600; sprintf( buf, "the %s", title_table [ch->class] [ch->level] [ch->sex == SEX_FEMALE ? 1 : 0] ); - set_title( ch, buf ); - add_hp = con_app[get_curr_stat(ch,STAT_CON)].hitp + number_range( - class_table[ch->class].hp_min, - class_table[ch->class].hp_max ); - add_mana = number_range(4,(4*get_curr_stat(ch,STAT_INT) + if (!IS_SET(ch->comm,COMM_TITLE_LOCK)) + set_title( ch, buf ); + + if (IS_SET(ch->act, PLR_LQUEST)) + REMOVE_BIT(ch->act, PLR_LQUEST); + + if (ch->pcdata->tier != 2) + { + add_hp = con_app[get_curr_stat(ch,STAT_CON)].hitp + + number_range(class_table[ch->class].hp_min, + class_table[ch->class].hp_max ); + add_mana = number_range(4,(4*get_curr_stat(ch,STAT_INT) + get_curr_stat(ch,STAT_WIS))/2); - if (!class_table[ch->class].fMana) - add_mana /= 2; + if (!class_table[ch->class].fMana) + add_mana /= 3; + } else { + add_hp = con_app[get_curr_stat(ch,STAT_CON)].hitp + UMAX( + number_range(class_table[ch->class].hp_min, + class_table[ch->class].hp_max ), + number_range(class_table[ch->clasb].hp_min, + class_table[ch->clasb].hp_max )); + add_mana = number_range(4,(4*get_curr_stat(ch,STAT_INT) + + get_curr_stat(ch,STAT_WIS))/2); + if ((!class_table[ch->class].fMana)&&(!class_table[ch->clasb].fMana)) + add_mana /= 3; + } add_move = number_range( 1, (get_curr_stat(ch,STAT_CON) + get_curr_stat(ch,STAT_DEX))/5 ); add_prac = wis_app[get_curr_stat(ch,STAT_WIS)].practice; + ch->can_aquest = 0; add_hp = add_hp * 9/10; add_hp = add_hp * 7/4; add_mana = add_mana * 9/10; @@ -204,6 +265,23 @@ } } } + if ((ch->level > 9) && (ch->newbie != 0)) + { + ch->newbie = 0; + send_to_char("{RYou now have full channel permissions.{x\n\r",ch); + } + if (IS_IMMORTAL(ch) && ch->clock) + ch->clock = 0; + if (ch->clock) + { + if (ch->clock <= ch->level) + { + ch->clock = 0; + send_to_char("{RYou are now authorized to change your clan status again.{x\n\r",ch); + } + } + if (IS_HERO(ch)) + ch->pcdata->advanced = 0; return; } @@ -215,15 +293,37 @@ if ( IS_NPC(ch) || ch->level >= LEVEL_HERO ) return; + if (IS_SET(ch->act, PLR_LQUEST)) + return; ch->exp = UMAX( exp_per_level(ch,ch->pcdata->points), ch->exp + gain ); while ( ch->level < LEVEL_HERO && ch->exp >= exp_per_level(ch,ch->pcdata->points) * (ch->level+1) ) { + if ((ch->level == 20) + || (ch->level == 30) + || (ch->level == 40) + || (ch->level == 50) + || (ch->level == 60) + || (ch->level == 70) + || (ch->level == 80) + || (ch->level == 90) + || (ch->level == 100)) + { + ch->exp = exp_per_level(ch,ch->pcdata->points) * (ch->level+1); + ch->exp--; + sprintf(buf, "{RYou must now complete a level quest to reach level %d{x\n\r", + ch->level+1); + send_to_char(buf, ch); + SET_BIT(ch->act, PLR_LQUEST); + buf[0] = '\0'; + save_char_obj(ch); + return; + } send_to_char( "You raise a level!! ", ch ); ch->level += 1; sprintf(buf,"$N has attained level %d!",ch->level); wiznet(buf,ch,NULL,WIZ_LEVELS,0,0); - advance_level( ch ); + change_level( ch ); save_char_obj(ch); } @@ -256,13 +356,18 @@ case POS_RESTING: break; case POS_FIGHTING: gain /= 3; break; } - - } else { gain = UMAX(3,get_curr_stat(ch,STAT_CON) - 3 + ch->level/2); - gain += class_table[ch->class].hp_max - 10; + if (ch->pcdata->tier != 2) + { + gain += class_table[ch->class].hp_max - 10; + } else + { + gain += UMAX(class_table[ch->class].hp_max - 10, + class_table[ch->clasb].hp_max - 10); + } number = number_percent(); if (number < get_skill(ch,gsn_fast_healing)) { @@ -301,6 +406,9 @@ if (IS_AFFECTED(ch,AFF_HASTE) || IS_AFFECTED(ch,AFF_SLOW)) gain /=2 ; + if (ch->in_room->heal_neg) + return gain; + return UMIN(gain, ch->max_hit - ch->hit); } @@ -336,9 +444,14 @@ if (ch->mana < ch->max_mana) check_improve(ch,gsn_meditation,TRUE,8); } - if (!class_table[ch->class].fMana) - gain /= 2; - + if (ch->pcdata->tier != 2) + { + if (!class_table[ch->class].fMana) + gain /= 2; + } else { + if ((!class_table[ch->class].fMana)&&(!class_table[ch->clasb].fMana)) + gain /= 2; + } switch ( ch->position ) { default: gain /= 4; break; @@ -565,22 +678,22 @@ switch ( ++time_info.hour ) { - case 5: + case 6: weather_info.sunlight = SUN_LIGHT; strcat( buf, "The day has begun.\n\r" ); break; - case 6: + case 7: weather_info.sunlight = SUN_RISE; strcat( buf, "The sun rises in the east.\n\r" ); break; - case 19: + case 18: weather_info.sunlight = SUN_SET; strcat( buf, "The sun slowly disappears in the west.\n\r" ); break; - case 20: + case 19: weather_info.sunlight = SUN_DARK; strcat( buf, "The night has begun.\n\r" ); break; @@ -719,6 +832,7 @@ if ( ch->timer > 30 ) ch_quit = ch; + show_warning( ch ); if ( IS_NPC(ch) && ch->hastimer ) { if ( ++ch->timer > 5 ) @@ -740,15 +854,20 @@ continue; } - if ( ch->hit < ch->max_hit ) - ch->hit += hit_gain(ch); - else - ch->hit = ch->max_hit; - - if ( ch->mana < ch->max_mana ) - ch->mana += mana_gain(ch); - else - ch->mana = ch->max_mana; + if (!ch->spirit && !IS_NPC(ch)) + { + if ( ch->in_room->heal_neg && !IS_IMMORTAL(ch) ) + ch->hit -= hit_gain(ch); + else if ( ch->hit < ch->max_hit ) + ch->hit += hit_gain(ch); + else + ch->hit = ch->max_hit; + + if ( ch->mana < ch->max_mana ) + ch->mana += mana_gain(ch); + else + ch->mana = ch->max_mana; + } if ( ch->move < ch->max_move ) ch->move += move_gain(ch); @@ -756,6 +875,30 @@ ch->move = ch->max_move; } + if ( !IS_NPC(ch) && ch->spirit) + { + OBJ_DATA *obj; + bool found = FALSE; + + for ( obj = object_list; obj != NULL; obj = obj->next ) + { + if (obj->item_type != ITEM_CORPSE_PC) + continue; + + if (str_cmp(obj->owner,ch->name)) + continue; + + found = TRUE; + break; + } + + if (!found) + { + ch->spirit = 0; + send_to_char("A searing pain runs through your new body as it forms around you.\n\r",ch); + } + } + if ( ch->position == POS_STUNNED ) update_pos( ch ); @@ -798,10 +941,13 @@ } } - gain_condition( ch, COND_DRUNK, -1 ); - gain_condition( ch, COND_FULL, ch->size > SIZE_MEDIUM ? -4 : -2 ); - gain_condition( ch, COND_THIRST, -1 ); - gain_condition( ch, COND_HUNGER, ch->size > SIZE_MEDIUM ? -2 : -1); + if (!ch->spirit) + { + gain_condition( ch, COND_DRUNK, -1 ); + gain_condition( ch, COND_FULL, ch->size > SIZE_MEDIUM ? -4 : -2 ); + gain_condition( ch, COND_THIRST, -1 ); + gain_condition( ch, COND_HUNGER, ch->size > SIZE_MEDIUM ? -2 : -1); + } } for ( paf = ch->affected; paf != NULL; paf = paf_next ) @@ -832,6 +978,178 @@ } } + if (!IS_NPC(ch) && (ch->position == POS_SLEEPING) + && (!IS_SET(ch->comm,COMM_QUIET))) + { + int dream; + + dream = number_range(1, 100); + + if (dream >= 65 && dream <= 100) + { + send_to_char("zzzzzzzzzzzzzzzzzzzzzzzzz.\n\r",ch); + } else if (dream >= 25 && dream <= 50) + { + DRM_INDEX_DATA *pDrmIndex; + extern int top_drm_index; + + dream = number_range(0, top_drm_index-1); + if ( (pDrmIndex = get_drm_index( dream ) ) != NULL ) + { + DREAM_OBJECT_DATA *pobj; + DREAM_ACT_DATA *pact; + DREAM_CHANGE_DATA *pchg; + + send_to_char(pDrmIndex->description, ch); + for ( pact = pDrmIndex->act; pact != NULL; pact = pact->next) + { + act(pact->string,ch,NULL,NULL,TO_ROOM); + } + for ( pchg = pDrmIndex->change; pchg != NULL; pchg = pchg->next ) + { + if (!str_cmp(pchg->keyword, "hit")) + { + if (!str_cmp(pchg->value, "all")) + ch->hit = UMAX(ch->hit, ch->max_hit); + else if (!str_cmp(pchg->value, "none")) + ch->hit = UMIN(ch->hit, 1); + else if (!str_cmp(pchg->value, "half")) + ch->hit = UMAX(1, ch->hit/2); + else if (!str_cmp(pchg->value, "double")) + ch->hit = UMIN(ch->max_hit+(ch->max_hit/5), ch->hit*2); + else if (!str_cmp(pchg->value, "sub")) + ch->hit = UMAX(1, ch->hit-(ch->hit/10)); + else if (!str_cmp(pchg->value, "add")) + ch->hit = UMIN(ch->hit+(ch->hit/10), ch->max_hit+(ch->max_hit/5)); + else + { + sprintf( log_buf, "BUG: bad dream change value: %s", pchg->value); + log_string( log_buf ); + } + } + else if (!str_cmp(pchg->keyword, "mana")) + { + if (!str_cmp(pchg->value, "all")) + ch->mana = UMAX(ch->mana, ch->max_mana); + else if (!str_cmp(pchg->value, "none")) + ch->mana = UMIN(ch->mana, 1); + else if (!str_cmp(pchg->value, "half")) + ch->mana = UMAX(1, ch->mana/2); + else if (!str_cmp(pchg->value, "double")) + ch->mana = UMIN(ch->max_mana+(ch->max_mana/5), ch->mana*2); + else if (!str_cmp(pchg->value, "sub")) + ch->mana = UMAX(1, ch->mana-(ch->mana/10)); + else if (!str_cmp(pchg->value, "add")) + ch->mana = UMIN(ch->mana+(ch->mana/10), ch->max_mana+(ch->max_mana/5)); + else + { + sprintf( log_buf, "BUG: bad dream change value: %s", pchg->value); + log_string( log_buf ); + } + } + else if (!str_cmp(pchg->keyword, "move")) + { + if (!str_cmp(pchg->value, "all")) + ch->move = UMAX(ch->move, ch->max_move); + else if (!str_cmp(pchg->value, "none")) + ch->move = UMIN(ch->move, 1); + else if (!str_cmp(pchg->value, "half")) + ch->move = UMAX(1, ch->move/2); + else if (!str_cmp(pchg->value, "double")) + ch->move = UMIN(ch->max_move+(ch->max_move/5), ch->move*2); + else if (!str_cmp(pchg->value, "sub")) + ch->move = UMAX(1, ch->move-(ch->move/10)); + else if (!str_cmp(pchg->value, "add")) + ch->move = UMIN(ch->move+(ch->move/10), ch->max_move+(ch->max_move/5)); + else + { + sprintf( log_buf, "BUG: bad dream change value: %s", pchg->value); + log_string( log_buf ); + } + } + else + { + sprintf( log_buf, "BUG: bad dream change keyword: %s", pchg->keyword); + log_string( log_buf ); + } + } + if (pDrmIndex->move) + { + ROOM_INDEX_DATA *location; + + if ( ( location = get_room_index( pDrmIndex->move ) ) != NULL ) + { + act("$n stands up and wanders off in $s sleep.",ch,NULL,NULL,TO_ROOM); + char_from_room( ch ); + char_to_room( ch, location ); + } + } + for ( pobj = pDrmIndex->object; pobj != NULL; pobj = pobj->next ) + { + OBJ_INDEX_DATA *pObjIndex; + OBJ_DATA *obj; + int level; + + if ( ( pObjIndex = get_obj_index( pobj->vnum ) ) == NULL ) + { + sprintf( log_buf, "BUG: bad dream object vnum %d", pobj->vnum); + log_string( log_buf ); + continue; + } + obj = create_object( pObjIndex, 0 ); + if (pobj->variable) + { + level = ch->level; + obj->level = level; + if (pObjIndex->item_type == ITEM_WEAPON) + { + float adlev, inclev; + int cntr; + + adlev = 8; + inclev = .01; + for (cntr = 0; cntr <= level; cntr++) + { + adlev += .57; + adlev += inclev; + inclev += .005; + } + cntr = (int)adlev; + obj->value[1] = cntr/3; + obj->value[2] = 3; + } + if (pObjIndex->item_type == ITEM_ARMOR) + { + obj->value[0] = (level/6)+5; + obj->value[1] = (level/6)+5; + obj->value[2] = (level/6)+5; + obj->value[3] = level/6; + } + } + if (pobj->t_min || pobj->t_max) + { + if (pobj->t_max >= pobj->t_min) + { + obj->timer = number_range(pobj->t_min, pobj->t_max); + } + } + if ( !str_cmp(pobj->roomchar, "char") ) + { + obj_to_char( obj, ch ); + } else if ( !str_cmp(pobj->roomchar, "room") ) + { + obj_to_room( obj, ch->in_room ); + } else + { + sprintf( log_buf, "BUG: bad dream roomchar value %s", pobj->roomchar); + log_string( log_buf ); + } + } + } + } + } + + /* * Careful with the damages here, * MUST NOT refer to ch after damage taken, @@ -845,7 +1163,7 @@ int dam; if (ch->in_room == NULL) - return; + continue; act("$n writhes in agony as plague sores erupt from $s skin.", ch,NULL,NULL,TO_ROOM); @@ -859,11 +1177,11 @@ if (af == NULL) { REMOVE_BIT(ch->affected_by,AFF_PLAGUE); - return; + continue; } if (af->level == 1) - return; + continue; plague.where = TO_AFFECTS; plague.type = gsn_plague; @@ -888,7 +1206,7 @@ dam = UMIN(ch->level,af->level/5+1); ch->mana -= dam; ch->move -= dam; - damage_old( ch, ch, dam, gsn_plague,DAM_DISEASE,FALSE); + damage( ch, ch, dam, gsn_plague,DAM_DISEASE,FALSE); } else if ( IS_AFFECTED(ch, AFF_POISON) && ch != NULL && !IS_AFFECTED(ch,AFF_SLOW)) @@ -902,7 +1220,7 @@ { act( "$n shivers and suffers.", ch, NULL, NULL, TO_ROOM ); send_to_char( "You shiver and suffer.\n\r", ch ); - damage_old(ch,ch,poison->level/10 + 1,gsn_poison, + damage(ch,ch,poison->level/10 + 1,gsn_poison, DAM_POISON,FALSE); } } @@ -1175,7 +1493,7 @@ * Random times to defeat tick-timing clients and players. */ -void update_handler( void ) +void update_handler( bool forced ) { static int pulse_area; static int pulse_mobile; @@ -1185,7 +1503,8 @@ if ( --pulse_area <= 0 ) { - pulse_area = PULSE_AREA; + pulse_area = number_range(PULSE_AREA, 3 * PULSE_AREA / 2); + /* pulse_area = PULSE_AREA; */ /* number_range( PULSE_AREA / 2, 3 * PULSE_AREA / 2 ); */ area_update ( ); } @@ -1208,15 +1527,23 @@ violence_update ( ); } + if (forced) + { + pulse_point = 0; + } + forced = FALSE; + if ( --pulse_point <= 0 ) { wiznet("TICK!",NULL,NULL,WIZ_TICKS,0,0); - pulse_point = PULSE_TICK; -/* number_range( PULSE_TICK / 2, 3 * PULSE_TICK / 2 ); */ + pulse_point = number_range(PULSE_TICK / 3 * 2, 3 * PULSE_TICK / 2); + /* pulse_point = PULSE_TICK; */ + /* number_range( PULSE_TICK / 2, 3 * PULSE_TICK / 2 ); */ weather_update ( ); - char_update ( ); obj_update ( ); + char_update ( ); randomize_entrances ( ROOM_VNUM_CHAIN ); + randomize_entrances ( ROOM_VNUM_LADDER ); } aggr_update( ); --- wizlist.c Mon Aug 25 13:51:10 1997 +++ ../../Rot20/src/wizlist.c Fri Aug 6 23:06:04 1999 @@ -1,34 +1,32 @@ -/*************************************************************************** - * 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-1995 Russ Taylor * -* ROM has been brought to you by the ROM consortium * -* Russ Taylor (rtaylor@pacinfo.com) * -* Gabrielle Taylor (gtaylor@pacinfo.com) * -* Brian Moore (rom@rom.efn.org) * -* By using this code, you have agreed to follow the terms of the * -* ROM license, in the file Rom24/doc/rom.license * +* 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. * ***************************************************************************/ - -/*************************************************************************** -* ROT 1.4 is copyright 1996-1997 by Russ Walsh * -* By using this code, you have agreed to follow the terms of the * -* ROT license, in the file doc/rot.license * +/*************************************************************************** +* ROM 2.4 is copyright 1993-1995 Russ Taylor * +* ROM has been brought to you by the ROM consortium * +* Russ Taylor (rtaylor@pacinfo.com) * +* Gabrielle Taylor (gtaylor@pacinfo.com) * +* Brian Moore (rom@rom.efn.org) * +* By using this code, you have agreed to follow the terms of the * +* ROM license, in the file 'rom.license' * +***************************************************************************/ +/*************************************************************************** +* ROT 2.0 is copyright 1996-1999 by Russ Walsh * +* By using this code, you have agreed to follow the terms of the * +* ROT license, in the file 'rot.license' * ***************************************************************************/ #if defined(macintosh)